mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-21 23:53:52 +00:00
Add settings playwright test
This commit is contained in:
parent
59578a434b
commit
47de346df9
33
e2e/settings.spec.ts
Normal file
33
e2e/settings.spec.ts
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import { test, expect } from '@playwright/test';
|
||||||
|
import { setLoginInfo, defaultMocks } from './helpers';
|
||||||
|
|
||||||
|
test.describe('Settings', () => {
|
||||||
|
test('Settings stores', async ({ page }) => {
|
||||||
|
await setLoginInfo(page);
|
||||||
|
await defaultMocks(page);
|
||||||
|
await Promise.all([
|
||||||
|
page.goto('/'),
|
||||||
|
// page.waitForResponse('**/Ping'),
|
||||||
|
// page.waitForResponse('**/ShowConf'),
|
||||||
|
]);
|
||||||
|
// await expect(page.locator('li', { hasText: 'Online' })).toBeInViewport();
|
||||||
|
await expect(page.locator('h1', { hasText: 'Welcome to the Freqtrade UI' })).toBeInViewport({
|
||||||
|
timeout: 5000,
|
||||||
|
});
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('[id=avatar-drop]')
|
||||||
|
.isVisible()
|
||||||
|
.then(() => page.locator('[id=avatar-drop]').click());
|
||||||
|
await page.locator('.dropdown-menu > * > [href="/settings"]').click();
|
||||||
|
await expect(page.locator(':text("FreqUI Settings")')).toBeVisible();
|
||||||
|
|
||||||
|
// Switch option in the settings.
|
||||||
|
await page.locator('select').first().selectOption('asTitle');
|
||||||
|
|
||||||
|
const settings = await page.evaluate(() =>
|
||||||
|
JSON.parse(window.localStorage.getItem('ftUISettings') || '{}'),
|
||||||
|
);
|
||||||
|
await expect(settings['openTradesInTitle']).toBe('asTitle');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user