Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky tests - Closes #1455 #1458

Merged
merged 3 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"cpx": "=1.5.0",
"css-hot-loader": "=1.3.1",
"css-loader": "0.28.7",
"cypress": "3.1.0",
"cypress": "3.1.1",
"del-cli": "1.1.0",
"electron": "1.8.8",
"electron-builder": "19.32.2",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/regex.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
address: /^\d{1,21}[L]$/,
transactionId: /^[0-9]+$/,
address: /^[1-9]\d{0,19}L$/,
transactionId: /^[1-9]\d{0,19}$/,
amount: /^\d+(\.\d{1,8})?$/,
};
2 changes: 1 addition & 1 deletion test/cypress/e2e/activity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ss = {
/**
* To remove the effect of activating the All tab back after full load
*/
const waitBeforeChangeTabAfterLoading = () => cy.wait(1500); // TODO Update when #1400 is done
const waitBeforeChangeTabAfterLoading = () => cy.wait(2000); // TODO Update when #1400 is done

describe('Dashboard Activity', () => {
describe('Latest activity', () => {
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions test/cypress/e2e/delegates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ describe('Delegates', () => {
cy.addLocalStorage('settings', 'advancedMode', true);
cy.autologin(accounts.genesis.passphrase, networks.devnet.node);
cy.visit(urls.dashboard);
cy.wait(200); // Wait for wallet sidebar button to appear
cy.get(ss.sidebarMenuDelegatesBtn).click();
cy.get(ss.sidebarMenuDelegatesBtn).should('have.css', 'opacity', '1').click();
cy.url().should('contain', urls.delegates);
cy.get(ss.confirmVotesSidebar).find(ss.nextButton);
});
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/help.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Help', () => {
it('opens by sidebar button', () => {
cy.autologin(accounts.genesis.passphrase, networks.devnet.node);
cy.visit('/');
cy.get(ss.sidebarMenuHelpBtn).click();
cy.get(ss.sidebarMenuHelpBtn).should('have.css', 'opacity', '1').click();
cy.url().should('contain', 'help');
checkHelpPageLoaded();
});
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Settings', () => {

it('opens by sidebar button', () => {
cy.visit('/');
cy.get(ss.sidebarMenuSettingsBtn).click();
cy.get(ss.sidebarMenuSettingsBtn).should('have.css', 'opacity', '1').click();
cy.url().should('contain', 'setting');
checkSettingsPageLoaded();
});
Expand Down
3 changes: 1 addition & 2 deletions test/cypress/e2e/transfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ describe('Transfer', () => {
it('Wallet page opens by sidebar button', () => {
cy.autologin(accounts.genesis.passphrase, networks.devnet.node);
cy.visit(urls.dashboard);
cy.wait(100);
cy.get(ss.sidebarMenuWalletBtn).click();
cy.get(ss.sidebarMenuWalletBtn).should('have.css', 'opacity', '1').click();
cy.url().should('contain', 'wallet');
checkWalletPageLoaded();
});
Expand Down
9 changes: 5 additions & 4 deletions test/cypress/e2e/txDetails.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import accounts from '../../constants/accounts';
import networks from '../../constants/networks';
import urls from '../../constants/urls';
import regex from '../../../src/utils/regex';

const ss = {
nextBtn: '.send-next-button',
Expand Down Expand Up @@ -44,7 +45,7 @@ describe('Tx details', () => {
cy.get(ss.txAmount).should('have.text', '-5');
cy.get(ss.txFee).should('have.text', '0.1');
cy.get(ss.txConfirmations).should('have.text', '');
cy.get(ss.txId).contains(/^\d{19}/);
cy.get(ss.txId).contains(regex.transactionId);
cy.get(ss.txReference).should('have.text', 'test-details');
// After confirmation
cy.get(ss.txDate, { timeout: txConfirmationTimeout }).contains(new Date().getFullYear());
Expand All @@ -62,7 +63,7 @@ describe('Tx details', () => {
cy.get(ss.txRemovedVotes).should('not.exist');
cy.get(ss.txFee).should('have.text', '1');
cy.get(ss.txConfirmations).contains(/^\d/);
cy.get(ss.txId).contains(/^\d{19}/);
cy.get(ss.txId).contains(regex.transactionId);
cy.get(ss.txReference).should('have.text', '-');
});

Expand All @@ -80,7 +81,7 @@ describe('Tx details', () => {
cy.get(ss.txRemovedVotes).should('not.exist');
// cy.get(ss.txFee).should('have.text', '25');
cy.get(ss.txConfirmations).contains(/^\d/);
cy.get(ss.txId).contains(/^\d{19}/);
cy.get(ss.txId).contains(regex.transactionId);
cy.get(ss.txReference).should('have.text', '-');
});

Expand All @@ -95,7 +96,7 @@ describe('Tx details', () => {
cy.get(ss.txRemovedVotes).should('not.exist');
cy.get(ss.txFee).should('have.text', '5');
cy.get(ss.txConfirmations).contains(/^\d/);
cy.get(ss.txId).contains(/^\d{19}/);
cy.get(ss.txId).contains(regex.transactionId);
cy.get(ss.txReference).should('have.text', '-');
});
});