mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 10:21:55 +00:00
40 lines
2.0 KiB
TypeScript
40 lines
2.0 KiB
TypeScript
|
import { test, expect } from '@playwright/test';
|
||
|
import { setLoginInfo, defaultMocks, tradeMocks } from './helpers';
|
||
|
|
||
|
test.describe('Dashboard', () => {
|
||
|
test.beforeEach(async ({ page }) => {
|
||
|
await defaultMocks(page);
|
||
|
await tradeMocks(page);
|
||
|
await setLoginInfo(page);
|
||
|
});
|
||
|
test('Dashboard Page', async ({ page }) => {
|
||
|
await Promise.all([
|
||
|
page.goto('/dashboard'),
|
||
|
page.waitForResponse('**/status'),
|
||
|
page.waitForResponse('**/profit'),
|
||
|
page.waitForResponse('**/balance'),
|
||
|
// page.waitForResponse('**/trades'),
|
||
|
page.waitForResponse('**/whitelist'),
|
||
|
page.waitForResponse('**/blacklist'),
|
||
|
page.waitForResponse('**/locks'),
|
||
|
]);
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Bot comparison' })).toBeVisible();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Bot comparison' })).toBeInViewport();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Daily Profit' })).toBeVisible();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Daily Profit' })).toBeInViewport();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Open trades' })).toBeVisible();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Open trades' })).toBeInViewport();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Cumulative Profit' })).toBeVisible();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Cumulative Profit' })).toBeInViewport();
|
||
|
|
||
|
await expect(page.locator('span', { hasText: 'TestBot' })).toBeVisible();
|
||
|
await expect(page.locator('span', { hasText: 'Summary' })).toBeVisible();
|
||
|
// Scroll to bottom
|
||
|
await page.locator('.drag-header', { hasText: 'Trades Log' }).scrollIntoViewIfNeeded();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Closed Trades' })).toBeInViewport();
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Profit Distribution' })).toBeInViewport();
|
||
|
|
||
|
await expect(page.locator('.drag-header', { hasText: 'Trades Log' })).toBeInViewport();
|
||
|
});
|
||
|
});
|