docs(auth): use abs path, difference between storage locations (#32037)

Reference: https://github.com/microsoft/playwright/issues/31987
This commit is contained in:
Yury Semikhatsky 2024-08-06 11:36:49 -07:00 коммит произвёл GitHub
Родитель 43e852334b
Коммит 7f60f284c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -47,8 +47,9 @@ Create `tests/auth.setup.ts` that will prepare authenticated browser state for a
```js title="tests/auth.setup.ts"
import { test as setup, expect } from '@playwright/test';
import path from 'path';
const authFile = 'playwright/.auth/user.json';
const authFile = path.join(__dirname, '../playwright/.auth/user.json');
setup('authenticate', async ({ page }) => {
// Perform authentication steps. Replace these actions with your own.
@ -113,6 +114,8 @@ test('test', async ({ page }) => {
});
```
Note that you need to delete the stored state when it expires. If you don't need to keep the state between test runs, write the browser state under [`property: TestProject.outputDir`], which is automatically cleaned up before every test run.
### Authenticating in UI mode
* langs: js