Skip to content

playwright un-necessary success logs #1

@avi-ran

Description

@avi-ran

Hello and thank you very much for this plugin. It's very helpful and easy to use!

I have one "small" issue currently when using this plugin with playwright: I see a ton of logs about successful validation tests but they don't refer to a specific test. Therefore, in my case, they don't have a lot of added value:

Example:

pw-contract-1  | Running 9 tests using 8 workers
pw-contract-1  | 
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!
pw-contract-1  |   ✓  1 [chromium] › tests/contract-tests/email.spec.ts:34:9 › Send email contract check › Success - ctx: {"path":"/custom_email/","method":"POST","status":204} (1.5s)
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!
pw-contract-1  | ✔️   PASSED - THE RESPONSE BODY IS VALID AGAINST THE SCHEMA!

Would it be posssible to add a env variable to disable the extra console.log(passResponseBodyAgainstSchema) at each successful validation test ?

something like this in the index.ts:

            await test.step(`${passResponseBodyAgainstSchema}`, async () => {
                if (process.env.DISABLE_SUCCESS_MSG === 'true') {
                    console.log(passResponseBodyAgainstSchema)
                }
            })

Kind regards,
Aviran

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions