Better e2e tests (#1959)

* Adding a timeout to wait for old map to be correctly loaded

* Adding an exception for E2E tests to load a local map as if it was remote.
This commit is contained in:
David Négrier
2022-03-11 10:29:42 +01:00
committed by GitHub
parent 0196eae055
commit d3862a3afd
2 changed files with 17 additions and 0 deletions
+8
View File
@@ -142,6 +142,9 @@ test.describe('Variables', () => {
await login(page, 'Alice', 2);
// Wait for page to load before copying file (it seems the await above does not 100% fills its role otherwise).
await timeout(3000);
// Let's REPLACE the map by a map that has a new variable
// At this point, the back server contains a cache of the old map (with no variables)
fs.copyFileSync(
@@ -162,3 +165,8 @@ test.describe('Variables', () => {
await assertLogMessage(page2, 'SUCCESS!');
});
});
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}