From 607e817a05315613f4b337f10419ca19c41c73a2 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Wed, 20 Mar 2024 15:14:12 +0500 Subject: [PATCH 1/3] load more for created and assigned bounties --- cypress/e2e/30_viewUserLoadMore.cy.ts | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 cypress/e2e/30_viewUserLoadMore.cy.ts diff --git a/cypress/e2e/30_viewUserLoadMore.cy.ts b/cypress/e2e/30_viewUserLoadMore.cy.ts new file mode 100644 index 00000000..3983fb1d --- /dev/null +++ b/cypress/e2e/30_viewUserLoadMore.cy.ts @@ -0,0 +1,63 @@ +describe('Load More For Created And Assigned Bounties', () => { + let activeUser = 'carol'; + + const bounty: Cypress.Bounty = { + title: 'Syed Bounty', + category: 'Web development', + description: 'This is available', + amount: '12', + tribe: 'Amazing Org Tribe', + deliverables: 'We are good to go man', + assign: 'alice' + }; + + beforeEach(() => { + cy.login(activeUser); + cy.wait(1000); + }); + + it('Thirty bounties should be created and assigned to a user, and they should be visible on both sides', () => { + for (let i = 1; i <= 30; i++) { + const updatedBounty = { ...bounty, title: `Syed Bounty${i}` }; + cy.create_bounty(updatedBounty); + cy.wait(1000); + } + + cy.visit('http://localhost:3007/p'); + cy.wait(1000); + + cy.get('input').type('alice'); + cy.wait(1000); + + cy.contains('alice').click(); + cy.wait(1000); + + cy.contains('Assigned Bounties').click(); + cy.wait(1000); + + for (let i = 30; i >= 1; i--) { + cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); + if (i === 11) { + cy.contains('Load More').scrollIntoView().click(); + cy.wait(1000); + } + } + + cy.contains(activeUser).click(); + cy.wait(1000); + + cy.get('[data-testid="Bounties-tab"]').click(); + cy.wait(1000); + + for (let i = 30; i >= 1; i--) { + cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); + if (i === 11) { + cy.contains('Load More').scrollIntoView().click(); + cy.wait(1000); + } + } + + cy.get('body').click(0, 0); + cy.logout(activeUser); + }); +}); From f61418659b67febb8f18825da62656fb4ed8e3c7 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Wed, 20 Mar 2024 18:35:07 +0500 Subject: [PATCH 2/3] load more for created and assigned bounties fixed --- cypress/e2e/30_viewUserLoadMore.cy.ts | 29 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/30_viewUserLoadMore.cy.ts b/cypress/e2e/30_viewUserLoadMore.cy.ts index 3983fb1d..36fc3b2b 100644 --- a/cypress/e2e/30_viewUserLoadMore.cy.ts +++ b/cypress/e2e/30_viewUserLoadMore.cy.ts @@ -14,10 +14,11 @@ describe('Load More For Created And Assigned Bounties', () => { beforeEach(() => { cy.login(activeUser); cy.wait(1000); + cy.viewport(1950, 1080); }); it('Thirty bounties should be created and assigned to a user, and they should be visible on both sides', () => { - for (let i = 1; i <= 30; i++) { + for (let i = 1; i <= 22; i++) { const updatedBounty = { ...bounty, title: `Syed Bounty${i}` }; cy.create_bounty(updatedBounty); cy.wait(1000); @@ -35,12 +36,15 @@ describe('Load More For Created And Assigned Bounties', () => { cy.contains('Assigned Bounties').click(); cy.wait(1000); - for (let i = 30; i >= 1; i--) { + for (let i = 22; i >= 3; i--) { + cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); + } + + cy.contains('Load More').scrollIntoView().click(); + cy.wait(1000); + + for (let i = 2; i >= 1; i--) { cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); - if (i === 11) { - cy.contains('Load More').scrollIntoView().click(); - cy.wait(1000); - } } cy.contains(activeUser).click(); @@ -49,12 +53,15 @@ describe('Load More For Created And Assigned Bounties', () => { cy.get('[data-testid="Bounties-tab"]').click(); cy.wait(1000); - for (let i = 30; i >= 1; i--) { + for (let i = 22; i >= 3; i--) { + cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); + } + + cy.contains('Load More').scrollIntoView().click(); + cy.wait(2000); + + for (let i = 2; i >= 1; i--) { cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); - if (i === 11) { - cy.contains('Load More').scrollIntoView().click(); - cy.wait(1000); - } } cy.get('body').click(0, 0); From c3685635e081f66ffa5c9be6af518590e32d6922 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Wed, 20 Mar 2024 18:58:27 +0500 Subject: [PATCH 3/3] reduced bounites and increase view port --- cypress/e2e/30_viewUserLoadMore.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/30_viewUserLoadMore.cy.ts b/cypress/e2e/30_viewUserLoadMore.cy.ts index 36fc3b2b..a995f8c9 100644 --- a/cypress/e2e/30_viewUserLoadMore.cy.ts +++ b/cypress/e2e/30_viewUserLoadMore.cy.ts @@ -58,7 +58,7 @@ describe('Load More For Created And Assigned Bounties', () => { } cy.contains('Load More').scrollIntoView().click(); - cy.wait(2000); + cy.wait(1000); for (let i = 2; i >= 1; i--) { cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist');