Skip to content

Commit

Permalink
fixed cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed May 30, 2024
1 parent 929fbf3 commit e1b2a58
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/17_createWorkspaceUser.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Add User to Workspace', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/18_withdrawWorkspaceBudget.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('It Withdraws from Workspace budget', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();

const depositAmount = 10000;
const withdrawAmount = 2000;
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/19_manageUserRoles.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Alice Create an Workspace and then manage user roles', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/20_deleteWorkspaceUser.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Delete User from a Workspace', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/22_viewOrgBountiesFromWorkspace.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('User creates a bounties attached to an workspace', () => {
cy.contains(workspace.loggedInAs).click();
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('a[href*="/workspace/bounties"]').then(($link: JQuery<HTMLElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/23_editWorkspaceDetails.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Edit Workspace Details', () => {
});

it('should edit workspace details successfully', () => {
cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.contains(/^Edit$/).click();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/29_paymentHistory.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('It Lists all payments in history', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

const depositAmount = 10000;
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('It Lists all payments in history', () => {
cy.contains(activeUser).click();
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('History').click({ force: true });
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/39_rolesViewHistory.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
describe('View Transaction History', () => {
const workSpace = {
loggedInAs: 'alice',
name: 'SyedWorkspaceZ',
name: 'SyedWorkspace3',
description: 'We are testing out our workspace',
website: '',
github: ''
Expand All @@ -14,7 +14,7 @@ describe('View Transaction History', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -55,7 +55,7 @@ describe('View Transaction History', () => {
cy.contains(workSpace.name).should('exist');
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('History').should('not.be.disabled');
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/40_rolesupdateMembers.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('filter by status for workspace bounty', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('filter by status for workspace bounty', () => {
cy.contains('carol').click({ force: true });
cy.wait(1000);

cy.contains(WorkSpaceName).contains('Manage').click({ force: true });
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/41_rolesManageWorkspace.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('matches workspace description with Carol updated description', () => {
it('should matches workspace description with Carol updated description', () => {
const WorkSpaceName = 'Update Description';
const WorkSpaceName = 'Update Description1';

const workSpace: Cypress.Workspace = {
loggedInAs: 'alice',
Expand All @@ -18,7 +18,7 @@ describe('matches workspace description with Carol updated description', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('matches workspace description with Carol updated description', () => {
cy.contains('carol').click({ force: true });
cy.wait(1000);

cy.contains(WorkSpaceName).contains('Manage').click({ force: true });
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains(/^Edit$/).click();
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('matches workspace description with Carol updated description', () => {
cy.contains(workSpace.loggedInAs).click({ force: true });
cy.wait(1000);

cy.contains(WorkSpaceName).contains('Manage').click({ force: true });
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains(/^Edit$/).click();
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/42_rolesWithdrawWorkspace.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Withdraw From Workspace Role Test', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('Withdraw From Workspace Role Test', () => {
cy.contains(workspace.name).should('exist').and('be.visible');
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

//Assert that the Withdraw button is not disabled
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/43_rolesFundWorkspace.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Fund Workspace Role Test', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('Fund Workspace Role Test', () => {
cy.contains(workspace.name).should('exist').and('be.visible');
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

//Assert that the Deposit button is not disabled
Expand Down
7 changes: 5 additions & 2 deletions cypress/e2e/44_rolesManageBounties.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('carol manage workspace bounties', () => {
cy.create_workspace(workSpace);
cy.wait(1000);

cy.contains(workSpace.name).contains('Manage').click();
cy.contains(workSpace.name).get(`[data-work-name="${workSpace.name}"]`).click();
cy.wait(1000);

cy.contains('Add User').click();
Expand Down Expand Up @@ -65,7 +65,10 @@ describe('carol manage workspace bounties', () => {
cy.contains('carol').click({ force: true });
cy.wait(1000);

cy.contains(WorkSpaceName).contains('Manage').should('exist');
cy.contains(WorkSpaceName)
.get(`[data-work-name="${workSpace.name}"]`)
.contains('Manage')
.should('exist');
cy.wait(1000);

cy.create_bounty(bounty);
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/53_workspaceMission.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Create Workspace And Update Mission', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/54_addFeature.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Add feature To Workspace', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/55_updateFeature.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Update feature To Workspace', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/56_briefUpdateFeature.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Update feature To Workspace', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/57_workspaceRequirementFeatureUpdate.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Update Requirements in Workspace Feature', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/58_addUserStoriesToFeature.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Add user stories to features', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/58_updateWorkspaceSchematic.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Updating Workspace schematic', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/59_updateWorkspaceFeaturePhase.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Workspace Phasing Feature Tests', () => {
cy.create_workspace(workspace);
cy.wait(3000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/60_addPeopleToWorkspaceMission.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Create Workspace And Update People On Mission', () => {
cy.create_workspace(workspace);
cy.wait(1000);

cy.contains(workspace.name).contains('Manage').click();
cy.contains(workspace.name).get(`[data-work-name="${workspace.name}"]`).click();
cy.wait(1000);

cy.get('[data-testid="mission-link"]')
Expand Down
2 changes: 1 addition & 1 deletion src/people/widgetViews/workspace/ManageWorkspaceButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ManageButton = (props: { user_pubkey: string; org: any; action: () => void
return (
<>
{hasAccess && (
<Button onClick={action} data-org-name={org.name}>
<Button data-testid="workspace-manage-btn" onClick={action} data-work-name={org.name}>
Manage
</Button>
)}
Expand Down

0 comments on commit e1b2a58

Please sign in to comment.