mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 10:21:55 +00:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
|
|
import { setLoginInfo, defaultMocks, getWaitForResponse } from './helpers';
|
|
|
|
test.describe('Logs', () => {
|
|
test('Displays and reloads logs', async ({ page }) => {
|
|
///
|
|
await defaultMocks(page);
|
|
await setLoginInfo(page);
|
|
// const pingPromise = page.route('**/*ping*',
|
|
|
|
// const logsPromise = page.waitForResponse('**/api/v1/logs');
|
|
await page.route('**/api/v1/logs', (route) => {
|
|
return route.fulfill({ path: './cypress/fixtures/logs.json' });
|
|
});
|
|
|
|
const logs = getWaitForResponse(page, '@Logs');
|
|
const ping = getWaitForResponse(page, '@ShowConf');
|
|
await page.goto('/logs', { waitUntil: 'networkidle' });
|
|
await Promise.all([logs, ping]);
|
|
|
|
await expect(page.locator('textarea')).toBeVisible();
|
|
await expect(page.locator('textarea')).toHaveValue(/Checking exchange.../, {});
|
|
// const logsPromise = page.waitForResponse('**/api/v1/logs');
|
|
const logsPromise = getWaitForResponse(page, '@Logs');
|
|
await page.getByRole('button', { name: 'Reload Logs' }).click();
|
|
await logsPromise;
|
|
});
|
|
});
|