Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails on this.findTestItem(this.testItems, test.title, playwrightProjectName).id #62

Open
vivienbcr opened this issue Sep 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working workaround The workaround available to avoid the bug

Comments

@vivienbcr
Copy link

vivienbcr commented Sep 1, 2022

Hi,
I'm facing to the same issue described in #45

Versions tested :
"@playwright/test": "^1.24.2" "^1.25.1"
"@reportportal/agent-js-playwright": "^5.0.5","^5.0.4"

Reporter agent works well if i run test like this :

test("mytest", async ({ page, browser, context }) => {
//
}

But it will fail if i used describe in list file like :

export default function createTests() {
  test("mytest", async ({ page, browser, context }) => {
  //
  }
}
import { test } from "@playwright/test"
import x from "test.spec"
test.describe(x)

With error in AfterEach step :

/.../node_modules/@reportportal/agent-js-playwright/build/reporter.js:430
                        _b = this.findTestItem(this.testItems, test.title, playwrightProjectName), testItemId = _b.id, attributes = _b.attributes, description = _b.description, testCaseId = _b.testCaseId, predefinedStatus = _b.status;
                                                                                                                   ^

TypeError: Cannot read properties of undefined (reading 'id')

This error occurs regardless of the value in the option includeTestSteps: true|false

@AmsterGet AmsterGet self-assigned this Sep 13, 2022
@AmsterGet
Copy link
Member

AmsterGet commented Sep 14, 2022

Hello @vivienbcr !
Seems like this error occurs because you are using test.describe without a title.
At the moment (versions 5.0.*), the agent uses titles to build a tree of suites.
Therefore, as a workaround, I suggest to provide a title for the test.describe function.
We will fix this issue in future versions.

@AmsterGet AmsterGet added the bug Something isn't working label Sep 14, 2022
@AmsterGet AmsterGet added the workaround The workaround available to avoid the bug label Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround The workaround available to avoid the bug
Projects
None yet
Development

No branches or pull requests

2 participants