microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
66.39k stars 3.63k forks source link

[BUG] #28493

Closed asdf23 closed 10 months ago

asdf23 commented 10 months ago

System info

Source code

https://playwright.dev/docs/api/class-reporter

[Please provide a self-contained example in a form of a snippet, archive or a repository.]

Follow code on https://playwright.dev/docs/api/class-reporter

Steps Create cusotm reporter following directions Run the test crash

Expected

Custom reporter console.logging to screen

Actual

TypeError: r is not iterable at createReporters (C:\vc\PlaywrightWebAutomation\node_modules\playwright\lib\runner\reporters.js:55:25) at Runner.runAllTests (C:\vc\PlaywrightWebAutomation\node_modules\playwright\lib\runner\runner.js:65:127) at runTests (C:\vc\PlaywrightWebAutomation\node_modules\playwright\lib\cli.js:130:106) at t. (C:\vc\PlaywrightWebAutomation\node_modules\playwright\lib\cli.js:40:7)

asdf23 commented 10 months ago

Changing playwwright.config.ts to

...snip.. reporter: ['./my-awesome-reporter.ts', { customOption: 'some value' }], ....snip...

to ...snip.. reporter: [['./my-awesome-reporter.ts', { customOption: 'some value' }]], ....snip...

resolves the issue