Add testing for Movement bug

This commit is contained in:
Matthias 2024-04-07 20:57:50 +02:00
parent 6695310a64
commit f2c584c631

View File

@ -31,18 +31,17 @@ test('Trade', async ({ page }) => {
await setLoginInfo(page); await setLoginInfo(page);
await tradeMocks(page); await tradeMocks(page);
await page.goto('/trade'); await page.goto('/trade');
// Wait for network requests // Wait for network requests
// await page.waitForResponse('**/ping'); // await page.waitForResponse('**/ping');
await page.waitForResponse('**/status'); await page.waitForResponse('**/status');
// await page.waitForResponse('**/Profit'); await page.waitForResponse('**/profit');
// await page.waitForResponse('**/Balance'); await page.waitForResponse('**/balance');
// await page.waitForResponse('**/Trades'); // await page.waitForResponse('**/trades');
// await page.waitForResponse('**/Whitelist'); await page.waitForResponse('**/whitelist');
// await page.waitForResponse('**/Blacklist'); await page.waitForResponse('**/blacklist');
// await page.waitForResponse('**/Locks'); await page.waitForResponse('**/locks');
// // Check visibility of elements // // Check visibility of elements
await expect(page.locator('.drag-header', { hasText: 'Multi Pane' })).toBeInViewport(); await expect(page.locator('.drag-header', { hasText: 'Multi Pane' })).toBeInViewport();
@ -68,8 +67,6 @@ test('Trade', async ({ page }) => {
), ),
).toBe(0); ).toBe(0);
// // Click on Stop Trading button
// await page.locator('.mt-1 > .mt-1').getByRole('button').getByTitle('Stop Trading').click(); // await page.locator('.mt-1 > .mt-1').getByRole('button').getByTitle('Stop Trading').click();
// // Modal open // // Modal open
@ -116,4 +113,24 @@ test('Trade', async ({ page }) => {
// // Click on Reload Config button // // Click on Reload Config button
// await page.locator('button[title*="Reload Config "]').click(); // await page.locator('button[title*="Reload Config "]').click();
await page.locator('#avatar-drop').click();
await page.getByLabel('Lock layout').uncheck();
const chartHeader = await page.locator('.drag-header:has-text("Chart")');
await expect(multiPane).toBeInViewport();
await expect(chartHeader).toBeInViewport();
// Test drag and drop functionality
const chartHeaderbb = await chartHeader.boundingBox();
if (chartHeaderbb) {
await chartHeader.hover();
await page.mouse.down();
await page.mouse.move(chartHeaderbb?.x + chartHeaderbb.width / 2, chartHeaderbb?.y + 200);
await page.mouse.up();
await expect(multiPane).toBeInViewport();
await expect(chartHeader).toBeInViewport();
}
}); });