Skip to content

Commit 3b9bff9

Browse files
bug: wait for page before setting storage cookie
1 parent b09861d commit 3b9bff9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/integration/auth.setup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { test as setup } from '@playwright/test';
22
import path from 'path';
3+
import { BASE_URL } from './utils';
34

45
const authFile = path.join(__dirname, './.auth/user.json');
56

@@ -8,9 +9,10 @@ setup.describe('setup', () => {
89
await page.goto('/wp-login.php');
910
await page.fill('#user_login', 'admin');
1011
await page.fill('#user_pass', 'password');
11-
1212
await page.getByRole('button', { name: 'Log In' }).click();
1313

14+
await page.waitForURL(`${BASE_URL}/wp-admin`);
15+
1416
await page.context().storageState({ path: authFile });
1517
});
1618
});

0 commit comments

Comments
 (0)