alexneo2003 / playwright-azure-reporter

Playwright Azure DevOps Reporter
MIT License
69 stars 10 forks source link

[Feature]: Reflect the result of a test.step with the corresponding step in azure #14

Open joerg1985 opened 1 year ago

joerg1985 commented 1 year ago

As mentioned in #4 there are steps inside the azure testcases. It would be greate to connect the playwright test.step with the azure steps. To link these the same syntax like linking the testcases could be used, e.g. test.step("[2] login to the system") -> is linked to the second step.

This is a minimal example of a playwright test using steps:

test.describe('google div', () => {
  test('[31] failing is enabled', async ({ page }) => {
    await test.step("[1] Just a step", async () => {
      await expect(true).toBe(true);
    });

    await test.step("[2] Just another step", async () => {
      await expect(page.locator("div")).toBeEnabled();
    });
  })
})

The result of the steps are reflected correctly to the HTML report, so it should be possible to get the status of a step. This might be done using the TestStep.error field, this should be investigated.

joerg1985 commented 1 year ago

The behaviour of https://playwright.dev/docs/test-assertions#soft-assertions should also be invstigated.

alexneo2003 commented 1 year ago

at now i'm waiting for answer on my question which was asked at microsoft/azure-devops-node-api#545

amitasil commented 1 year ago

Eagerly waiting for this update!

alexneo2003 commented 1 year ago

Eagerly waiting for this update!

I'm sorry, but nothing depends on me now. I am waiting for a response from the developers microsoft/azure-devops-node-api#545 about the possibility of publishing similar results. and most likely such a possibility does not exist.

joerg1985 commented 1 year ago

@alexneo2003 i had a look at the API docs and the actionResults are used to reflect test steps. If you create a manual run with step results and look at it with the flag detailsToInclude=iterations set you can see the data. .../_apis/test/Runs/{run.id}/Results/{result.id}?detailsToInclude=iterations

Based on the API docs i thinks you could set the actionResults to an array of TestActionResultModel to push the results of test steps.

alexneo2003 commented 1 year ago

it's a good thing but when i'm add test results to test run i using this method. as you seen it has results: TestInterfaces.TestCaseResult[] argument wich doesn't contain any implementation of actionResults about you say. i'm see that ADO API has this actionResults as parameter but azure-devops-node-api doesn't has any functionality to work with it, or i doesn't seen it.