Skip to content

Commit

Permalink
feat(tests): Useless waits removed (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Jul 5, 2022
1 parent c2a462d commit 94d29d5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
16 changes: 4 additions & 12 deletions cypress/e2e/features/files.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ let dashboardSpecMnemonic = '';

describe('Create account for File tests', () => {
it('Connect', () => {
cy.intercept('/signup').as('getSignup');
cy.visit('/signup');
cy.wait('@getSignup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.get('#ipc-signup-text-area')
.invoke('val')
Expand All @@ -19,13 +17,11 @@ describe('Upload a file modal in Dashboard', () => {
const fixtureFile = 'upload_test_file.txt';

beforeEach(() => {
cy.intercept('/login').as('getLogin');
cy.visit('/login');
cy.wait('@getLogin');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click().wait(3000);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click().wait(2500);
cy.get('#ipc-upload-button').click();
});

it('Good number of buttons after upload', () => {
Expand All @@ -45,13 +41,11 @@ describe('Upload an empty file in Dashboard', () => {
const fixtureFile = 'upload_empty_file.txt';

beforeEach(() => {
cy.intercept('/login').as('getLogin');
cy.visit('/login');
cy.wait('@getLogin');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click().wait(3000);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click().wait(2500);
cy.get('#ipc-upload-button').click();
});

it('Good number of buttons after failed upload', () => {
Expand All @@ -67,9 +61,7 @@ describe('Download a file in Dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click();
cy.wait(2500);
cy.get('#ipc-dashboard-download-button').click();
cy.wait(3000);
});

it('Good content for downloaded file', () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/features/programs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ describe('Upload a program modal for Dashboard', () => {
beforeEach(() => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click().wait(3000);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click().wait(2500);
cy.get('#ipc-deploy-button').click();
});

it('Good number of buttons after upload', () => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/front/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Good Upload file modal front in Dashboard', () => {
it('Go to upload modal into dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click().wait(3000);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-upload-button').click();
});
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('Good Deploy program modal front in Dashboard', () => {
it('Go to upload modal into dashboard', () => {
cy.visit('/login');
cy.get('#ipc-login-text-area').click().type(dashboardSpecMnemonic);
cy.get('#ipc-login-credentials-button').click().wait(3000);
cy.get('#ipc-login-credentials-button').click();
cy.get('#ipc-dashboard-drawer-button').click({ force: true });
cy.get('#ipc-deploy-button').click();
});
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/signup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ describe('Signup with credentials Button for Signup', () => {
it('Go to signup', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.wait(1000);
cy.get('#ipc-signup-copy-mnemonics-button').click();
});

Expand All @@ -69,7 +68,6 @@ describe('Signup with credentials Button for Signup', () => {
});

it('Good URL redirect for close button', () => {
cy.wait(1000);
cy.get('#ipc-modal-close-button').click().url().should('eq', 'http://localhost:8080/dashboard');
});
});
Expand Down

0 comments on commit 94d29d5

Please sign in to comment.