From 49e8b3a553bcd693419c0ccc63bac4bbd6f0c1de Mon Sep 17 00:00:00 2001 From: schiwaa Date: Thu, 11 Jan 2024 21:23:01 +0100 Subject: [PATCH 1/9] assert that click on 'Run' alerts successs 'Job added' --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 37 ++++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index b24e8a3a..549c2e70 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -14,7 +14,7 @@ Tests to add: Click on RHM should reveal argument field 'Iterations' Click on other algorithms should not show any argument fields Click on Cancel or anywhere outside dialog closes dialog - Click on "Run" (not implemented yet, just closes dialog for now) + Click on "Run" shows a success message 'Job added' and closes dialog */ @@ -27,6 +27,8 @@ beforeEach(() => { describe('Stemweb dialog should work properly', () => { it('under construction', () => { + cy.viewport(1600, 900); + // click on button "Run Stemweb" should open Stemweb dialog cy.contains('Run Stemweb').click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); @@ -69,14 +71,6 @@ describe('Stemweb dialog should work properly', () => { cy.get('@stemwebmodal').find('button').contains('Cancel').trigger('mouseover').click(); cy.get('@stemwebmodal').should('not.be.visible'); - // Click on "Run" (not implemented yet, just closes dialog for now) - cy.contains('Run Stemweb').click(); - cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); - cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); - cy.get('@stemwebmodal').find('button').contains('Run').its('length').then((len) => {cy.log('length:' + len)}); - cy.get('@stemwebmodal').find('button').contains('Run').trigger('mouseover').click(); - cy.get('@stemwebmodal').should('not.be.visible'); // fuzzy - // Click on anywhere outside dialog closes dialog cy.contains('Run Stemweb').click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); @@ -84,8 +78,29 @@ describe('Stemweb dialog should work properly', () => { cy.get('@stemwebmodal').closest("#modalDialog").then((elem) => { cy.log("#modalDialog:", elem); }); - cy.get('@stemwebmodal').closest("#modalDialog").its('length').then((len) => {cy.log('length:' + len)}); // seems to help against fuzziness - cy.get('@stemwebmodal').closest("#modalDialog").trigger('mouseover', { 'timeout': 10000 }).click('left'); + cy.get('@stemwebmodal').closest("#modalDialog").as('mdialog'); + // cy.get('@mdialog').its('length').then((len) => {cy.log('length:' + len)}); + cy.get('@mdialog').find('form').trigger('mouseover', { 'timeout': 10000 }).click(); // first click inside, then outside of the modal in order to close it in cypress + cy.get('@mdialog').trigger('mouseover', { 'timeout': 10000 }).click('left'); cy.get('@stemwebmodal').should('not.be.visible'); + + // Click on "Run" shows a success message 'Job added' + // TODO: for any algorithm + // TODO: and closes dialog + cy.contains('Run Stemweb').click(); + cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); + cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); + // cy.get('@stemwebmodal').find('button').contains('Run').its('length').then((len) => {cy.log('length:' + len)}); + cy.get('@stemwebmodal').find('button').contains('Run').trigger('mouseover').click(); + // cy.get('@stemwebmodal').should('not.be.visible'); // still visible in frontend-e2e cypress although not in dev + // shows 'Job added' + cy.get('stemmaweb-alert').contains('Job added'); // .find('.btn-close').click(); + + // cy.get('@stemwebmodal').should('not.be.visible'); // still visible in frontend-e2e cypress although not in dev + // workaround -- evel + /* cy.get('@stemwebmodal').closest("#modalDialog").as('mdialog'); + cy.get('@mdialog').find('form').trigger('mouseover', { 'timeout': 10000 }).click(); // first click inside, then outside of the modal in order to close it in cypress + cy.get('@mdialog').trigger('mouseover', { 'timeout': 10000 }).click('left'); + cy.get('@stemwebmodal').should('not.be.visible'); */ }); }); From d9faa5aa1d97b7e77474618488c32d86fbae125e Mon Sep 17 00:00:00 2001 From: schiwaa Date: Mon, 5 Feb 2024 16:32:30 +0100 Subject: [PATCH 2/9] wait() for the event listener to close the modal to be attached --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index 549c2e70..d553f3e9 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -85,22 +85,13 @@ describe('Stemweb dialog should work properly', () => { cy.get('@stemwebmodal').should('not.be.visible'); // Click on "Run" shows a success message 'Job added' + // and closes dialog // TODO: for any algorithm - // TODO: and closes dialog cy.contains('Run Stemweb').click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); - // cy.get('@stemwebmodal').find('button').contains('Run').its('length').then((len) => {cy.log('length:' + len)}); - cy.get('@stemwebmodal').find('button').contains('Run').trigger('mouseover').click(); - // cy.get('@stemwebmodal').should('not.be.visible'); // still visible in frontend-e2e cypress although not in dev - // shows 'Job added' - cy.get('stemmaweb-alert').contains('Job added'); // .find('.btn-close').click(); - - // cy.get('@stemwebmodal').should('not.be.visible'); // still visible in frontend-e2e cypress although not in dev - // workaround -- evel - /* cy.get('@stemwebmodal').closest("#modalDialog").as('mdialog'); - cy.get('@mdialog').find('form').trigger('mouseover', { 'timeout': 10000 }).click(); // first click inside, then outside of the modal in order to close it in cypress - cy.get('@mdialog').trigger('mouseover', { 'timeout': 10000 }).click('left'); - cy.get('@stemwebmodal').should('not.be.visible'); */ + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).trigger('mouseover').click(); // wait() for the event listener to close the modal to be attached (https://www.cypress.io/blog/2019/01/22/when-can-the-test-click) + cy.get('stemmaweb-alert').contains('Job added'); + cy.get('@stemwebmodal').should('not.be.visible'); }); }); From c875782afdf0a9b00bdb38256e68e12d11157d6e Mon Sep 17 00:00:00 2001 From: schiwaa Date: Mon, 5 Feb 2024 20:00:02 +0100 Subject: [PATCH 3/9] for any algorithm open the modal again to assert 'Job added' and dialog closed --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 35 +++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index d553f3e9..b434d6cb 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -84,14 +84,31 @@ describe('Stemweb dialog should work properly', () => { cy.get('@mdialog').trigger('mouseover', { 'timeout': 10000 }).click('left'); cy.get('@stemwebmodal').should('not.be.visible'); - // Click on "Run" shows a success message 'Job added' - // and closes dialog - // TODO: for any algorithm - cy.contains('Run Stemweb').click(); - cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); - cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); - cy.get('@stemwebmodal').find('button').contains('Run').wait(500).trigger('mouseover').click(); // wait() for the event listener to close the modal to be attached (https://www.cypress.io/blog/2019/01/22/when-can-the-test-click) - cy.get('stemmaweb-alert').contains('Job added'); - cy.get('@stemwebmodal').should('not.be.visible'); + // for any algorithm open the modal again to assert 'Job added' and dialog closed + for(const algorithm of stemweb_algorithms) { + cy.reload(); + cy.log("algorithm.text", algorithm.text) + cy.contains('Run Stemweb').wait(500).click(); + cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); + cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); + + cy.get('@stemwebmodal').find('select>option') + .each(($el, index, $list) => { + const optionText = $el.text().trim(); + cy.log('optionText', optionText) + if (algorithm.text === optionText){ + cy.get('@stemwebmodal').find('select').select(optionText); // click on optionText + if (optionText === 'Pars') { + // TODO: Issue with Pars algorithm, not "Job added" but "Error: INTERNAL SERVER ERROR" + } else { + // Click on "Run" shows a success message 'Job added' + // and closes dialog + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).trigger('mouseover').click(); // wait() for the event listener to close the modal to be attached (https://www.cypress.io/blog/2019/01/22/when-can-the-test-click) + cy.get('stemmaweb-alert').contains('Job added'); + cy.get('@stemwebmodal').should('not.be.visible'); + } + } + }); + } }); }); From d2411a11943f626ca83caea13c7b99f11df692fb Mon Sep 17 00:00:00 2001 From: schiwaa Date: Tue, 6 Feb 2024 13:32:42 +0100 Subject: [PATCH 4/9] tests for feauture #172 --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index b434d6cb..18680b7e 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -26,7 +26,7 @@ beforeEach(() => { }); describe('Stemweb dialog should work properly', () => { - it('under construction', () => { + it('passes', () => { cy.viewport(1600, 900); // click on button "Run Stemweb" should open Stemweb dialog @@ -99,7 +99,7 @@ describe('Stemweb dialog should work properly', () => { if (algorithm.text === optionText){ cy.get('@stemwebmodal').find('select').select(optionText); // click on optionText if (optionText === 'Pars') { - // TODO: Issue with Pars algorithm, not "Job added" but "Error: INTERNAL SERVER ERROR" + // TODO: Issue #187 with Pars algorithm, not "Job added" but "Error: INTERNAL SERVER ERROR" } else { // Click on "Run" shows a success message 'Job added' // and closes dialog From 4ada7b9c3a26db1e4c06afe84dcc909f5f42e02f Mon Sep 17 00:00:00 2001 From: schiwaa Date: Tue, 6 Feb 2024 14:08:24 +0100 Subject: [PATCH 5/9] tidy up --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index 18680b7e..9ae7fefd 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -42,7 +42,7 @@ describe('Stemweb dialog should work properly', () => { const optionText = $el.text().trim(); cy.get('@stemwebmodal').find('select').select(optionText); // click on optionText cy.get('@stemwebmodal').find('select option:selected') // get the selected option - .invoke("text").then((txt) => { + .invoke('text').then((txt) => { const selected = txt.trim(); expect(selected).equal(optionText); // ok, desired option is selected expect(optionText).equal(stemweb_algorithms[index].text); // and it matches the test data @@ -68,34 +68,33 @@ describe('Stemweb dialog should work properly', () => { // Click on Cancel closes dialog cy.get('@stemwebmodal').should('be.visible'); - cy.get('@stemwebmodal').find('button').contains('Cancel').trigger('mouseover').click(); + cy.get('@stemwebmodal').find('button').contains('Cancel').wait(500).click(); cy.get('@stemwebmodal').should('not.be.visible'); // Click on anywhere outside dialog closes dialog cy.contains('Run Stemweb').click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); - cy.get('@stemwebmodal').closest("#modalDialog").then((elem) => { - cy.log("#modalDialog:", elem); + cy.get('@stemwebmodal').closest('#modalDialog').then((elem) => { + cy.log('#modalDialog:' + elem); }); - cy.get('@stemwebmodal').closest("#modalDialog").as('mdialog'); + cy.get('@stemwebmodal').closest('#modalDialog').as('mdialog'); // cy.get('@mdialog').its('length').then((len) => {cy.log('length:' + len)}); - cy.get('@mdialog').find('form').trigger('mouseover', { 'timeout': 10000 }).click(); // first click inside, then outside of the modal in order to close it in cypress - cy.get('@mdialog').trigger('mouseover', { 'timeout': 10000 }).click('left'); + cy.get('@mdialog').wait(500).click('left'); cy.get('@stemwebmodal').should('not.be.visible'); // for any algorithm open the modal again to assert 'Job added' and dialog closed for(const algorithm of stemweb_algorithms) { cy.reload(); - cy.log("algorithm.text", algorithm.text) + cy.log('algorithm.text: ' + algorithm.text) cy.contains('Run Stemweb').wait(500).click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); cy.get('@stemwebmodal').find('select>option') - .each(($el, index, $list) => { + .each(($el) => { const optionText = $el.text().trim(); - cy.log('optionText', optionText) + cy.log('optionText:' + optionText) if (algorithm.text === optionText){ cy.get('@stemwebmodal').find('select').select(optionText); // click on optionText if (optionText === 'Pars') { @@ -103,7 +102,7 @@ describe('Stemweb dialog should work properly', () => { } else { // Click on "Run" shows a success message 'Job added' // and closes dialog - cy.get('@stemwebmodal').find('button').contains('Run').wait(500).trigger('mouseover').click(); // wait() for the event listener to close the modal to be attached (https://www.cypress.io/blog/2019/01/22/when-can-the-test-click) + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).click(); // wait() for the event listener to close the modal to be attached (https://www.cypress.io/blog/2019/01/22/when-can-the-test-click) cy.get('stemmaweb-alert').contains('Job added'); cy.get('@stemwebmodal').should('not.be.visible'); } From 9df395cbe08a4e559de007726e48435e4c8100ce Mon Sep 17 00:00:00 2001 From: schiwaa Date: Thu, 8 Feb 2024 15:09:59 +0100 Subject: [PATCH 6/9] assert job id and status for stemweb runs --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 72 +++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index 9ae7fefd..e097de8a 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -1,13 +1,13 @@ /* gui element to run stemweb https://github.com/tla/stemmaweb/pull/172#issue-1680053781 +1) refactor: small tweaks to button colors refactor: replace space in ids for inputs in dropdowns with '-' (todo issued as #171) feature: alphabetic compare function in utils.js refactor: changed adding of eventlisteners in stemmaButtons.js Tests to add: - click on button "Run Stemweb" should open Stemweb dialog Dropdown should show names of Stemweb algorithms (currently: RHM, Neighbour joining, and Neighbour net) Click info badge ('i') should show description of algorithm @@ -16,19 +16,34 @@ Tests to add: Click on Cancel or anywhere outside dialog closes dialog Click on "Run" shows a success message 'Job added' and closes dialog +2) +Run a StemWeb algorithm and fetch results (backend) #103 +https://github.com/tla/stemmaweb/pull/185#issue-2050160053 +Cypress tests that could be added: + Florilegium shows a status of: + Job: 2 + Status: Running + Arabic snippet shows a status of: + Job: 3 + Status: Error + Result: Pretend we had an error here. + Notre Besoin traditions shows a status of: + Job: 1 + Status: Done + */ +import test_traditions from '../fixtures/test_traditions.json'; import stemweb_algorithms from '../fixtures/stemweb_algorithms.json' const len_stemweb_algorithms = stemweb_algorithms.length; beforeEach(() => { cy.visit(`${Cypress.env('CY_STEMMAWEB_FRONTEND_URL')}/`); + cy.viewport(1600, 900); }); describe('Stemweb dialog should work properly', () => { it('passes', () => { - cy.viewport(1600, 900); - // click on button "Run Stemweb" should open Stemweb dialog cy.contains('Run Stemweb').click(); cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); @@ -111,3 +126,54 @@ describe('Stemweb dialog should work properly', () => { } }); }); + +describe('Runs a StemWeb algorithm and fetches results (backend)', () => { + // https://github.com/tla/stemmaweb/issues/103 + // https://github.com/tla/stemmaweb/pull/185 + + it('under construction', () => { + test_traditions.forEach((tradition) => { + const traditionTitle = tradition.title; + cy.log('traditionTitle: ' + traditionTitle); + + // get the toc entry for the tradition which starts with Florilegium and click on it, + // the same for Arabic snippet and for Notre besoin. + if (traditionTitle.startsWith("Florilegium")) { + cy.get('#traditions-list').contains(traditionTitle).click(); + cy.contains('Run Stemweb').click(); + cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); + cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).click(); + cy.get('stemmaweb-alert').contains('Job added'); + cy.get('@stemwebmodal').should('not.be.visible'); + // Florilegium shows a status of: Job: 2. Status: Running + // data to be asserted within the stemweb-job-status element + cy.get('stemweb-job-status').contains('#job_status', '2').and('contain.text', 'Running'); + } else if (traditionTitle.startsWith("Arabic snippet")) { + cy.get('#traditions-list').contains(traditionTitle).click(); + cy.contains('Run Stemweb').click(); + cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); + cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).click(); + cy.get('stemmaweb-alert').contains('Job added'); + cy.get('@stemwebmodal').should('not.be.visible'); + // Arabic snippet shows a status of: Job: 3. Status: Error. Result: Pretend we had an error here. + cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error'); + } else if (traditionTitle.startsWith("Notre besoin")) { + cy.get('#traditions-list').contains(traditionTitle).click(); + cy.contains('Run Stemweb').click(); + cy.get('stemmaweb-dialog .modal-content').as('stemwebmodal'); + cy.get('@stemwebmodal').contains('Generate a Stemweb tree').should('be.visible'); + cy.get('@stemwebmodal').find('button').contains('Run').wait(500).click(); + cy.get('stemmaweb-alert').contains('Job added'); + cy.get('@stemwebmodal').should('not.be.visible'); + // Notre Besoin tradition shows a status of: Job: 1. Status: Done + cy.get('stemweb-job-status').contains('#job_status', '1').and('contain.text', 'Done'); + // traditions for which Stemweb has not been run should not display the stemweb-job-status + } else { + cy.get('#traditions-list').contains(traditionTitle).click(); + cy.get('stemweb-job-status').should('not.be.visible'); + } + }); + }); +}); From 0ddf66a736754936331365fc390a1dd33dd52e23 Mon Sep 17 00:00:00 2001 From: schiwaa Date: Thu, 8 Feb 2024 15:19:10 +0100 Subject: [PATCH 7/9] assert stemweb-job-status is still displayed upon return from other traditions --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index e097de8a..f04569ec 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -135,7 +135,7 @@ describe('Runs a StemWeb algorithm and fetches results (backend)', () => { test_traditions.forEach((tradition) => { const traditionTitle = tradition.title; cy.log('traditionTitle: ' + traditionTitle); - + // get the toc entry for the tradition which starts with Florilegium and click on it, // the same for Arabic snippet and for Notre besoin. if (traditionTitle.startsWith("Florilegium")) { @@ -174,6 +174,27 @@ describe('Runs a StemWeb algorithm and fetches results (backend)', () => { cy.get('#traditions-list').contains(traditionTitle).click(); cy.get('stemweb-job-status').should('not.be.visible'); } + + // stemweb-job-status should still be there after coming back from clicking on other traditions + test_traditions.reverse().forEach((tradition) => { + const traditionTitle = tradition.title; + cy.log('traditionTitle: ' + traditionTitle); + cy.get('#traditions-list').contains(traditionTitle).click(); + if (traditionTitle.startsWith("Florilegium")) { + // Notre Besoin tradition shows a status of: Job: 1. Status: Done + cy.get('stemweb-job-status').contains('#job_status', '2').and('contain.text', 'Running'); + } else if (traditionTitle.startsWith("Arabic snippet")) { + // Arabic snippet shows a status of: Job: 3. Status: Error. Result: Pretend we had an error here. + cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error'); + } else if (traditionTitle.startsWith("Notre besoin")) { + // Notre Besoin tradition shows a status of: Job: 1. Status: Done + cy.get('stemweb-job-status').contains('#job_status', '1').and('contain.text', 'Done'); + } else { + // traditions for which Stemweb has not been run should not display the stemweb-job-status + cy.get('#traditions-list').contains(traditionTitle).click(); + cy.get('stemweb-job-status').should('not.be.visible'); + } + }); }); }); }); From 877d132f503528a4dcede02786a82ac1038335b2 Mon Sep 17 00:00:00 2001 From: schiwaa Date: Thu, 8 Feb 2024 15:28:27 +0100 Subject: [PATCH 8/9] assert Arabic snippet Result string --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index f04569ec..5b8b287a 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -158,7 +158,7 @@ describe('Runs a StemWeb algorithm and fetches results (backend)', () => { cy.get('stemmaweb-alert').contains('Job added'); cy.get('@stemwebmodal').should('not.be.visible'); // Arabic snippet shows a status of: Job: 3. Status: Error. Result: Pretend we had an error here. - cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error'); + cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error').and('contain.text', 'Pretend we had an error here.'); } else if (traditionTitle.startsWith("Notre besoin")) { cy.get('#traditions-list').contains(traditionTitle).click(); cy.contains('Run Stemweb').click(); @@ -185,7 +185,7 @@ describe('Runs a StemWeb algorithm and fetches results (backend)', () => { cy.get('stemweb-job-status').contains('#job_status', '2').and('contain.text', 'Running'); } else if (traditionTitle.startsWith("Arabic snippet")) { // Arabic snippet shows a status of: Job: 3. Status: Error. Result: Pretend we had an error here. - cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error'); + cy.get('stemweb-job-status').contains('#job_status', '3').and('contain.text', 'Error').and('contain.text', 'Pretend we had an error here.'); } else if (traditionTitle.startsWith("Notre besoin")) { // Notre Besoin tradition shows a status of: Job: 1. Status: Done cy.get('stemweb-job-status').contains('#job_status', '1').and('contain.text', 'Done'); From a109bc535ff386abedf1e0fefd16499c650ce290 Mon Sep 17 00:00:00 2001 From: schiwaa Date: Thu, 8 Feb 2024 15:47:48 +0100 Subject: [PATCH 9/9] asserted: job added, modal closes, job id and status are displayed --- frontend-e2e/cypress/e2e/stemwebdialog.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js index 5b8b287a..e759ddcb 100644 --- a/frontend-e2e/cypress/e2e/stemwebdialog.cy.js +++ b/frontend-e2e/cypress/e2e/stemwebdialog.cy.js @@ -131,7 +131,7 @@ describe('Runs a StemWeb algorithm and fetches results (backend)', () => { // https://github.com/tla/stemmaweb/issues/103 // https://github.com/tla/stemmaweb/pull/185 - it('under construction', () => { + it('passes', () => { test_traditions.forEach((tradition) => { const traditionTitle = tradition.title; cy.log('traditionTitle: ' + traditionTitle);