Skip to content

Commit

Permalink
Merge pull request stakwork#433 from aliraza556/cypress-View-bounty-m…
Browse files Browse the repository at this point in the history
…odal

[Tests][Cypress]: Added Cypress Test For `View Bounty Modal`
  • Loading branch information
elraphty authored Mar 19, 2024
2 parents cc4fa99 + 5bde306 commit c53a125
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
69 changes: 69 additions & 0 deletions cypress/e2e/4_openBountyModal.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
describe('View Bounty From Modal', () => {
const bounty: Cypress.Bounty = {
title: 'Ali Bounty',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
description: 'This is available',
amount: '844',
assign: 'carol',
deliverables: 'I can submit a pr within 2 days of taking the bounty',
tribe: '',
estimate_session_length: 'Less than 3 hour',
estimate_completion_date: '09/09/2024'
};

it('Should view the bounty modal after creating', () => {
const activeUser = 'alice';
cy.login(activeUser);
cy.wait(1000);

cy.create_bounty(bounty);
cy.wait(1000);

cy.contains('Filter').click();
cy.wait(600);
cy.contains('Open').click();
cy.contains('Assigned').click();
cy.wait(1000);

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

cy.get('[data-testid="owner_name"]').contains(activeUser).should('exist');
cy.wait(1000);

cy.contains(bounty.title).should('exist');
cy.wait(1000);

cy.contains(bounty.description).should('exist');
cy.wait(1000);

cy.contains(bounty.deliverables).should('exist');
cy.wait(1000);

cy.contains(bounty.assign).should('exist');
cy.wait(1000);

cy.contains(bounty.amount).should('exist');
cy.wait(1000);

cy.contains('Estimate:').should('exist');
cy.contains('< 3 hrs').should('exist');
cy.wait(1000);

cy.contains('Copy Link').should('exist');
cy.wait(600);

cy.contains('Share to Twitter').should('exist');
cy.wait(600);

cy.contains('Mark as Paid').should('exist');
cy.wait(600);

cy.contains('Pay Bounty').should('exist');
cy.wait(1000);

cy.get('body').click(0, 0);
cy.logout(activeUser);
});
});
1 change: 1 addition & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Cypress.Commands.add('create_bounty', (bounty, clickMethod = 'contains') => {

if (bounty.assign) {
cy.get('.SearchInput').type(bounty.assign);
cy.wait(1000);
cy.get('.People').contains('Assign').click();
} else {
cy.contains('Decide Later').click();
Expand Down
1 change: 1 addition & 0 deletions src/people/utils/NameTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function NameTag(props: NameTagProps) {
}}
>
<Name
data-testid="owner_name"
textSize={textSize}
color={isPaid ? color.grayish.G300 : color.pureBlack}
onClick={(e: any) => {
Expand Down

0 comments on commit c53a125

Please sign in to comment.