From f30f28272dda04c68b611fe6c862910422899ed8 Mon Sep 17 00:00:00 2001 From: Paul Pestov Date: Tue, 19 Sep 2023 13:50:58 +0200 Subject: [PATCH] fix: update e2e test --- tests/cypress/e2e/annotation.cy.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/cypress/e2e/annotation.cy.js b/tests/cypress/e2e/annotation.cy.js index bc3b83ef..9a6cd371 100644 --- a/tests/cypress/e2e/annotation.cy.js +++ b/tests/cypress/e2e/annotation.cy.js @@ -11,6 +11,7 @@ describe('Annotation - Multiple Tabs', () => { .get('.panels-target > .item:nth-child(4) .q-tab-panel .q-list .q-item') .should('be.visible'); }); + it('Should display first annotation tab', () => { cy .get('.panels-target > .item:nth-child(4) .q-tabs__content .q-tab') @@ -157,11 +158,17 @@ describe('Annotation - Multiple Tabs', () => { .should('have.length', 0); }); - it('Should scroll in text to highlighted annotation', () => { + it('Should scroll in text to highlighted annotation', { scrollBehavior: false }, () => { + + // We scroll down the text panel first and select the first annotation + // because there is a problem with initial scrolling of text panel. + // Somehow it works when scroll programmatically like described above. cy + .get('.panels-target > .item:nth-child(3) .content-view') + .scrollTo('bottom') .get('.panels-target > .item:nth-child(4)') .find('.q-tab-panel .q-list .q-item') - .last() + .first() .click() .get('#t_Mingana_ar_christ_93_84_MD1816225N1l5l3l5l5l47l3l2_1') .should('be.visible');