swap before/after

This commit is contained in:
Yury Semikhatsky 2024-08-27 16:24:23 -07:00
parent fb6a6d0d47
commit 765d5ac73f

View file

@ -731,12 +731,12 @@ export const test = base.extend({
import { test as base } from '@playwright/test'; import { test as base } from '@playwright/test';
export const test = base.extend({ export const test = base.extend({
sharedAfterEach: [async ({ page, baseURL }, use) => { sharedBeforeEach: [async ({ page, baseURL }, use) => {
await page.goto(baseURL); await page.goto(baseURL);
await use(); await use();
}, { scope: 'test', auto: true } ], // starts automatically before every test, we pass "auto" for that. }, { scope: 'test', auto: true } ], // starts automatically before every test, we pass "auto" for that.
sharedBeforeEach: [async ({ page }, use) => { sharedAfterEach: [async ({ page }, use) => {
await use(); await use();
console.log('Test final URL:', page.url()); console.log('Test final URL:', page.url());
}, { scope: 'test', auto: true } ], // starts automatically after every test, we pass "auto" for that. }, { scope: 'test', auto: true } ], // starts automatically after every test, we pass "auto" for that.