Skip to content

Commit

Permalink
Actually execute data loading
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonBein committed Aug 31, 2023
1 parent 14ad8a9 commit 471f14a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/cypress/e2e/application.cy.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import { getScenarioFileName, setFile, updateProject } from "../../src/util/Storage";
import { getScenarioFileName, purgeDatabase, setFile, updateProject } from "../../src/util/Storage";
import defaultScenarioData from '../fixtures/defaultTestScenario.json'

function udescribe(){}; // For debug; quick way to comment out a test

const defaultProjectName = 'testProject';
const defaultScenarioName = defaultScenarioData.scenarioName;


function loadDefaultProjectData() {
const fileName = getScenarioFileName(defaultScenarioName);
return cy.wrap(async () => {
return cy.wrap((async () => {
await setFile(defaultProjectName, fileName, JSON.stringify(defaultScenarioData));
await updateProject(defaultProjectName);
}).then(() => cy.reload()) // Reload to ensure new data is displayed
})()).then(() => cy.reload()) // Reload to ensure new data is displayed
}


// There seems to be an issue with test isolation on the local runner. This should at least isolate suide runs.
before(() => {
purgeDatabase();
});


beforeEach(() => {
cy.visit('http://localhost:3000');
});
Expand Down

0 comments on commit 471f14a

Please sign in to comment.