From 4a40fd6dcba83c0ba92eb846557a983daa65cca7 Mon Sep 17 00:00:00 2001 From: elraphty Date: Fri, 7 Jun 2024 09:52:41 +0100 Subject: [PATCH] fixed test failure, after seeing screenshot on workflow --- cypress/e2e/37_bountyFilters.cy.ts | 27 +++++++++++---------------- cypress/support/commands.ts | 6 +++--- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/cypress/e2e/37_bountyFilters.cy.ts b/cypress/e2e/37_bountyFilters.cy.ts index f846e12c..e4892b45 100644 --- a/cypress/e2e/37_bountyFilters.cy.ts +++ b/cypress/e2e/37_bountyFilters.cy.ts @@ -25,14 +25,14 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( estimate_session_length: 'Less than 3 hour', estimate_completion_date: '09/09/2024' }); - cy.wait(1500); + cy.wait(1000); if (i > 2) { if (i === 3) { // Unchecked the Open Filter and Checked the Assigned Filter cy.contains('Filter').click(); - cy.contains('Open').click(); - cy.contains('Assigned').click(); + cy.contains('label', 'Open').click(); + cy.contains('label', 'Assigned').click(); cy.wait(1000); cy.contains(`Filter Bounty Title ${i}`).click(); @@ -48,12 +48,6 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( cy.wait(1000); cy.get('body').click(0, 0); - cy.wait(1000); - - // open filter - cy.contains('Filter').click(); - cy.contains('Assigned').click(); - cy.get('body').click(0, 0); } } } @@ -63,17 +57,18 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( // check open filter cy.contains('Filter').click(); - cy.contains('Open').click(); + cy.contains('label', 'Assigned').click(); + cy.contains('label', 'Open').click(); cy.wait(1000); // close filter cy.get('body').click(0, 0); cy.wait('@bountyFilter'); - for (let i = 0; i < 3; i++) { - // assigned bounties should not exists - cy.contains(`Filter Bounty Title ${i}`).should('not.exist'); - } + // assigned bounties should not exists + cy.contains(`Filter Bounty Title 0`).should('not.exist'); + cy.contains(`Filter Bounty Title 1`).should('not.exist'); + cy.wait(1000); cy.contains('Filter').click(); @@ -89,12 +84,12 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( cy.contains('Filter').click(); // uncheck - cy.contains('Open').click(); + cy.contains('label', 'Open').click(); cy.contains('label', 'Typescript').click(); cy.wait(1000); // check - cy.contains('Assigned').click(); + cy.contains('label', 'Assigned').click(); cy.contains('label', 'Lightning').click(); cy.wait('@bountyFilter'); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 4e2cc2a0..7828d9fb 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -198,7 +198,7 @@ Cypress.Commands.add('create_bounty', (bounty, clickMethod = 'contains') => { cy.get('[data-testid="Category *"]').click(); cy.get('[data-testid="Category *"]').contains(bounty.category).click(); - cy.contains('Next').click({ force: true }); + cy.contains('Next').click(); cy.get('.euiTextArea').type(bounty.description); cy.contains('Next').click(); @@ -226,7 +226,7 @@ Cypress.Commands.add('create_bounty', (bounty, clickMethod = 'contains') => { cy.get('textarea.inputText').type(bounty.deliverables); } - cy.contains('Next').click({ force: true }); + cy.contains('Next').click(); if (bounty.assign) { cy.get('.SearchInput').type(bounty.assign); @@ -236,7 +236,7 @@ Cypress.Commands.add('create_bounty', (bounty, clickMethod = 'contains') => { cy.contains('Decide Later').click({ force: true }); } - cy.contains('Finish').click({ force: true }); + cy.contains('Finish').click(); }); Cypress.Commands.add('create_workspace_bounty', (workspaceBounty) => {