mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-21 23:53:52 +00:00
update Playwright tests for new testdata location
This commit is contained in:
parent
58f1d570de
commit
b6be4edba1
|
@ -5,20 +5,20 @@ test.describe('Backtesting', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await defaultMocks(page);
|
await defaultMocks(page);
|
||||||
page.route('**/api/v1/show_config', (route) => {
|
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) => {
|
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) => {
|
await page.route('**/api/v1/backtest', (route) => {
|
||||||
if (route.request().method() === 'POST') {
|
if (route.request().method() === 'POST') {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
path: './cypress/fixtures/backtest/backtest_post_start.json',
|
path: './e2e/testData/backtest/backtest_post_start.json',
|
||||||
});
|
});
|
||||||
} else if (route.request().method() === 'GET') {
|
} else if (route.request().method() === 'GET') {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
path: './cypress/fixtures/backtest/backtest_get_end.json',
|
path: './e2e/testData/backtest/backtest_get_end.json',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -29,7 +29,7 @@ interface mockArray {
|
||||||
function mockRequests(page, mocks: mockArray[]) {
|
function mockRequests(page, mocks: mockArray[]) {
|
||||||
mocks.forEach((item) => {
|
mocks.forEach((item) => {
|
||||||
page.route(item.url, (route) => {
|
page.route(item.url, (route) => {
|
||||||
return route.fulfill({ path: `./cypress/fixtures/${item.fixture}` });
|
return route.fulfill({ path: `./e2e/testData/${item.fixture}` });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ test.describe('Logs', () => {
|
||||||
|
|
||||||
// const logsPromise = page.waitForResponse('**/api/v1/logs');
|
// const logsPromise = page.waitForResponse('**/api/v1/logs');
|
||||||
await page.route('**/api/v1/logs', (route) => {
|
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');
|
const logs = getWaitForResponse(page, '@Logs');
|
||||||
|
|
|
@ -6,11 +6,11 @@ test.describe('Pairlists', () => {
|
||||||
test.beforeEach(async ({ page }) => {
|
test.beforeEach(async ({ page }) => {
|
||||||
await defaultMocks(page);
|
await defaultMocks(page);
|
||||||
page.route('**/api/v1/show_config', (route) => {
|
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) => {
|
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';
|
const jobID = 'c0578b6a-dd34-4bb7-b83c-492f02da2cfd';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user