Skip to content

Commit

Permalink
Merge pull request stakwork#400 from saithsab877/Cypress-test-Create-…
Browse files Browse the repository at this point in the history
…org-bounty

Added Cypress Test For Create org bounty
  • Loading branch information
elraphty authored Mar 14, 2024
2 parents 0f96633 + f21495b commit 4e6c66e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions cypress/e2e/4_createOrgBounty.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
describe('User creates a bounty attached to an organization', () => {
const org: Cypress.Organization = {
loggedInAs: 'alice',
name: 'Alice Organization',
description: 'An organization focused on amazing projects.',
website: 'https://amazing.org',
github: 'https://github.com/amazing'
};

const bounty: Cypress.Bounty = {
organization: 'Alice Organization',
title: 'Alice Bounty',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
description: 'This is available',
amount: '123',
tribe: 'Amazing Org Tribe',
estimate_session_length: 'Less than 3 hour',
estimate_completion_date: '09/09/2024',
deliverables: 'We are good to go man',
assign: ''
};

beforeEach(() => {
cy.login(org.loggedInAs);
cy.wait(1000);
cy.create_org(org);
cy.wait(1000);
});

it('should verify the bounty tile has the org label and is clickable', () => {
cy.create_bounty(bounty);
cy.wait(1000);

cy.contains(bounty.title);
cy.wait(1000);

cy.contains(org.name).click();

cy.logout(org.loggedInAs);
});
});
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Cypress.Commands.add('lnurl_login', () => {

Cypress.Commands.add('create_org', (organization) => {
cy.contains(organization.loggedInAs).click({ force: true });

cy.wait(1000);
cy.contains('Add Organization').click();

cy.get('[placeholder="My Organization..."]').type(organization.name);
Expand Down

0 comments on commit 4e6c66e

Please sign in to comment.