diff --git a/cypress/e2e/evolution.cy.js b/cypress/e2e/evolution.cy.js index 95f126a..3b91ff8 100644 --- a/cypress/e2e/evolution.cy.js +++ b/cypress/e2e/evolution.cy.js @@ -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); }); }); } @@ -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})`); + }) + }); }); }