Closed hex0cter closed 1 year ago
I think the same!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I would like to have it too.
This should definitely be built-in, but in the meantime, you can use a Playwright custom reporter to mark all tests results with defect: false
:
playwright/qaseReporter.ts
import PlaywrightReporter from 'playwright-qase-reporter'
// @ts-expect-error: ESM stuff
class PlaywrightQaseReporter extends PlaywrightReporter.default {
public async onEnd(): Promise<void> {
// @ts-expect-error: Not sure how to type this
this.resultsToBePublished = this.resultsToBePublished.map((result) => ({
...result,
defect: false,
}))
await super.onEnd()
}
}
export default PlaywrightQaseReporter
(^ I needed to extend from PlaywrightReporter.default
, you may or may not need the .default
)
playwright.config.ts
import { defineConfig } from '@playwright/test'
export default defineConfig({
reporter: [
['list'],
[
'./playwright/qaseReporter.ts',
{
apiToken: process.env.QASE_API_TOKEN,
logging: true,
projectCode: '<project>',
runComplete: true,
uploadAttachments: true,
},
],
],
...
})
(^ Be sure to replace <project>
with your project code)
FYI, it looks like this behavior was removed in version 2, so test failures won't automatically create defects :+1:
Qase plugin for playwright creates a defect whenever an automated test fails. There is very useful in some scenarios but can also create a lot of noise if you don't need it. In our case we use defect only when we run the manual tests. When the automated tests fail, we have tons of other ways to keep track of them. Right now the plugin creates a defect whether you want it or not, which really mess up with the defects people created manually.
Could you please make this behaviour optional?