Initial
This commit is contained in:
commit
b43955e0d9
162 changed files with 15425 additions and 0 deletions
39
tests/e2e/settings.spec.ts
Normal file
39
tests/e2e/settings.spec.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { test, expect, type Page } from '@playwright/test';
|
||||
|
||||
async function login(page: Page) {
|
||||
await page.goto('/login/');
|
||||
await page.fill('#lg-username', 'demo');
|
||||
await page.fill('#lg-password', 'demo');
|
||||
await page.click('button[type=submit]');
|
||||
await expect(page.getByTestId('nav-menu')).toBeVisible();
|
||||
}
|
||||
|
||||
test('settings persist across a reload and switch the UI language', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.getByTestId('tab-settings').click();
|
||||
|
||||
// Coordinate format is a display-only setting; it must survive a reload.
|
||||
await page.getByTestId('set-format.coords').selectOption('dms');
|
||||
await page.getByTestId('set-format.units').selectOption('imperial');
|
||||
|
||||
// Locale takes effect immediately (dictionaries swap in place).
|
||||
await page.getByTestId('set-locale').selectOption('en');
|
||||
await expect(page.getByTestId('tab-settings')).toHaveText('Settings');
|
||||
|
||||
await page.reload();
|
||||
await page.getByTestId('tab-settings').click();
|
||||
await expect(page.getByTestId('set-format.coords')).toHaveValue('dms');
|
||||
await expect(page.getByTestId('set-format.units')).toHaveValue('imperial');
|
||||
await expect(page.getByTestId('set-locale')).toHaveValue('en');
|
||||
});
|
||||
|
||||
test('the comparison tab reports landing coordinates for a run scenario', async ({ page }) => {
|
||||
await login(page);
|
||||
await page.getByTestId('run-btn').click();
|
||||
await expect(page.getByTestId('flight-time')).toBeVisible({ timeout: 15000 });
|
||||
|
||||
await page.getByTestId('tab-compare').click();
|
||||
await expect(page.getByTestId('compare-table')).toBeVisible();
|
||||
// One scenario → a row, but no spread figure yet (that needs two).
|
||||
await expect(page.getByTestId('compare-spread')).toHaveCount(0);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue