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

[JS] Add ability to assert against visual results, Add upload retry #152

Merged
merged 11 commits into from
Oct 16, 2024

Conversation

omacranger
Copy link
Member

@omacranger omacranger commented Oct 11, 2024

Description

Adds the ability to assert against Sauce Visual results during test executions on Playwright and unifies the code for other frameworks already utilizing it.

Can either use the sauceVisual.visualResults() fixture or sauceVisualResults function directly to get the result summary for an individual test and make assertions on it like what is available in Cypress / WDIO.

Ex:

test('should be able to login with standard user', async ({ page, sauceVisual }) => {
       // .. other test commands here
        await sauceVisual.visualCheck("Inventory Page");
        expect(await sauceVisual.sauceVisualResults()).toHaveProperty(DiffStatus.Unapproved, 0);
});

This also adds a retry mechanism for DOM / Snapshot uploads to GCS.

Types of Changes

  • New feature (non-breaking change which adds functionality)

Logan Graham added 3 commits October 11, 2024 16:58
…sults in a playwright run

expose additional options for playwright snapshots
keep track of current test context / execution to assert visual results in Playwright
Copy link
Contributor

@konraddysput konraddysput left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, I think we should get additional check from @ebekebe or @paweltomaszewskisaucelabs

visual-js/visual-playwright/src/fixtures.ts Show resolved Hide resolved
visual-js/visual-playwright/src/api.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ebekebe ebekebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

visual-js/visual-playwright/src/api.ts Show resolved Hide resolved
@omacranger omacranger changed the title [Playwright] Add ability to assert against visual results [JS] Add ability to assert against visual results, Add upload retry Oct 15, 2024
@omacranger omacranger requested a review from ebekebe October 15, 2024 18:54
@omacranger omacranger merged commit f797342 into main Oct 16, 2024
5 checks passed
@omacranger omacranger deleted the feat/sauce-results branch October 16, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants