Skip to content

Commit

Permalink
Merge pull request stakwork#417 from Vayras/CypressTest@
Browse files Browse the repository at this point in the history
Cypress Test For add user to organization
  • Loading branch information
elraphty authored Mar 18, 2024
2 parents 910c6dc + 0cf1918 commit 4ad6121
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions cypress/e2e/17_create_org_user.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
describe('Add User to Organization', () => {
it('should add a user to an organization', () => {
const org = {
loggedInAs: 'carol',
name: 'TEST E2E',
description: 'We are testing out our organization',
website: 'https://community.sphinx.chat',
github: 'https://github.com/stakwork/sphinx-tribes-frontend'
};

cy.login(org.loggedInAs);
cy.wait(1000);

cy.create_org(org);
cy.wait(1000);

cy.contains(org.name).contains('Manage').click();
cy.wait(1000);

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

cy.get('input').type('alice');
cy.wait(1000);

cy.contains('Select').click();
cy.wait(1000);

cy.get('#sphinx-top-level-overlay').should('be.visible');

cy.get('#sphinx-top-level-overlay').within(() => {
cy.contains('Add User').click();
cy.wait(1000);
});
cy.wait(1000);

cy.get('#sphinx-top-level-overlay').within(() => {
cy.contains('Assign').click();
cy.wait(1000);
});

cy.contains('alice').get('[data-testid="settings-icon"]').click();
cy.wait(1000);

cy.contains('label', 'Manage bounties').prev('input[type="checkbox"]').should('be.checked');
cy.wait(1000);

cy.contains('label', 'Fund organization').prev('input[type="checkbox"]').should('be.checked');
cy.wait(1000);

cy.contains('label', 'Withdraw from organization')
.prev('input[type="checkbox"]')
.should('be.checked');
cy.wait(1000);

cy.contains('label', 'View transaction history')
.prev('input[type="checkbox"]')
.should('be.checked');
cy.wait(1000);

cy.contains('Update roles').click();
cy.wait(1000);

cy.wait(1000);
cy.logout(org.loggedInAs);
});
});

0 comments on commit 4ad6121

Please sign in to comment.