Doing complex interactions using playwright
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
I have been using backstop for 2 weeks now on my project docxtemplater.com .
I'm very happy because it will catch many regressions that would occur on the website.
I have a feature request that would make the experience for me even better.
It would be to be allow to run any playwright script before doing the snapshot.
For example, one could do :
```
{
"label": "Dashboard",
"url": "http://localhost:9432/dashboard",
"playwright_action": "open_secret_dashboard",
"selectors": ["viewport"]
}
```
and then in `open_secret_dashboard.js` :
```
import { test, expect } from '@playwright/test';
test('basic test', async ({ page }) => {
// Text input
await page.fill('#name', 'Peter');
await page.fill('#password', 'Peter');
await page.click('button#submit');
await page.click('.tab-dashboard');
await Promise.all([
page.waitForSelector('#dashboard-customers'),
page.waitForSelector('#dashboard-providers')
]);
});
```
The snapshot would be taken right after the playwright script runs.
After posting the issue, I found out that maybe this usecase could be done from playwright itself :
https://hackernoon.com/visual-regression-testing-with-playwright (not using backstop at all)
Contributor guide
Assessment
This issue has not been assessed yet.