From 73448b514ea7307d058173a1931fa46575e80935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Tue, 17 May 2022 04:41:08 -0700 Subject: [PATCH] Fix `checkFilter` method in the acceptance tests (#1092) * Fix `checkFilter` method in the acceptance tests * #run_acceptance_tests * Remove duplicate assertion #run_acceptance_tests --- .../cypress/integration/tests/UiTest.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/acceptanceTests/cypress/integration/tests/UiTest.js b/acceptanceTests/cypress/integration/tests/UiTest.js index 19fb6c4a5..83272b40c 100644 --- a/acceptanceTests/cypress/integration/tests/UiTest.js +++ b/acceptanceTests/cypress/integration/tests/UiTest.js @@ -193,23 +193,19 @@ function checkFilter(filterDetails) { const entriesForDeeperCheck = 5; it(`checking the filter: ${filter}`, function () { + cy.get('.w-tc-editor-text').clear(); + // applying the filter with alt+enter or with the button + cy.get('.w-tc-editor-text').type(`${filter}${applyByCtrlEnter ? '{ctrl+enter}' : ''}`); + cy.get('.w-tc-editor').should('have.attr', 'style').and('include', Cypress.env('greenFilterColor')); + if (!applyByCtrlEnter) + cy.get('[type="submit"]').click(); + waitForFetch(); + pauseStream(); cy.get(`#list [id^=entry]`).last().then(elem => { const element = elem[0]; const entryId = getEntryId(element.id); - // checks the hover on the last entry (the only one in DOM at the beginning) - leftOnHoverCheck(entryId, leftSidePath, filter); - - cy.get('.w-tc-editor-text').clear(); - // applying the filter with alt+enter or with the button - cy.get('.w-tc-editor-text').type(`${filter}${applyByCtrlEnter ? '{ctrl+enter}' : ''}`); - cy.get('.w-tc-editor').should('have.attr', 'style').and('include', Cypress.env('greenFilterColor')); - if (!applyByCtrlEnter) - cy.get('[type="submit"]').click(); - - waitForFetch(); - pauseStream(); // only one entry in DOM after filtering, checking all checks on it leftTextCheck(entryId, leftSidePath, leftSideExpectedText);