update Playwright tests for new testdata location

This commit is contained in:
Matthias 2024-04-14 09:11:25 +02:00
parent 58f1d570de
commit b6be4edba1
4 changed files with 8 additions and 8 deletions

View File

@ -5,20 +5,20 @@ test.describe('Backtesting', () => {
test.beforeEach(async ({ page }) => {
await defaultMocks(page);
page.route('**/api/v1/show_config', (route) => {
return route.fulfill({ path: `./cypress/fixtures/backtest/show_config_webserver.json` });
return route.fulfill({ path: `./e2e/testData/backtest/show_config_webserver.json` });
});
page.route('**/api/v1/strategies', (route) => {
return route.fulfill({ path: `./cypress/fixtures/backtest/strategies.json` });
return route.fulfill({ path: `./e2e/testData/backtest/strategies.json` });
});
await page.route('**/api/v1/backtest', (route) => {
if (route.request().method() === 'POST') {
route.fulfill({
path: './cypress/fixtures/backtest/backtest_post_start.json',
path: './e2e/testData/backtest/backtest_post_start.json',
});
} else if (route.request().method() === 'GET') {
route.fulfill({
path: './cypress/fixtures/backtest/backtest_get_end.json',
path: './e2e/testData/backtest/backtest_get_end.json',
});
}
});

View File

@ -29,7 +29,7 @@ interface mockArray {
function mockRequests(page, mocks: mockArray[]) {
mocks.forEach((item) => {
page.route(item.url, (route) => {
return route.fulfill({ path: `./cypress/fixtures/${item.fixture}` });
return route.fulfill({ path: `./e2e/testData/${item.fixture}` });
});
});
}

View File

@ -11,7 +11,7 @@ test.describe('Logs', () => {
// const logsPromise = page.waitForResponse('**/api/v1/logs');
await page.route('**/api/v1/logs', (route) => {
return route.fulfill({ path: './cypress/fixtures/logs.json' });
return route.fulfill({ path: './e2e/testData/logs.json' });
});
const logs = getWaitForResponse(page, '@Logs');

View File

@ -6,11 +6,11 @@ test.describe('Pairlists', () => {
test.beforeEach(async ({ page }) => {
await defaultMocks(page);
page.route('**/api/v1/show_config', (route) => {
return route.fulfill({ path: `./cypress/fixtures/backtest/show_config_webserver.json` });
return route.fulfill({ path: `./e2e/testData/backtest/show_config_webserver.json` });
});
page.route('**/api/v1/pairlists/available*', (route) => {
return route.fulfill({ path: `./cypress/fixtures/pairlists_available.json` });
return route.fulfill({ path: `./e2e/testData/pairlists_available.json` });
});
const jobID = 'c0578b6a-dd34-4bb7-b83c-492f02da2cfd';