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

Button to approve or disapprove new screenshot if there is a mismatch #1

Open
zinaelnahel opened this issue Jul 31, 2024 · 3 comments

Comments

@zinaelnahel
Copy link

Hi Sudharsan , first of all great work. Second here is my question is there a way to use this library without this adapter part because I already have the S3 bucket part working and the screenshots as well as the report are deployed there. I just want to import the PlayShotMatcher and use it directly is that possible ?
import { test as BaseTest, expect } from '@playwright/test';
import { PlayShot } from 'playwright-cloud-visuals';

const playshot = new PlayShot({
adapter: s3Adapter, // or sshAdapter for SFTP
remotePathDelimiter: 'screenshots',
});

const test =
BaseTest.extend <{ playShot: PlayShotMatcher }>
{
playShot: async ({ page }, use, testInfo) => {
await use(playshot.createMatcher(page, testInfo));
},
};

export default test; Also does the button to disapprove or approve the new different screenshot appear on the playwright report or are you generating a customized report ? Thanks in advance for your reply

@sudharsan-selvaraj
Copy link
Owner

Hey @zinaelnahel, we don't have a sophesticated way to updated the screenshots via reporter the this point.

What this library currently does is, users can pass in a parameter during the assertion to let the library know to automatically replace the current screenshot to the s3 bucket.

await playShot.assertPage({
  update: true,
});

@zinaelnahel
Copy link
Author

Ah ok so we can not see it in the report and then choose to approve or disapprove via a button in the playwright report

@sudharsan-selvaraj
Copy link
Owner

Ah no, it not feasible with the current playwright reported. We need to create a custom reporter to able to achieve that.

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

No branches or pull requests

2 participants