Skip to content

Commit

Permalink
chore: enable screenshots in playwright reports
Browse files Browse the repository at this point in the history
  • Loading branch information
JuroUhlar committed Feb 29, 2024
1 parent 6886ac9 commit 2a84498
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion e2e/scraping/protected.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { TEST_IDS } from '../../src/client/testIDs';
test.describe('Scraping flights', () => {
test('is not possible with Bot detection on', async ({ page }) => {
await page.goto('/web-scraping');
await expect(page.getByTestId(TEST_IDS.common.alert)).toContainText('Malicious bot detected', {
const alert = await page.getByTestId(TEST_IDS.common.alert);
await alert.scrollIntoViewIfNeeded();

Check failure on line 8 in e2e/scraping/protected.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright e2e tests (2, 3)

[firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on

1) [firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on Error: locator.scrollIntoViewIfNeeded: Test timeout of 30000ms exceeded. Call log: - waiting for getByTestId('alert') 6 | await page.goto('/web-scraping'); 7 | const alert = await page.getByTestId(TEST_IDS.common.alert); > 8 | await alert.scrollIntoViewIfNeeded(); | ^ 9 | expect(alert).toContainText('Malicious bot detected', { 10 | timeout: 10000, 11 | }); at /home/runner/work/fingerprintjs-pro-use-cases/fingerprintjs-pro-use-cases/e2e/scraping/protected.spec.ts:8:17

Check failure on line 8 in e2e/scraping/protected.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright e2e tests (2, 3)

[firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on

1) [firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.scrollIntoViewIfNeeded: Test timeout of 30000ms exceeded. Call log: - waiting for getByTestId('alert') 6 | await page.goto('/web-scraping'); 7 | const alert = await page.getByTestId(TEST_IDS.common.alert); > 8 | await alert.scrollIntoViewIfNeeded(); | ^ 9 | expect(alert).toContainText('Malicious bot detected', { 10 | timeout: 10000, 11 | }); at /home/runner/work/fingerprintjs-pro-use-cases/fingerprintjs-pro-use-cases/e2e/scraping/protected.spec.ts:8:17

Check failure on line 8 in e2e/scraping/protected.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright e2e tests (2, 3)

[firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on

1) [firefox] › scraping/protected.spec.ts:5:7 › Scraping flights › is not possible with Bot detection on Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.scrollIntoViewIfNeeded: Test timeout of 30000ms exceeded. Call log: - waiting for getByTestId('alert') 6 | await page.goto('/web-scraping'); 7 | const alert = await page.getByTestId(TEST_IDS.common.alert); > 8 | await alert.scrollIntoViewIfNeeded(); | ^ 9 | expect(alert).toContainText('Malicious bot detected', { 10 | timeout: 10000, 11 | }); at /home/runner/work/fingerprintjs-pro-use-cases/fingerprintjs-pro-use-cases/e2e/scraping/protected.spec.ts:8:17
expect(alert).toContainText('Malicious bot detected', {
timeout: 10000,
});
});
Expand Down
6 changes: 3 additions & 3 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
use: { ...devices['Desktop Chrome'], screenshot: { mode: 'only-on-failure' } },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
use: { ...devices['Desktop Firefox'], screenshot: { mode: 'only-on-failure' } },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
use: { ...devices['Desktop Safari'], screenshot: { mode: 'only-on-failure' } },
},

/* Test against mobile viewports. */
Expand Down

0 comments on commit 2a84498

Please sign in to comment.