Skip to content

Commit

Permalink
test: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomrebelo committed Jul 24, 2023
1 parent fe19ceb commit 5f4e04f
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions cypress/e2e/evolution.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ for (let i in TESTING_EXAMPLES) {
cy.visit(`http://localhost:8000`);
});

it(`a new poster for the text ${e.text} (no elite)`, () => {
evolve(e.text, 0);
it(`a new poster for the text ${e.text} (elite = 1)`, () => {
evolve(e.text, 1);
});

it(`a new poster for the text ${e.text} (elite=1)`, () => {
evolve(e.text, 1);
it(`a new poster for the text ${e.text} (no elite)`, () => {
evolve(e.text, 0);
});
});
}
Expand All @@ -31,19 +31,15 @@ const evolve = (text, elite = 0) => {
cy.get('button.btn.btn-primary.mb-2').click();
cy.get('#bt-start-evo').click();
cy.get('#evolve-bt').click();
if (elite > 0) {
cy.get('#elite-size-input').invoke('val', elite).trigger('change');
}
cy.get('#start-bt').click();
cy.get('.navbar-toggler-icon').click();

cy.window().then((w) => {
// evolving
// expect(w.app.population.evolving, { timeout: 600000 }).to.equal(false);
cy.wrap(isEvolving(w.app.population), { timeout: 600000 }).then((res) => {
console.log (`evolution is complete (no. generations=${res.nGen})`);
})

cy.get('#elite-size-input').invoke('val', elite).trigger('change').then(() => {
cy.get('#start-bt').click();
cy.get('.navbar-toggler-icon').click();
cy.window().then((w) => {
// evolving
cy.wrap(isEvolving(w.app.population), { timeout: 600000 }).then((res) => {
console.log (`evolution is complete (no. generations=${res.nGen})`);
})
});
});
}

Expand Down

0 comments on commit 5f4e04f

Please sign in to comment.