Skip to content

Commit

Permalink
Merge pull request #1547 from LiskHQ/1546-migrate-delegate-reg
Browse files Browse the repository at this point in the history
Migrate register delegate test to cypress - Closes #1546
  • Loading branch information
Andrei Klimenok authored Dec 10, 2018
2 parents be37bf5 + 26e151c commit dbce8eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/cypress/e2e/delegateReg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,39 @@ describe('Delegate Registration', () => {

/**
* Try to register already existing delegate name
* @expect next button is disabled
* @expect error message
*/
it('Try to register already existing delegate name', () => {
cy.autologin(accounts.genesis.passphrase, networks.devnet.node);
cy.visit(urls.registerDelegate);
cy.get(ss.chooseDelegateName).click();
cy.get(ss.delegateNameInput).click().type('genesis_51');
cy.get(ss.submitDelagateNameBtn).should('be.disabled');
cy.get(ss.delegateDuplicateNameError).should('have.text', 'Name is already taken!');
});

/**
* Try to register with insufficient balance
* @expect choose name button is disabled
* @expect error message
*/
it('Try to register with insufficient balance', () => {
cy.autologin(accounts['empty account'].passphrase, networks.devnet.node);
cy.visit(urls.registerDelegate);
cy.get(ss.chooseDelegateName).should('be.disabled');
cy.get(ss.chooseDelegateName).parent().contains('Insufficient funds');
});

/**
* Try to register being already a delegate
* @expect choose name button is disabled
* @expect error message
*/
it('Try to register being already a delegate', () => {
cy.autologin(accounts.delegate.passphrase, networks.devnet.node);
cy.visit(urls.registerDelegate);
cy.get(ss.chooseDelegateName).should('be.disabled');
cy.get(ss.chooseDelegateName).parent().contains('You have already registered as a delegate.');
});
});
1 change: 1 addition & 0 deletions test/integration/registerDelegate.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// TODO: delete file after coverage is fulfilled
import { step } from 'mocha-steps';
import { mount } from 'enzyme';
import sinon from 'sinon';
Expand Down

0 comments on commit dbce8eb

Please sign in to comment.