From d9ad8d050b1fe10efc33ef14910fe37311ceb679 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 15 Nov 2024 11:20:19 +0500 Subject: [PATCH 1/7] make workspace non optional --- src/components/form/bounty/index.tsx | 2 ++ src/people/utils/BountyCreationConstant.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/form/bounty/index.tsx b/src/components/form/bounty/index.tsx index b6f67fe5..8f776e77 100644 --- a/src/components/form/bounty/index.tsx +++ b/src/components/form/bounty/index.tsx @@ -502,6 +502,8 @@ function Form(props: FormProps) { label={ item.name === 'description' && !values.ticket_url ? 'Description *' + : item.name === 'org_uuid' && !values.ticket_url + ? 'Workspace *' : item.label } placeholder={ diff --git a/src/people/utils/BountyCreationConstant.ts b/src/people/utils/BountyCreationConstant.ts index 90edc9e3..20d2d511 100644 --- a/src/people/utils/BountyCreationConstant.ts +++ b/src/people/utils/BountyCreationConstant.ts @@ -22,7 +22,7 @@ export const BountyDetailsCreationData = { sub_heading: ' ', schema: ['org_uuid', 'one_sentence_summary', 'ticket_url'], schema2: ['wanted_type', 'coding_languages'], - required: ['one_sentence_summary', 'wanted_type'], + required: ['org_uuid', 'one_sentence_summary', 'wanted_type'], outerContainerStyle: { minWidth: '712px', maxWidth: '712px', From 6517a9e7a437bd00440f39e71b0ed1d0551ff7e6 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 15 Nov 2024 20:14:26 +0500 Subject: [PATCH 2/7] corrected cypress tests --- cypress/e2e/0_createBounty.cy.ts | 1 + cypress/e2e/11_markAsPaid.cy.ts | 1 + cypress/e2e/12_markAsUnpaid.cy.ts | 1 + cypress/e2e/15_profileCreateBounties.cy.ts | 1 + cypress/e2e/1_create20Bounties.cy.ts | 1 + cypress/e2e/28_viewAssignedBounties.cy.ts | 1 + cypress/e2e/30_viewUserLoadMore.cy.ts | 1 + cypress/e2e/32_bountyModalNavigation.cy.ts | 1 + cypress/e2e/34_signoutPostBounty.cy.ts | 1 + cypress/e2e/36_icanhelpFLow.cy.ts | 1 + cypress/e2e/37_bountyFilters.cy.ts | 1 + cypress/e2e/45_adminBountyList.cy.ts | 1 + cypress/e2e/46_adminFIlterStatus.cy.ts | 1 + cypress/e2e/47_adminFIlterSortBy.cy.ts | 1 + cypress/e2e/48_adminBountyClick.cy.ts | 1 + cypress/e2e/49_adminPaginationNumber.cy.ts | 1 + cypress/e2e/50_adminCustomDateSelect.cy.ts | 1 + cypress/e2e/52_adminCustomDateInput.cy.ts | 1 + cypress/e2e/5_deleteBountyFromModal.cy.ts | 1 + cypress/e2e/61_AssignBountiesStatus.cy.ts | 1 + cypress/e2e/6_editBountyFromModal.cy.ts | 1 + cypress/e2e/7_openBountyModal.cy.ts | 1 + cypress/e2e/8_assignHunter.cy.ts | 1 + cypress/e2e/9_unassignHunter.cy.ts | 1 + src/components/form/bounty/index.tsx | 96 ++++++++++--------- .../postBounty/__tests__/PostModal.spec.tsx | 2 +- 26 files changed, 76 insertions(+), 46 deletions(-) diff --git a/cypress/e2e/0_createBounty.cy.ts b/cypress/e2e/0_createBounty.cy.ts index 4bab0b0a..6533e7f9 100644 --- a/cypress/e2e/0_createBounty.cy.ts +++ b/cypress/e2e/0_createBounty.cy.ts @@ -6,6 +6,7 @@ describe('Alice tries to create a bounty', () => { cy.create_bounty({ title: 'My new Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/11_markAsPaid.cy.ts b/cypress/e2e/11_markAsPaid.cy.ts index d1fa3aa8..d8647014 100644 --- a/cypress/e2e/11_markAsPaid.cy.ts +++ b/cypress/e2e/11_markAsPaid.cy.ts @@ -3,6 +3,7 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty for unapaid user', + workspace:'workspace3', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is a description', diff --git a/cypress/e2e/12_markAsUnpaid.cy.ts b/cypress/e2e/12_markAsUnpaid.cy.ts index e9cacbb7..7099ac15 100644 --- a/cypress/e2e/12_markAsUnpaid.cy.ts +++ b/cypress/e2e/12_markAsUnpaid.cy.ts @@ -3,6 +3,7 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () = const bounty: Cypress.Bounty = { title: 'My new Bounty for unapaid user', + workspace:'workspace3', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/15_profileCreateBounties.cy.ts b/cypress/e2e/15_profileCreateBounties.cy.ts index 48aa796b..9df8ae25 100644 --- a/cypress/e2e/15_profileCreateBounties.cy.ts +++ b/cypress/e2e/15_profileCreateBounties.cy.ts @@ -11,6 +11,7 @@ describe('Alice tries to create a bounty on the user profile page and view them' cy.create_bounty( { title: `Bounty Title ${i}`, + workspace:'workspace4', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', diff --git a/cypress/e2e/1_create20Bounties.cy.ts b/cypress/e2e/1_create20Bounties.cy.ts index 83b548eb..d19f5c8e 100644 --- a/cypress/e2e/1_create20Bounties.cy.ts +++ b/cypress/e2e/1_create20Bounties.cy.ts @@ -7,6 +7,7 @@ describe('Alice tries to create 20 bounties', () => { for (let i = 1; i <= 20; i++) { cy.create_bounty({ title: `Title ${i}`, + workspace:'workspace2', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', diff --git a/cypress/e2e/28_viewAssignedBounties.cy.ts b/cypress/e2e/28_viewAssignedBounties.cy.ts index 48d4b4e4..c5b146e2 100644 --- a/cypress/e2e/28_viewAssignedBounties.cy.ts +++ b/cypress/e2e/28_viewAssignedBounties.cy.ts @@ -3,6 +3,7 @@ describe('View User Assigned Bounties', () => { const bounty: Cypress.Bounty = { title: 'Syed Bounty', + workspace:'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/30_viewUserLoadMore.cy.ts b/cypress/e2e/30_viewUserLoadMore.cy.ts index 3f059761..d6cd414d 100644 --- a/cypress/e2e/30_viewUserLoadMore.cy.ts +++ b/cypress/e2e/30_viewUserLoadMore.cy.ts @@ -3,6 +3,7 @@ describe('Load More For Created And Assigned Bounties', () => { const bounty: Cypress.Bounty = { title: 'Syed Bounty', + workspace:'workspace5', category: 'Web development', description: 'This is available', amount: '12', diff --git a/cypress/e2e/32_bountyModalNavigation.cy.ts b/cypress/e2e/32_bountyModalNavigation.cy.ts index 240e0b81..b2c270a6 100644 --- a/cypress/e2e/32_bountyModalNavigation.cy.ts +++ b/cypress/e2e/32_bountyModalNavigation.cy.ts @@ -9,6 +9,7 @@ describe('Alice tries to create 8 bounties and then assert that he can go to the for (let i = 0; i < 8; i++) { cy.create_bounty({ title: `Navigation Bounty Title ${i}`, + workspace:'workspace5', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', diff --git a/cypress/e2e/34_signoutPostBounty.cy.ts b/cypress/e2e/34_signoutPostBounty.cy.ts index 772d6fc4..2977edf3 100644 --- a/cypress/e2e/34_signoutPostBounty.cy.ts +++ b/cypress/e2e/34_signoutPostBounty.cy.ts @@ -3,6 +3,7 @@ describe('Signed Out Post Bounty Flow ', () => { const bounty: Cypress.Bounty = { title: 'Syed Bounty', + workspace:'workspace5', category: 'Web development', description: 'This is available', amount: '12', diff --git a/cypress/e2e/36_icanhelpFLow.cy.ts b/cypress/e2e/36_icanhelpFLow.cy.ts index b9396a00..aa21fb7b 100644 --- a/cypress/e2e/36_icanhelpFLow.cy.ts +++ b/cypress/e2e/36_icanhelpFLow.cy.ts @@ -4,6 +4,7 @@ describe('I Can Help Flow', () => { const bounty: Cypress.Bounty = { title: 'UmerBounty', + workspace: 'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/37_bountyFilters.cy.ts b/cypress/e2e/37_bountyFilters.cy.ts index e4892b45..2b82c90b 100644 --- a/cypress/e2e/37_bountyFilters.cy.ts +++ b/cypress/e2e/37_bountyFilters.cy.ts @@ -15,6 +15,7 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( for (let i = 0; i < 6; i++) { cy.create_bounty({ title: `Filter Bounty Title ${i}`, + workspace: 'workspace6', category: 'Web development', coding_language: [languages[i]], description: 'Lorem Ipsum Dolor', diff --git a/cypress/e2e/45_adminBountyList.cy.ts b/cypress/e2e/45_adminBountyList.cy.ts index 7883114b..a31d6010 100644 --- a/cypress/e2e/45_adminBountyList.cy.ts +++ b/cypress/e2e/45_adminBountyList.cy.ts @@ -3,6 +3,7 @@ describe('Super Admin Bounties List', () => { const bounty: Cypress.Bounty = { title: 'AliRazaTask', + workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/46_adminFIlterStatus.cy.ts b/cypress/e2e/46_adminFIlterStatus.cy.ts index eed12077..436f56af 100644 --- a/cypress/e2e/46_adminFIlterStatus.cy.ts +++ b/cypress/e2e/46_adminFIlterStatus.cy.ts @@ -3,6 +3,7 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { const bounty: Cypress.Bounty = { title: 'Syed', + workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', diff --git a/cypress/e2e/47_adminFIlterSortBy.cy.ts b/cypress/e2e/47_adminFIlterSortBy.cy.ts index f57e12ef..6018ebcb 100644 --- a/cypress/e2e/47_adminFIlterSortBy.cy.ts +++ b/cypress/e2e/47_adminFIlterSortBy.cy.ts @@ -3,6 +3,7 @@ describe('Super Admin Bounty Filter SortBy', () => { const bounty: Cypress.Bounty = { title: 'MirzaRef', + workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', diff --git a/cypress/e2e/48_adminBountyClick.cy.ts b/cypress/e2e/48_adminBountyClick.cy.ts index 3f2f26cc..7c399c78 100644 --- a/cypress/e2e/48_adminBountyClick.cy.ts +++ b/cypress/e2e/48_adminBountyClick.cy.ts @@ -3,6 +3,7 @@ describe('Super Admin Bounty Creation and Verification', () => { const bounty: Cypress.Bounty = { title: 'saithsab', + workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/49_adminPaginationNumber.cy.ts b/cypress/e2e/49_adminPaginationNumber.cy.ts index f20521f4..67feed3d 100644 --- a/cypress/e2e/49_adminPaginationNumber.cy.ts +++ b/cypress/e2e/49_adminPaginationNumber.cy.ts @@ -3,6 +3,7 @@ describe('Super Admin Pagination Bounties List', () => { const bounty: Cypress.Bounty = { title: 'Pagination Bounty', + workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/50_adminCustomDateSelect.cy.ts b/cypress/e2e/50_adminCustomDateSelect.cy.ts index 3d4a7b31..6308a267 100644 --- a/cypress/e2e/50_adminCustomDateSelect.cy.ts +++ b/cypress/e2e/50_adminCustomDateSelect.cy.ts @@ -3,6 +3,7 @@ describe('Admin Statistics Custom Date Range', () => { const bounty: Cypress.Bounty = { title: 'UmerJobs', + workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/52_adminCustomDateInput.cy.ts b/cypress/e2e/52_adminCustomDateInput.cy.ts index 66b8ad3f..e8d7f78a 100644 --- a/cypress/e2e/52_adminCustomDateInput.cy.ts +++ b/cypress/e2e/52_adminCustomDateInput.cy.ts @@ -3,6 +3,7 @@ describe('Admin Custom Date Input', () => { const bounty: Cypress.Bounty = { title: 'Admin', + workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', diff --git a/cypress/e2e/5_deleteBountyFromModal.cy.ts b/cypress/e2e/5_deleteBountyFromModal.cy.ts index 281df4cc..1839f5c8 100644 --- a/cypress/e2e/5_deleteBountyFromModal.cy.ts +++ b/cypress/e2e/5_deleteBountyFromModal.cy.ts @@ -1,6 +1,7 @@ describe('Can Delete Bounty From Modal', () => { const bounty: Cypress.Bounty = { title: 'Ali Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/61_AssignBountiesStatus.cy.ts b/cypress/e2e/61_AssignBountiesStatus.cy.ts index b4750ce9..7abda959 100644 --- a/cypress/e2e/61_AssignBountiesStatus.cy.ts +++ b/cypress/e2e/61_AssignBountiesStatus.cy.ts @@ -2,6 +2,7 @@ describe('Verify Bounty Status Consistency', () => { const assignee = 'carol'; const bounty: Cypress.Bounty = { title: 'Ali Bounty', + workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/6_editBountyFromModal.cy.ts b/cypress/e2e/6_editBountyFromModal.cy.ts index 8d52495c..6d2eefaf 100644 --- a/cypress/e2e/6_editBountyFromModal.cy.ts +++ b/cypress/e2e/6_editBountyFromModal.cy.ts @@ -2,6 +2,7 @@ describe('Edit Bounty From Modal', () => { const assignee = 'carol'; const bounty: Cypress.Bounty = { title: 'My new Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/7_openBountyModal.cy.ts b/cypress/e2e/7_openBountyModal.cy.ts index 87a69238..11e80d08 100644 --- a/cypress/e2e/7_openBountyModal.cy.ts +++ b/cypress/e2e/7_openBountyModal.cy.ts @@ -1,6 +1,7 @@ describe('View Bounty From Modal', () => { const bounty: Cypress.Bounty = { title: 'Ali Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/8_assignHunter.cy.ts b/cypress/e2e/8_assignHunter.cy.ts index af55c7af..8e3061e1 100644 --- a/cypress/e2e/8_assignHunter.cy.ts +++ b/cypress/e2e/8_assignHunter.cy.ts @@ -1,6 +1,7 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/cypress/e2e/9_unassignHunter.cy.ts b/cypress/e2e/9_unassignHunter.cy.ts index b7b38852..69f8170a 100644 --- a/cypress/e2e/9_unassignHunter.cy.ts +++ b/cypress/e2e/9_unassignHunter.cy.ts @@ -3,6 +3,7 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty', + workspace:'workspace1', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', diff --git a/src/components/form/bounty/index.tsx b/src/components/form/bounty/index.tsx index 8f776e77..4fa52127 100644 --- a/src/components/form/bounty/index.tsx +++ b/src/components/form/bounty/index.tsx @@ -223,51 +223,57 @@ function Form(props: FormProps) {
{schema .filter((item: any) => schemaData.schema.includes(item.name)) - .map((item: FormField) => ( - { - if (errors[item.name]) delete errors[item.name]; - }} - handleChange={(e: any) => { - setFieldValue(item.name, e); - }} - setFieldValue={(e: any, f: any) => { - setFieldValue(e, f); - }} - setFieldTouched={setFieldTouched} - handleBlur={() => { - setFieldTouched(item.name, false); - setIsFocused({ [item.label]: false }); - }} - handleFocus={() => { - setFieldTouched(item.name, true); - setIsFocused({ [item.label]: true }); - }} - setDisableFormButtons={setDisableFormButtons} - extraHTML={(props.extraHTML && props.extraHTML[item.name]) || item.extraHTML} - style={ - item.name === 'github_description' && !values.ticket_url - ? { - display: 'none' - } - : undefined - } - /> - ))} + .map((item: FormField) => { + if (item.name === 'org_uuid') { + item.label = 'Workspace *'; + } + + return ( + { + if (errors[item.name]) delete errors[item.name]; + }} + handleChange={(e: any) => { + setFieldValue(item.name, e); + }} + setFieldValue={(e: any, f: any) => { + setFieldValue(e, f); + }} + setFieldTouched={setFieldTouched} + handleBlur={() => { + setFieldTouched(item.name, false); + setIsFocused({ [item.label]: false }); + }} + handleFocus={() => { + setFieldTouched(item.name, true); + setIsFocused({ [item.label]: true }); + }} + setDisableFormButtons={setDisableFormButtons} + extraHTML={(props.extraHTML && props.extraHTML[item.name]) || item.extraHTML} + style={ + item.name === 'github_description' && !values.ticket_url + ? { + display: 'none' + } + : undefined + } + /> + ); + })}
{schemaData.step !== 5 && (
diff --git a/src/people/widgetViews/postBounty/__tests__/PostModal.spec.tsx b/src/people/widgetViews/postBounty/__tests__/PostModal.spec.tsx index b529bf23..3d76d578 100644 --- a/src/people/widgetViews/postBounty/__tests__/PostModal.spec.tsx +++ b/src/people/widgetViews/postBounty/__tests__/PostModal.spec.tsx @@ -51,7 +51,7 @@ describe('Post bounty modal', () => { const startButton = screen.getByText('Start'); fireEvent.click(startButton); expect(screen.getByText('Basic info')).toBeInTheDocument(); - const Form1 = screen.getByText('Workspace (optional)'); + const Form1 = screen.getByText('Workspace *'); const Form2 = screen.getByText('Bounty Title *'); const Form3 = screen.getByText('Github Issue URL'); const Form4 = screen.getByText('Category *'); From c7b46148059f829b90cca955d77e8959450d8992 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 15 Nov 2024 20:31:56 +0500 Subject: [PATCH 3/7] cypress tests corrected --- cypress/e2e/0_createBounty.cy.ts | 10 ++++++++++ cypress/e2e/11_markAsPaid.cy.ts | 12 +++++++++++- cypress/e2e/12_markAsUnpaid.cy.ts | 12 +++++++++++- cypress/e2e/1_create20Bounties.cy.ts | 10 ++++++++++ cypress/e2e/5_deleteBountyFromModal.cy.ts | 12 +++++++++++- cypress/e2e/6_editBountyFromModal.cy.ts | 12 +++++++++++- cypress/e2e/7_openBountyModal.cy.ts | 12 +++++++++++- cypress/e2e/8_assignHunter.cy.ts | 12 +++++++++++- cypress/e2e/9_unassignHunter.cy.ts | 12 +++++++++++- 9 files changed, 97 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/0_createBounty.cy.ts b/cypress/e2e/0_createBounty.cy.ts index 6533e7f9..b909739a 100644 --- a/cypress/e2e/0_createBounty.cy.ts +++ b/cypress/e2e/0_createBounty.cy.ts @@ -4,6 +4,16 @@ describe('Alice tries to create a bounty', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace1', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty({ title: 'My new Bounty', workspace:'workspace1', diff --git a/cypress/e2e/11_markAsPaid.cy.ts b/cypress/e2e/11_markAsPaid.cy.ts index d8647014..0fa4afcf 100644 --- a/cypress/e2e/11_markAsPaid.cy.ts +++ b/cypress/e2e/11_markAsPaid.cy.ts @@ -3,7 +3,7 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty for unapaid user', - workspace:'workspace3', + workspace:'workspace8', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is a description', @@ -20,6 +20,16 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace8', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/12_markAsUnpaid.cy.ts b/cypress/e2e/12_markAsUnpaid.cy.ts index 7099ac15..1f25c013 100644 --- a/cypress/e2e/12_markAsUnpaid.cy.ts +++ b/cypress/e2e/12_markAsUnpaid.cy.ts @@ -3,7 +3,7 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () = const bounty: Cypress.Bounty = { title: 'My new Bounty for unapaid user', - workspace:'workspace3', + workspace:'workspace9', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -20,6 +20,16 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () = cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace9', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/1_create20Bounties.cy.ts b/cypress/e2e/1_create20Bounties.cy.ts index d19f5c8e..1a36c04e 100644 --- a/cypress/e2e/1_create20Bounties.cy.ts +++ b/cypress/e2e/1_create20Bounties.cy.ts @@ -4,6 +4,16 @@ describe('Alice tries to create 20 bounties', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace2', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + for (let i = 1; i <= 20; i++) { cy.create_bounty({ title: `Title ${i}`, diff --git a/cypress/e2e/5_deleteBountyFromModal.cy.ts b/cypress/e2e/5_deleteBountyFromModal.cy.ts index 1839f5c8..ff2d88e5 100644 --- a/cypress/e2e/5_deleteBountyFromModal.cy.ts +++ b/cypress/e2e/5_deleteBountyFromModal.cy.ts @@ -1,7 +1,7 @@ describe('Can Delete Bounty From Modal', () => { const bounty: Cypress.Bounty = { title: 'Ali Bounty', - workspace:'workspace1', + workspace:'workspace3', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -17,6 +17,16 @@ describe('Can Delete Bounty From Modal', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace3', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/6_editBountyFromModal.cy.ts b/cypress/e2e/6_editBountyFromModal.cy.ts index 6d2eefaf..9ae36ff1 100644 --- a/cypress/e2e/6_editBountyFromModal.cy.ts +++ b/cypress/e2e/6_editBountyFromModal.cy.ts @@ -2,7 +2,7 @@ describe('Edit Bounty From Modal', () => { const assignee = 'carol'; const bounty: Cypress.Bounty = { title: 'My new Bounty', - workspace:'workspace1', + workspace:'workspace4', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -19,6 +19,16 @@ describe('Edit Bounty From Modal', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace4', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/7_openBountyModal.cy.ts b/cypress/e2e/7_openBountyModal.cy.ts index 11e80d08..652983f2 100644 --- a/cypress/e2e/7_openBountyModal.cy.ts +++ b/cypress/e2e/7_openBountyModal.cy.ts @@ -1,7 +1,7 @@ describe('View Bounty From Modal', () => { const bounty: Cypress.Bounty = { title: 'Ali Bounty', - workspace:'workspace1', + workspace:'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -18,6 +18,16 @@ describe('View Bounty From Modal', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace5', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/8_assignHunter.cy.ts b/cypress/e2e/8_assignHunter.cy.ts index 8e3061e1..4f92e2b7 100644 --- a/cypress/e2e/8_assignHunter.cy.ts +++ b/cypress/e2e/8_assignHunter.cy.ts @@ -1,7 +1,7 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty', - workspace:'workspace1', + workspace:'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -20,6 +20,16 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace6', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); diff --git a/cypress/e2e/9_unassignHunter.cy.ts b/cypress/e2e/9_unassignHunter.cy.ts index 69f8170a..db600ebb 100644 --- a/cypress/e2e/9_unassignHunter.cy.ts +++ b/cypress/e2e/9_unassignHunter.cy.ts @@ -3,7 +3,7 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { const bounty: Cypress.Bounty = { title: 'My new Bounty', - workspace:'workspace1', + workspace:'workspace7', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -20,6 +20,16 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { cy.login(activeUser); cy.wait(1000); + cy.create_workspace({ + loggedInAs: 'carol', + name: 'workspace7', + description: 'We are testing out our workspace', + website: 'https://community.sphinx.chat', + github: 'https://github.com/stakwork/sphinx-tribes-frontend' + }); + + cy.wait(1000); + cy.create_bounty(bounty); cy.wait(1000); From 694f4448249a92dee595c82a2bcc70ed95d2ba43 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 15 Nov 2024 22:26:53 +0500 Subject: [PATCH 4/7] creating workspace first --- cypress/e2e/0_createBounty.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/0_createBounty.cy.ts b/cypress/e2e/0_createBounty.cy.ts index b909739a..14236562 100644 --- a/cypress/e2e/0_createBounty.cy.ts +++ b/cypress/e2e/0_createBounty.cy.ts @@ -5,7 +5,7 @@ describe('Alice tries to create a bounty', () => { cy.wait(1000); cy.create_workspace({ - loggedInAs: 'carol', + loggedInAs: activeUser, name: 'workspace1', description: 'We are testing out our workspace', website: 'https://community.sphinx.chat', From 6c792094d9ba0aca669273a82895da07f9d60f74 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Sat, 16 Nov 2024 14:27:49 +0500 Subject: [PATCH 5/7] update cypress test 0 --- cypress/e2e/0_createBounty.cy.ts | 54 +++++++++++++++++--------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/cypress/e2e/0_createBounty.cy.ts b/cypress/e2e/0_createBounty.cy.ts index 14236562..db157107 100644 --- a/cypress/e2e/0_createBounty.cy.ts +++ b/cypress/e2e/0_createBounty.cy.ts @@ -1,35 +1,39 @@ describe('Alice tries to create a bounty', () => { - it('Create a bounty', () => { - let activeUser = 'alice'; - cy.login(activeUser); - cy.wait(1000); + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace1', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; - cy.create_workspace({ - loggedInAs: activeUser, - name: 'workspace1', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); + const bounty: Cypress.Bounty = { + workspace:'Workspace1', + title: 'My new Bounty', + category: 'Web development', + coding_language: ['Typescript', 'Javascript', 'Lightning'], + description: 'This is available', + amount: '123', + assign: 'carol', + deliverables: 'We are good to go man', + tribe: '', + estimate_session_length: 'Less than 3 hour', + estimate_completion_date: '09/09/2024' + }; + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Create a bounty', () => { - cy.create_bounty({ - title: 'My new Bounty', - workspace:'workspace1', - category: 'Web development', - coding_language: ['Typescript', 'Javascript', 'Lightning'], - description: 'This is available', - amount: '123', - assign: 'carol', - deliverables: 'We are good to go man', - tribe: '', - estimate_session_length: 'Less than 3 hour', - estimate_completion_date: '09/09/2024' - }); + cy.create_bounty(bounty); cy.wait(1000); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); From 26e0a844a81179d42235c14ac306e4328a940288 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Sat, 16 Nov 2024 15:24:35 +0500 Subject: [PATCH 6/7] update cypress tests --- cypress/e2e/11_markAsPaid.cy.ts | 31 +++++++++++---------- cypress/e2e/12_markAsUnpaid.cy.ts | 29 +++++++++++--------- cypress/e2e/15_profileCreateBounties.cy.ts | 27 +++++++++++++----- cypress/e2e/1_create20Bounties.cy.ts | 30 ++++++++++---------- cypress/e2e/28_viewAssignedBounties.cy.ts | 17 +++++++++--- cypress/e2e/30_viewUserLoadMore.cy.ts | 19 +++++++++---- cypress/e2e/32_bountyModalNavigation.cy.ts | 23 ++++++++++++---- cypress/e2e/34_signoutPostBounty.cy.ts | 22 ++++++++++++--- cypress/e2e/36_icanhelpFLow.cy.ts | 20 ++++++++++---- cypress/e2e/37_bountyFilters.cy.ts | 23 ++++++++++++---- cypress/e2e/45_adminBountyList.cy.ts | 16 ++++++++--- cypress/e2e/46_adminFIlterStatus.cy.ts | 16 ++++++++--- cypress/e2e/47_adminFIlterSortBy.cy.ts | 16 ++++++++--- cypress/e2e/48_adminBountyClick.cy.ts | 18 ++++++++---- cypress/e2e/49_adminPaginationNumber.cy.ts | 16 ++++++++--- cypress/e2e/50_adminCustomDateSelect.cy.ts | 16 ++++++++--- cypress/e2e/52_adminCustomDateInput.cy.ts | 16 ++++++++--- cypress/e2e/5_deleteBountyFromModal.cy.ts | 31 +++++++++++---------- cypress/e2e/61_AssignBountiesStatus.cy.ts | 24 ++++++++++++---- cypress/e2e/6_editBountyFromModal.cy.ts | 30 ++++++++++---------- cypress/e2e/7_openBountyModal.cy.ts | 32 ++++++++++++---------- cypress/e2e/8_assignHunter.cy.ts | 30 ++++++++++---------- cypress/e2e/9_unassignHunter.cy.ts | 31 +++++++++++---------- 23 files changed, 349 insertions(+), 184 deletions(-) diff --git a/cypress/e2e/11_markAsPaid.cy.ts b/cypress/e2e/11_markAsPaid.cy.ts index 0fa4afcf..5b00987c 100644 --- a/cypress/e2e/11_markAsPaid.cy.ts +++ b/cypress/e2e/11_markAsPaid.cy.ts @@ -1,9 +1,18 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { const assignee = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace8', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + const bounty: Cypress.Bounty = { + workspace:'Workspace8', title: 'My new Bounty for unapaid user', - workspace:'workspace8', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is a description', @@ -15,20 +24,14 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { estimate_completion_date: '12/12/2024' }; - it('Create a bounty with an assignee then Mark as paid ', () => { - let activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace8', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Create a bounty with an assignee then Mark as paid ', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -54,6 +57,6 @@ describe('Alice tries to Mark a Bounty as paid after creating a bounty', () => { // click outside the modal cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/12_markAsUnpaid.cy.ts b/cypress/e2e/12_markAsUnpaid.cy.ts index 1f25c013..1770ebb0 100644 --- a/cypress/e2e/12_markAsUnpaid.cy.ts +++ b/cypress/e2e/12_markAsUnpaid.cy.ts @@ -1,9 +1,17 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () => { const assignee = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace9', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace:'Workspace9', title: 'My new Bounty for unapaid user', - workspace:'workspace9', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,20 +23,15 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () = estimate_completion_date: '09/09/2024' }; - it('Create a bounty with an assignee then paid and unpaid the user', () => { - let activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); + }); - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace9', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - cy.wait(1000); + it('Create a bounty with an assignee then paid and unpaid the user', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -59,6 +62,6 @@ describe('Alice tries to paid and unpaid a hunter after creating a bounty', () = // click outside the modal cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/15_profileCreateBounties.cy.ts b/cypress/e2e/15_profileCreateBounties.cy.ts index 9df8ae25..a73d40ab 100644 --- a/cypress/e2e/15_profileCreateBounties.cy.ts +++ b/cypress/e2e/15_profileCreateBounties.cy.ts @@ -1,17 +1,30 @@ describe('Alice tries to create a bounty on the user profile page and view them', () => { - it('Create view bounties user profile page', () => { - let activeUser = 'alice'; - cy.login(activeUser); - cy.wait(1000); + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace10', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); + }); + + + it('Create view bounties user profile page', () => { - cy.contains(activeUser).click(); + cy.contains(workspace.loggedInAs).click(); cy.wait(1000); for (let i = 1; i <= 2; i++) { cy.create_bounty( { + workspace:'Workspace10', title: `Bounty Title ${i}`, - workspace:'workspace4', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', @@ -38,6 +51,6 @@ describe('Alice tries to create a bounty on the user profile page and view them' // click outside the modal cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/1_create20Bounties.cy.ts b/cypress/e2e/1_create20Bounties.cy.ts index 1a36c04e..bf18385f 100644 --- a/cypress/e2e/1_create20Bounties.cy.ts +++ b/cypress/e2e/1_create20Bounties.cy.ts @@ -1,23 +1,25 @@ describe('Alice tries to create 20 bounties', () => { - it('Create 20 bounties', () => { - let activeUser = 'alice'; - cy.login(activeUser); - cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace2', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace2', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Create 20 bounties', () => { for (let i = 1; i <= 20; i++) { cy.create_bounty({ + workspace:'Workspace2', title: `Title ${i}`, - workspace:'workspace2', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', @@ -32,6 +34,6 @@ describe('Alice tries to create 20 bounties', () => { cy.wait(1000); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/28_viewAssignedBounties.cy.ts b/cypress/e2e/28_viewAssignedBounties.cy.ts index c5b146e2..3d8a7e6f 100644 --- a/cypress/e2e/28_viewAssignedBounties.cy.ts +++ b/cypress/e2e/28_viewAssignedBounties.cy.ts @@ -1,9 +1,16 @@ describe('View User Assigned Bounties', () => { - let activeUser = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'carol', + name: 'Workspace11', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace:'Workspace11', title: 'Syed Bounty', - workspace:'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -16,7 +23,9 @@ describe('View User Assigned Bounties', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -44,6 +53,6 @@ describe('View User Assigned Bounties', () => { } cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/30_viewUserLoadMore.cy.ts b/cypress/e2e/30_viewUserLoadMore.cy.ts index d6cd414d..0feb1b70 100644 --- a/cypress/e2e/30_viewUserLoadMore.cy.ts +++ b/cypress/e2e/30_viewUserLoadMore.cy.ts @@ -1,9 +1,15 @@ describe('Load More For Created And Assigned Bounties', () => { - let activeUser = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'carol', + name: 'Workspace12', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace:'Workspace12', title: 'Syed Bounty', - workspace:'workspace5', category: 'Web development', description: 'This is available', amount: '12', @@ -13,11 +19,14 @@ describe('Load More For Created And Assigned Bounties', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); 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 <= 22; i++) { const updatedBounty = { ...bounty, title: `Syed Bounty${i}` }; @@ -48,7 +57,7 @@ describe('Load More For Created And Assigned Bounties', () => { cy.contains(`Syed Bounty${i}`, { timeout: 10000 }).should('exist'); } - cy.contains(activeUser).click(); + cy.contains(workspace.loggedInAs).click(); cy.wait(1000); cy.get('[data-testid="Bounties-tab"]').click(); @@ -66,6 +75,6 @@ describe('Load More For Created And Assigned Bounties', () => { } cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/32_bountyModalNavigation.cy.ts b/cypress/e2e/32_bountyModalNavigation.cy.ts index b2c270a6..870eb44e 100644 --- a/cypress/e2e/32_bountyModalNavigation.cy.ts +++ b/cypress/e2e/32_bountyModalNavigation.cy.ts @@ -1,15 +1,28 @@ describe('Alice tries to create 8 bounties and then assert that he can go to the next and previous bounties', () => { - it('Create 8 bounties and assert next and previous bounties', () => { - let activeUser = 'alice'; - cy.login(activeUser); + + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace13', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Create 8 bounties and assert next and previous bounties', () => { const assignees = ['', '', '', 'carol', 'carol', 'carol', 'carol', 'carol']; for (let i = 0; i < 8; i++) { cy.create_bounty({ + workspace:'Workspace13', title: `Navigation Bounty Title ${i}`, - workspace:'workspace5', category: 'Web development', coding_language: ['Typescript'], description: 'Lorem Ipsum Dolor', @@ -112,6 +125,6 @@ describe('Alice tries to create 8 bounties and then assert that he can go to the cy.wait(1000); cy.get('[data-testid="close-btn"]').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/34_signoutPostBounty.cy.ts b/cypress/e2e/34_signoutPostBounty.cy.ts index 2977edf3..df31ab42 100644 --- a/cypress/e2e/34_signoutPostBounty.cy.ts +++ b/cypress/e2e/34_signoutPostBounty.cy.ts @@ -1,9 +1,16 @@ describe('Signed Out Post Bounty Flow ', () => { - let activeUser = 'carol'; + + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace14', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace:'Workspace14', title: 'Syed Bounty', - workspace:'workspace5', category: 'Web development', description: 'This is available', amount: '12', @@ -11,6 +18,13 @@ describe('Signed Out Post Bounty Flow ', () => { deliverables: 'We are good to go man' }; + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); + }); + it('Validates sign-in requirements for posting a bounty, including modal display, signing in, and creating a bounty.', () => { cy.visit('http://localhost:3007/bounties'); cy.wait(1000); @@ -21,7 +35,7 @@ describe('Signed Out Post Bounty Flow ', () => { cy.contains('Sign in').click({ force: true }); cy.wait(1000); - cy.haves_phinx_login(activeUser); + cy.haves_phinx_login(workspace.loggedInAs); cy.wait(1000); cy.create_bounty(bounty); @@ -30,6 +44,6 @@ describe('Signed Out Post Bounty Flow ', () => { cy.contains(bounty.title).should('exist'); cy.wait(1000); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/36_icanhelpFLow.cy.ts b/cypress/e2e/36_icanhelpFLow.cy.ts index aa21fb7b..1ce3c8f2 100644 --- a/cypress/e2e/36_icanhelpFLow.cy.ts +++ b/cypress/e2e/36_icanhelpFLow.cy.ts @@ -1,10 +1,17 @@ describe('I Can Help Flow', () => { - let activeUser = 'alice'; let secondUser = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace15', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace: 'Workspace15', title: 'UmerBounty', - workspace: 'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -18,12 +25,13 @@ describe('I Can Help Flow', () => { beforeEach(() => { cy.clearCookies(); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); }); it('Verify signup and user connection modals for bounties', () => { - cy.login(activeUser); - cy.wait(1000); - for (let i = 1; i <= 3; i++) { const updatedBounty = { ...bounty, title: `UmerBounty${i}` }; cy.create_bounty(updatedBounty); @@ -31,7 +39,7 @@ describe('I Can Help Flow', () => { } cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); cy.wait(3000); cy.contains('I can help').click(); diff --git a/cypress/e2e/37_bountyFilters.cy.ts b/cypress/e2e/37_bountyFilters.cy.ts index 2b82c90b..fe7e359b 100644 --- a/cypress/e2e/37_bountyFilters.cy.ts +++ b/cypress/e2e/37_bountyFilters.cy.ts @@ -1,9 +1,20 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', () => { - it('Create 6 bounties and assert filtered bounties', () => { - let activeUser = 'bob'; - cy.login(activeUser); - cy.wait(2000); + const workspace: Cypress.Workspace = { + loggedInAs: 'bob', + name: 'Workspace16', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + beforeEach(() => { + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); + }); + it('Create 6 bounties and assert filtered bounties', () => { const assignees = ['carol', 'carol', 'carol', 'carol', '', '']; const languages = ['Typescript', 'Lightning', 'PHP', 'Typescript', 'PHP', 'Typescript']; @@ -14,8 +25,8 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( for (let i = 0; i < 6; i++) { cy.create_bounty({ + workspace: 'Workspace16', title: `Filter Bounty Title ${i}`, - workspace: 'workspace6', category: 'Web development', coding_language: [languages[i]], description: 'Lorem Ipsum Dolor', @@ -53,7 +64,7 @@ describe('Alice tries to create 6 bounties and then assert filtered bounties', ( } } - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); cy.wait(1000); // check open filter diff --git a/cypress/e2e/45_adminBountyList.cy.ts b/cypress/e2e/45_adminBountyList.cy.ts index a31d6010..41b3ed12 100644 --- a/cypress/e2e/45_adminBountyList.cy.ts +++ b/cypress/e2e/45_adminBountyList.cy.ts @@ -1,9 +1,15 @@ describe('Super Admin Bounties List', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace17', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace17', title: 'AliRazaTask', - workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,7 +21,9 @@ describe('Super Admin Bounties List', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -49,6 +57,6 @@ describe('Super Admin Bounties List', () => { cy.contains(`AliRazaTask${i}`, { timeout: 10000 }).should('exist'); } - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/46_adminFIlterStatus.cy.ts b/cypress/e2e/46_adminFIlterStatus.cy.ts index 436f56af..aaf0353a 100644 --- a/cypress/e2e/46_adminFIlterStatus.cy.ts +++ b/cypress/e2e/46_adminFIlterStatus.cy.ts @@ -1,9 +1,15 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace18', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace18', title: 'Syed', - workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', @@ -12,7 +18,9 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -106,6 +114,6 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { cy.wait(1000); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/47_adminFIlterSortBy.cy.ts b/cypress/e2e/47_adminFIlterSortBy.cy.ts index 6018ebcb..c20fe71d 100644 --- a/cypress/e2e/47_adminFIlterSortBy.cy.ts +++ b/cypress/e2e/47_adminFIlterSortBy.cy.ts @@ -1,9 +1,15 @@ describe('Super Admin Bounty Filter SortBy', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace19', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace19', title: 'MirzaRef', - workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', @@ -11,7 +17,9 @@ describe('Super Admin Bounty Filter SortBy', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -38,6 +46,6 @@ describe('Super Admin Bounty Filter SortBy', () => { cy.contains('MirzaRef1').should('not.exist'); cy.contains('MirzaRef2').should('not.exist'); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/48_adminBountyClick.cy.ts b/cypress/e2e/48_adminBountyClick.cy.ts index 7c399c78..15c74889 100644 --- a/cypress/e2e/48_adminBountyClick.cy.ts +++ b/cypress/e2e/48_adminBountyClick.cy.ts @@ -1,9 +1,15 @@ describe('Super Admin Bounty Creation and Verification', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace19', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace19', title: 'saithsab', - workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,7 +21,9 @@ describe('Super Admin Bounty Creation and Verification', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -32,7 +40,7 @@ describe('Super Admin Bounty Creation and Verification', () => { cy.contains(`saithsab2`).invoke('removeAttr', 'target').click({ force: true }); cy.wait(2000); - cy.get('[data-testid="owner_name"]').contains(activeUser).should('exist'); + cy.get('[data-testid="owner_name"]').contains(workspace.loggedInAs).should('exist'); cy.wait(1000); cy.contains('saithsab2').should('exist'); @@ -62,6 +70,6 @@ describe('Super Admin Bounty Creation and Verification', () => { cy.get('body').click(0, 0); cy.wait(600); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/49_adminPaginationNumber.cy.ts b/cypress/e2e/49_adminPaginationNumber.cy.ts index 67feed3d..48669925 100644 --- a/cypress/e2e/49_adminPaginationNumber.cy.ts +++ b/cypress/e2e/49_adminPaginationNumber.cy.ts @@ -1,9 +1,15 @@ describe('Super Admin Pagination Bounties List', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace20', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace20', title: 'Pagination Bounty', - workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,7 +21,9 @@ describe('Super Admin Pagination Bounties List', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -40,6 +48,6 @@ describe('Super Admin Pagination Bounties List', () => { cy.contains(`Pagination Bounty ${i}`, { timeout: 10000 }).should('exist'); } - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/50_adminCustomDateSelect.cy.ts b/cypress/e2e/50_adminCustomDateSelect.cy.ts index 6308a267..9cf06334 100644 --- a/cypress/e2e/50_adminCustomDateSelect.cy.ts +++ b/cypress/e2e/50_adminCustomDateSelect.cy.ts @@ -1,9 +1,15 @@ describe('Admin Statistics Custom Date Range', () => { - let activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace21', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace21', title: 'UmerJobs', - workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -11,7 +17,9 @@ describe('Admin Statistics Custom Date Range', () => { }; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -72,6 +80,6 @@ describe('Admin Statistics Custom Date Range', () => { cy.get('[data-testid="month"]').should('have.text', expectedDateRange); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/52_adminCustomDateInput.cy.ts b/cypress/e2e/52_adminCustomDateInput.cy.ts index e8d7f78a..00c383ac 100644 --- a/cypress/e2e/52_adminCustomDateInput.cy.ts +++ b/cypress/e2e/52_adminCustomDateInput.cy.ts @@ -1,9 +1,15 @@ describe('Admin Custom Date Input', () => { - const activeUser = 'alice'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace22', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; const bounty: Cypress.Bounty = { + workspace: 'Workspace22', title: 'Admin', - workspace: 'workspace6', category: 'Web development', description: 'This is available', amount: '123', @@ -26,7 +32,9 @@ describe('Admin Custom Date Input', () => { .padStart(2, '0')}/${endDate.getFullYear()}`; beforeEach(() => { - cy.login(activeUser); + cy.login(workspace.loggedInAs); + cy.wait(1000); + cy.create_workspace(workspace); cy.wait(1000); }); @@ -78,7 +86,7 @@ describe('Admin Custom Date Input', () => { cy.contains(`Admin${i}`); } - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/5_deleteBountyFromModal.cy.ts b/cypress/e2e/5_deleteBountyFromModal.cy.ts index ff2d88e5..9ab2b614 100644 --- a/cypress/e2e/5_deleteBountyFromModal.cy.ts +++ b/cypress/e2e/5_deleteBountyFromModal.cy.ts @@ -1,7 +1,15 @@ describe('Can Delete Bounty From Modal', () => { + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace3', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace:'Workspace3', title: 'Ali Bounty', - workspace:'workspace3', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -12,20 +20,15 @@ describe('Can Delete Bounty From Modal', () => { deliverables: 'We are good to go man' }; - it('Can delete a bounty from modal', () => { - const activeUser = 'alice'; - cy.login(activeUser); - cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace3', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); + }); + + it('Can delete a bounty from modal', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -48,6 +51,6 @@ describe('Can Delete Bounty From Modal', () => { cy.contains(bounty.title).should('not.exist'); cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/61_AssignBountiesStatus.cy.ts b/cypress/e2e/61_AssignBountiesStatus.cy.ts index 7abda959..986dc4b9 100644 --- a/cypress/e2e/61_AssignBountiesStatus.cy.ts +++ b/cypress/e2e/61_AssignBountiesStatus.cy.ts @@ -1,8 +1,17 @@ describe('Verify Bounty Status Consistency', () => { const assignee = 'carol'; + + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace23', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace: 'Workspace23', title: 'Ali Bounty', - workspace: 'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -14,11 +23,14 @@ describe('Verify Bounty Status Consistency', () => { estimate_completion_date: '09/09/2024' }; - it('Should display consistent bounty status in list and details views', () => { - const activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); + cy.create_workspace(workspace); + cy.wait(1000); + }); + it('Should display consistent bounty status in list and details views', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -39,7 +51,7 @@ describe('Verify Bounty Status Consistency', () => { cy.get('body').click(0, 0); - cy.contains(activeUser).click(); + cy.contains(workspace.loggedInAs).click(); cy.wait(1000); cy.get('[data-testid="Bounties-tab"]').click(); @@ -50,6 +62,6 @@ describe('Verify Bounty Status Consistency', () => { cy.contains('Complete').should('exist'); cy.wait(1000); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/6_editBountyFromModal.cy.ts b/cypress/e2e/6_editBountyFromModal.cy.ts index 9ae36ff1..b74dfc4f 100644 --- a/cypress/e2e/6_editBountyFromModal.cy.ts +++ b/cypress/e2e/6_editBountyFromModal.cy.ts @@ -1,8 +1,17 @@ describe('Edit Bounty From Modal', () => { + + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace4', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const assignee = 'carol'; const bounty: Cypress.Bounty = { + workspace:'Workspace4', title: 'My new Bounty', - workspace:'workspace4', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -14,21 +23,14 @@ describe('Edit Bounty From Modal', () => { estimate_completion_date: '09/09/2024' }; - it('Can edit a bounty from modal', () => { - const activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace4', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - + cy.create_workspace(workspace); cy.wait(1000); + }); + it('Can edit a bounty from modal', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -55,6 +57,6 @@ describe('Edit Bounty From Modal', () => { cy.contains(newTitle).should('exist'); cy.contains(newDescription).should('exist'); cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/7_openBountyModal.cy.ts b/cypress/e2e/7_openBountyModal.cy.ts index 652983f2..f90403a7 100644 --- a/cypress/e2e/7_openBountyModal.cy.ts +++ b/cypress/e2e/7_openBountyModal.cy.ts @@ -1,7 +1,16 @@ describe('View Bounty From Modal', () => { + + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace5', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace:'Workspace5', title: 'Ali Bounty', - workspace:'workspace5', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -13,21 +22,14 @@ describe('View Bounty From Modal', () => { estimate_completion_date: '09/09/2024' }; - it('Should view the bounty modal after creating', () => { - const activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace5', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - + cy.create_workspace(workspace); cy.wait(1000); + }); + it('Should view the bounty modal after creating', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -40,7 +42,7 @@ describe('View Bounty From Modal', () => { cy.contains(bounty.title).click(); cy.wait(1000); - cy.get('[data-testid="owner_name"]').contains(activeUser).should('exist'); + cy.get('[data-testid="owner_name"]').contains(workspace.loggedInAs).should('exist'); cy.wait(1000); cy.contains(bounty.title).should('exist'); @@ -75,6 +77,6 @@ describe('View Bounty From Modal', () => { cy.wait(1000); cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/8_assignHunter.cy.ts b/cypress/e2e/8_assignHunter.cy.ts index 4f92e2b7..5cd85cb6 100644 --- a/cypress/e2e/8_assignHunter.cy.ts +++ b/cypress/e2e/8_assignHunter.cy.ts @@ -1,7 +1,15 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace6', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + const bounty: Cypress.Bounty = { + workspace:'Workspace6', title: 'My new Bounty', - workspace:'workspace6', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,21 +23,15 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { const assignee = 'carol'; - it('Creates a bounty without assignee', () => { - let activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace6', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Creates a bounty without assignee', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -48,6 +50,6 @@ describe('Alice tries to assign a hunter after creating a bounty', () => { // click outside the modal cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); diff --git a/cypress/e2e/9_unassignHunter.cy.ts b/cypress/e2e/9_unassignHunter.cy.ts index db600ebb..3a69bd38 100644 --- a/cypress/e2e/9_unassignHunter.cy.ts +++ b/cypress/e2e/9_unassignHunter.cy.ts @@ -1,9 +1,18 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { const assignee = 'carol'; + const workspace: Cypress.Workspace = { + loggedInAs: 'alice', + name: 'Workspace7', + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + const bounty: Cypress.Bounty = { + workspace:'Workspace7', title: 'My new Bounty', - workspace:'workspace7', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], description: 'This is available', @@ -15,21 +24,15 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { estimate_completion_date: '09/09/2024' }; - it('Create a bounty with an assignee then unassign the user', () => { - let activeUser = 'alice'; - cy.login(activeUser); + beforeEach(() => { + cy.login(workspace.loggedInAs); cy.wait(1000); - - cy.create_workspace({ - loggedInAs: 'carol', - name: 'workspace7', - description: 'We are testing out our workspace', - website: 'https://community.sphinx.chat', - github: 'https://github.com/stakwork/sphinx-tribes-frontend' - }); - + cy.create_workspace(workspace); cy.wait(1000); + }); + + it('Create a bounty with an assignee then unassign the user', () => { cy.create_bounty(bounty); cy.wait(1000); @@ -50,6 +53,6 @@ describe('Alice tries to unassign a hunter after creating a bounty', () => { // click outside the modal cy.get('body').click(0, 0); - cy.logout(activeUser); + cy.logout(workspace.loggedInAs); }); }); From e38857966bc491b9b73f4b852c9c3415a0b008d8 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Sun, 17 Nov 2024 12:08:44 +0500 Subject: [PATCH 7/7] update cypress tests that are going to be failed --- .../e2e/33_workspaceBountyStatusFilter.cy.ts | 24 ++++++++++--------- cypress/e2e/34_signoutPostBounty.cy.ts | 4 +++- cypress/e2e/36_icanhelpFLow.cy.ts | 1 + cypress/e2e/45_adminBountyList.cy.ts | 16 ++++--------- cypress/e2e/46_adminFIlterStatus.cy.ts | 16 ++++--------- cypress/e2e/47_adminFIlterSortBy.cy.ts | 16 ++++--------- cypress/e2e/48_adminBountyClick.cy.ts | 18 ++++---------- cypress/e2e/49_adminPaginationNumber.cy.ts | 16 ++++--------- cypress/e2e/50_adminCustomDateSelect.cy.ts | 16 ++++--------- 9 files changed, 42 insertions(+), 85 deletions(-) diff --git a/cypress/e2e/33_workspaceBountyStatusFilter.cy.ts b/cypress/e2e/33_workspaceBountyStatusFilter.cy.ts index cafcfcf1..95bd7615 100644 --- a/cypress/e2e/33_workspaceBountyStatusFilter.cy.ts +++ b/cypress/e2e/33_workspaceBountyStatusFilter.cy.ts @@ -1,21 +1,23 @@ describe('filter by status for org bounty', () => { - it('should filter bounties according to the status selected', () => { - const workspaceName = 'E2EWorkspace3'; - - const workspace: Cypress.Workspace = { - loggedInAs: 'bob', - name: workspaceName, - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + const workspaceName = 'E2EWorkspace3'; + const workspace: Cypress.Workspace = { + loggedInAs: 'bob', + name: workspaceName, + description: 'A workspace focused on amazing projects.', + website: 'https://amazing.org', + github: 'https://github.com/amazing' + }; + + beforeEach(() => { cy.login(workspace.loggedInAs); cy.wait(1000); - cy.create_workspace(workspace); cy.wait(1000); + }); + + it('should filter bounties according to the status selected', () => { const bounty1: Cypress.Bounty = { workspace: workspaceName, title: 'Bounty1(open)', diff --git a/cypress/e2e/34_signoutPostBounty.cy.ts b/cypress/e2e/34_signoutPostBounty.cy.ts index df31ab42..9727ae39 100644 --- a/cypress/e2e/34_signoutPostBounty.cy.ts +++ b/cypress/e2e/34_signoutPostBounty.cy.ts @@ -1,7 +1,7 @@ describe('Signed Out Post Bounty Flow ', () => { const workspace: Cypress.Workspace = { - loggedInAs: 'alice', + loggedInAs: 'carol', name: 'Workspace14', description: 'A workspace focused on amazing projects.', website: 'https://amazing.org', @@ -23,6 +23,8 @@ describe('Signed Out Post Bounty Flow ', () => { cy.wait(1000); cy.create_workspace(workspace); cy.wait(1000); + cy.logout(workspace.loggedInAs); + cy.wait(1000); }); it('Validates sign-in requirements for posting a bounty, including modal display, signing in, and creating a bounty.', () => { diff --git a/cypress/e2e/36_icanhelpFLow.cy.ts b/cypress/e2e/36_icanhelpFLow.cy.ts index 1ce3c8f2..fdcc6402 100644 --- a/cypress/e2e/36_icanhelpFLow.cy.ts +++ b/cypress/e2e/36_icanhelpFLow.cy.ts @@ -25,6 +25,7 @@ describe('I Can Help Flow', () => { beforeEach(() => { cy.clearCookies(); + cy.wait(1000); cy.login(workspace.loggedInAs); cy.wait(1000); cy.create_workspace(workspace); diff --git a/cypress/e2e/45_adminBountyList.cy.ts b/cypress/e2e/45_adminBountyList.cy.ts index 41b3ed12..bb4befc6 100644 --- a/cypress/e2e/45_adminBountyList.cy.ts +++ b/cypress/e2e/45_adminBountyList.cy.ts @@ -1,14 +1,8 @@ describe('Super Admin Bounties List', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace17', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace17', + workspace: 'Workspace1', title: 'AliRazaTask', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], @@ -21,9 +15,7 @@ describe('Super Admin Bounties List', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -57,6 +49,6 @@ describe('Super Admin Bounties List', () => { cy.contains(`AliRazaTask${i}`, { timeout: 10000 }).should('exist'); } - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); }); diff --git a/cypress/e2e/46_adminFIlterStatus.cy.ts b/cypress/e2e/46_adminFIlterStatus.cy.ts index aaf0353a..3e356c9c 100644 --- a/cypress/e2e/46_adminFIlterStatus.cy.ts +++ b/cypress/e2e/46_adminFIlterStatus.cy.ts @@ -1,14 +1,8 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace18', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace18', + workspace: 'Workspace1', title: 'Syed', category: 'Web development', description: 'This is available', @@ -18,9 +12,7 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -114,6 +106,6 @@ describe('Super Admin Bounty Filter Status Dropdown ', () => { cy.wait(1000); - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); }); diff --git a/cypress/e2e/47_adminFIlterSortBy.cy.ts b/cypress/e2e/47_adminFIlterSortBy.cy.ts index c20fe71d..738ac16e 100644 --- a/cypress/e2e/47_adminFIlterSortBy.cy.ts +++ b/cypress/e2e/47_adminFIlterSortBy.cy.ts @@ -1,14 +1,8 @@ describe('Super Admin Bounty Filter SortBy', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace19', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace19', + workspace: 'Workspace1', title: 'MirzaRef', category: 'Web development', description: 'This is available', @@ -17,9 +11,7 @@ describe('Super Admin Bounty Filter SortBy', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -46,6 +38,6 @@ describe('Super Admin Bounty Filter SortBy', () => { cy.contains('MirzaRef1').should('not.exist'); cy.contains('MirzaRef2').should('not.exist'); - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); }); diff --git a/cypress/e2e/48_adminBountyClick.cy.ts b/cypress/e2e/48_adminBountyClick.cy.ts index 15c74889..1d8bbe07 100644 --- a/cypress/e2e/48_adminBountyClick.cy.ts +++ b/cypress/e2e/48_adminBountyClick.cy.ts @@ -1,14 +1,8 @@ describe('Super Admin Bounty Creation and Verification', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace19', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace19', + workspace: 'Workspace1', title: 'saithsab', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], @@ -21,9 +15,7 @@ describe('Super Admin Bounty Creation and Verification', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -40,7 +32,7 @@ describe('Super Admin Bounty Creation and Verification', () => { cy.contains(`saithsab2`).invoke('removeAttr', 'target').click({ force: true }); cy.wait(2000); - cy.get('[data-testid="owner_name"]').contains(workspace.loggedInAs).should('exist'); + cy.get('[data-testid="owner_name"]').contains(activeUser).should('exist'); cy.wait(1000); cy.contains('saithsab2').should('exist'); @@ -70,6 +62,6 @@ describe('Super Admin Bounty Creation and Verification', () => { cy.get('body').click(0, 0); cy.wait(600); - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); }); diff --git a/cypress/e2e/49_adminPaginationNumber.cy.ts b/cypress/e2e/49_adminPaginationNumber.cy.ts index 48669925..faf929c4 100644 --- a/cypress/e2e/49_adminPaginationNumber.cy.ts +++ b/cypress/e2e/49_adminPaginationNumber.cy.ts @@ -1,14 +1,8 @@ describe('Super Admin Pagination Bounties List', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace20', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace20', + workspace: 'Workspace1', title: 'Pagination Bounty', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], @@ -21,9 +15,7 @@ describe('Super Admin Pagination Bounties List', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -48,6 +40,6 @@ describe('Super Admin Pagination Bounties List', () => { cy.contains(`Pagination Bounty ${i}`, { timeout: 10000 }).should('exist'); } - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); }); diff --git a/cypress/e2e/50_adminCustomDateSelect.cy.ts b/cypress/e2e/50_adminCustomDateSelect.cy.ts index 9cf06334..a2a04b05 100644 --- a/cypress/e2e/50_adminCustomDateSelect.cy.ts +++ b/cypress/e2e/50_adminCustomDateSelect.cy.ts @@ -1,14 +1,8 @@ describe('Admin Statistics Custom Date Range', () => { - const workspace: Cypress.Workspace = { - loggedInAs: 'alice', - name: 'Workspace21', - description: 'A workspace focused on amazing projects.', - website: 'https://amazing.org', - github: 'https://github.com/amazing' - }; + let activeUser = 'alice'; const bounty: Cypress.Bounty = { - workspace: 'Workspace21', + workspace: 'Workspace1', title: 'UmerJobs', category: 'Web development', coding_language: ['Typescript', 'Javascript', 'Lightning'], @@ -17,9 +11,7 @@ describe('Admin Statistics Custom Date Range', () => { }; beforeEach(() => { - cy.login(workspace.loggedInAs); - cy.wait(1000); - cy.create_workspace(workspace); + cy.login(activeUser); cy.wait(1000); }); @@ -80,6 +72,6 @@ describe('Admin Statistics Custom Date Range', () => { cy.get('[data-testid="month"]').should('have.text', expectedDateRange); - cy.logout(workspace.loggedInAs); + cy.logout(activeUser); }); });