Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make workspace non-optional #645

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions cypress/e2e/0_createBounty.cy.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
describe('Alice tries to create a bounty', () => {
it('Create a bounty', () => {
let activeUser = 'alice';
cy.login(activeUser);
const workspace: Cypress.Workspace = {
loggedInAs: 'alice',
name: 'Workspace1',
description: 'A workspace focused on amazing projects.',
website: 'https://amazing.org',
github: 'https://github.com/amazing'
};

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',
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);
});
});
22 changes: 18 additions & 4 deletions cypress/e2e/11_markAsPaid.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
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',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
Expand All @@ -14,10 +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(workspace);
cy.wait(1000);
});

it('Create a bounty with an assignee then Mark as paid ', () => {

cy.create_bounty(bounty);
cy.wait(1000);
Expand All @@ -43,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);
});
});
22 changes: 18 additions & 4 deletions cypress/e2e/12_markAsUnpaid.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
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',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
Expand All @@ -14,10 +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);
});


it('Create a bounty with an assignee then paid and unpaid the user', () => {

cy.create_bounty(bounty);
cy.wait(1000);
Expand Down Expand Up @@ -48,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);
});
});
26 changes: 20 additions & 6 deletions cypress/e2e/15_profileCreateBounties.cy.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
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}`,
category: 'Web development',
coding_language: ['Typescript'],
Expand Down Expand Up @@ -37,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);
});
});
21 changes: 17 additions & 4 deletions cypress/e2e/1_create20Bounties.cy.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
describe('Alice tries to create 20 bounties', () => {
it('Create 20 bounties', () => {
let activeUser = 'alice';
cy.login(activeUser);
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}`,
category: 'Web development',
coding_language: ['Typescript'],
Expand All @@ -21,6 +34,6 @@ describe('Alice tries to create 20 bounties', () => {

cy.wait(1000);

cy.logout(activeUser);
cy.logout(workspace.loggedInAs);
});
});
16 changes: 13 additions & 3 deletions cypress/e2e/28_viewAssignedBounties.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
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',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
Expand All @@ -15,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);
});

Expand Down Expand Up @@ -43,6 +53,6 @@ describe('View User Assigned Bounties', () => {
}

cy.get('body').click(0, 0);
cy.logout(activeUser);
cy.logout(workspace.loggedInAs);
});
});
18 changes: 14 additions & 4 deletions cypress/e2e/30_viewUserLoadMore.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
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',
category: 'Web development',
description: 'This is available',
Expand All @@ -12,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}` };
Expand Down Expand Up @@ -47,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();
Expand All @@ -65,6 +75,6 @@ describe('Load More For Created And Assigned Bounties', () => {
}

cy.get('body').click(0, 0);
cy.logout(activeUser);
cy.logout(workspace.loggedInAs);
});
});
22 changes: 18 additions & 4 deletions cypress/e2e/32_bountyModalNavigation.cy.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
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}`,
category: 'Web development',
coding_language: ['Typescript'],
Expand Down Expand Up @@ -111,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);
});
});
24 changes: 13 additions & 11 deletions cypress/e2e/33_workspaceBountyStatusFilter.cy.ts
Original file line number Diff line number Diff line change
@@ -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)',
Expand Down
Loading
Loading