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

Unable to run example tests with reporter - Cannot read properties of undefined (reading 'rootSuite') #56

Closed
shwarcu opened this issue Aug 13, 2022 · 5 comments · Fixed by #58 or #66
Assignees

Comments

@shwarcu
Copy link

shwarcu commented Aug 13, 2022

Hi,
I created repository for problem reproduction https://github.com/shwarcu/playwright-reportportal-example.
Here is how I got up to this point:
I deployed ReportPortal locally with docker and created initial tests setup with npm init playwright@latest.
Then I added agent-js-playwright reporter to the config and changed testDir to take tests from ./tests-examples.

When running example tests I keep getting this error:

Running 50 tests using 4 workers

  ✓  1 [chromium] › demo-todo-app.spec.ts:61:3 › New Todo › should show #main and #footer when items added (1s)
  ✓  2 [chromium] › demo-todo-app.spec.ts:14:3 › New Todo › should allow me to add todo items (1s)
  ✓  3 [chromium] › demo-todo-app.spec.ts:47:3 › New Todo › should append new items to the bottom of the list (1s)
  ✓  4 [chromium] › demo-todo-app.spec.ts:37:3 › New Todo › should clear text input field when an item is added (1s)
  ✓  5 [chromium] › demo-todo-app.spec.ts:81:3 › Mark all as completed › should allow me to mark all items as completed (795ms)
     6 [chromium] › demo-todo-app.spec.ts:90:3 › Mark all as completed › should allow me to clear the complete state of all items
     7 [chromium] › demo-todo-app.spec.ts:99:3 › Mark all as completed › complete all checkbox should update state when items are completed / cleared
     8 [chromium] › demo-todo-app.spec.ts:122:3 › Item › should allow me to mark items as complete
/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:462
                        rootSuiteName = parentObj.rootSuite;
                                                  ^

TypeError: Cannot read properties of undefined (reading 'rootSuite')
    at RPReporter.<anonymous> (/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/src/reporter.ts:483:37)
    at step (/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:60:23)
    at Object.next (/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:41:53)
    at /home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:35:71
    at new Promise (<anonymous>)
    at __awaiter (/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:31:12)
    at RPReporter.onTestEnd (/home/maciej/workspace/playwright-reportportal-example/node_modules/@reportportal/agent-js-playwright/build/reporter.js:423:16)
    at /home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/reporters/multiplexer.js:69:131
    at wrap (/home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/reporters/multiplexer.js:119:5)
    at Multiplexer.onTestEnd (/home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/reporters/multiplexer.js:66:45)
    at Dispatcher._reportTestEnd (/home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/dispatcher.js:574:159)
    at Worker.onTestEnd (/home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/dispatcher.js:240:12)
    at Worker.emit (node:events:390:28)
    at ChildProcess.<anonymous> (/home/maciej/workspace/playwright-reportportal-example/node_modules/@playwright/test/lib/dispatcher.js:633:12)
    at ChildProcess.emit (node:events:390:28)

Related issue #42
Probably regression from last release?

@rafalszmit
Copy link

I also see these errors lately:

(node:9318) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'rootSuite' of undefined
583    at RPReporter.<anonymous> ([<path hid by me>]/node_modules/@reportportal/agent-js-playwright/src/reporter.ts:483:37)
584    at step ([<path hid by me>]/node_modules/@reportportal/agent-js-playwright/build/reporter.js:60:23)
585    at Object.next ([<path hid by me>]/node_modules/@reportportal/agent-js-playwright/build/reporter.js:41:53)
586    at fulfilled ([<path hid by me>]/node_modules/@reportportal/agent-js-playwright/build/reporter.js:32:58)
587(Use `node --trace-warnings ...` to show where the warning was created)
588(node:9318) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
589(node:9318) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The reportportal shows that the jobs are running even tho they were finished on CI. Nothing was changed by us around configuration and it was working in past with no issues.

it is present on versions (the only ones I checked so far):
"@reportportal/agent-js-playwright": "^5.0.2",
"@reportportal/agent-js-playwright": "^5.0.5",

@MichalFidor
Copy link

MichalFidor commented Aug 19, 2022

Something has happened between 15.08.2022 11:30 CET time - this was the last run we've had in a project and everything was okay. The first occurrence I've spotted at 15.08.2022 21:00 CET time after this date almost every run contains this error.

Checked on versions:
"@reportportal/agent-js-playwright": "^5.0.2",
"@reportportal/agent-js-playwright": "^5.0.5",
"@playwright/test": "^1.25.0"
"@playwright/test": "^1.24.0"

Was working fine on:
"@reportportal/agent-js-playwright": "^5.0.2",
"@playwright/test": "^1.24.0"

Edit:
We've also spotted that when we have trace disabled, then this error doesn't occur.

@chivekrodis chivekrodis linked a pull request Aug 24, 2022 that will close this issue
Bam6ycha pushed a commit that referenced this issue Aug 24, 2022
Add link for GitHub issue #56.
Bam6ycha pushed a commit that referenced this issue Aug 24, 2022
Add link for GitHub issue #56.
Bam6ycha pushed a commit that referenced this issue Aug 24, 2022
Add link for GitHub issue #56.
@AmsterGet
Copy link
Member

AmsterGet commented Sep 14, 2022

Hello guys!
We have released a version 5.0.7 with a fixes.
Could you confirm that this fixes the issue?

@shwarcu
Copy link
Author

shwarcu commented Sep 14, 2022

@AmsterGet Hi, I will check that afternoon when I'm done with my daily duties ;)

@shwarcu
Copy link
Author

shwarcu commented Sep 16, 2022

Hi, sorry for delayed response. After updating the package, it is indeed working without errors 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants