Skip to content

Commit

Permalink
Added Cypress Test For Super Admin Bounty Click
Browse files Browse the repository at this point in the history
  • Loading branch information
saithsab877 committed Mar 27, 2024
1 parent 73f2a49 commit 6c9d372
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions cypress/e2e/48_adminBountyClick.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
describe('Super Admin Bounty Creation and Verification', () => {
let activeUser = 'alice';

const bounty: Cypress.Bounty = {
title: 'saithsab',
category: 'Web development',
coding_language: ['Typescript', 'Javascript', 'Lightning'],
description: 'This is available',
amount: '844',
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'
};

beforeEach(() => {
cy.login(activeUser);
cy.wait(1000);
});

it('Should create six bounties, navigate to the Admin page, verify the second bounty, and logout', () => {
for (let i = 1; i <= 3; i++) {
const updatedBounty = { ...bounty, title: `saithsab${i}` };
cy.create_bounty(updatedBounty);
cy.wait(1000);
}

cy.visit('http://localhost:3007/admin');
cy.wait(3000);

cy.contains(`saithsab2`).invoke('removeAttr', 'target').click({ force: true });
cy.wait(2000);

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

cy.contains('saithsab2').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.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.get('body').click(0, 0);
cy.wait(600);
cy.logout(activeUser);
});
});

0 comments on commit 6c9d372

Please sign in to comment.