Initial
This commit is contained in:
commit
b43955e0d9
162 changed files with 15425 additions and 0 deletions
26
tests/e2e/account.spec.ts
Normal file
26
tests/e2e/account.spec.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { test, expect, type Page } from '@playwright/test';
|
||||
|
||||
async function login(page: Page, user = 'demo', pass = 'demo') {
|
||||
await page.goto('/login/');
|
||||
await page.fill('#lg-username', user);
|
||||
await page.fill('#lg-password', pass);
|
||||
await page.click('button[type=submit]');
|
||||
await expect(page.getByTestId('nav-menu')).toBeVisible();
|
||||
}
|
||||
|
||||
test('account page loads the profile and updates the email', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/user/account/');
|
||||
await expect(page.locator('#ac-email')).toHaveValue('demo@example.com');
|
||||
await page.fill('#ac-email', 'demo2@example.com');
|
||||
await page.getByRole('button', { name: /save|сохранить/i }).click();
|
||||
await expect(page.locator('.toast')).toBeVisible();
|
||||
});
|
||||
|
||||
test('delete-data requires an inline confirm', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/user/account/');
|
||||
await page.getByRole('button', { name: /delete my data|удалить мои данные/i }).click();
|
||||
await page.getByTestId('confirm-delete-data').click();
|
||||
await expect(page.locator('.toast')).toBeVisible();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue