Test/1484 update token smoke tests (#1571)
* test: added smoke tests from flows * chore: move failing test
This commit is contained in:
parent
620bf1bab4
commit
ae8ef6001c
@ -36,6 +36,8 @@ const txTimeout = Cypress.env('txTimeout');
|
||||
const epochTimeout = Cypress.env('epochTimeout');
|
||||
const proposalTimeout = { timeout: 14000 };
|
||||
const restConnectorForm = '[data-testid="rest-connector-form"]';
|
||||
const noOpenProposals = '[data-testid="no-open-proposals"]';
|
||||
const noClosedProposals = '[data-testid="no-closed-proposals"]';
|
||||
|
||||
const governanceProposalType = {
|
||||
NETWORK_PARAMETER: 'Network parameter',
|
||||
@ -140,6 +142,16 @@ context(
|
||||
});
|
||||
});
|
||||
|
||||
it('should be able to see that no proposals exist', function () {
|
||||
// 1004-VOTE-003
|
||||
cy.get(noOpenProposals)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'There are no open or yet to enact proposals');
|
||||
cy.get(noClosedProposals)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'There are no enacted or rejected proposals');
|
||||
});
|
||||
|
||||
it('Submit a proposal form - shows how many vega tokens are required to make a proposal', function () {
|
||||
cy.go_to_make_new_proposal(governanceProposalType.NEW_MARKET);
|
||||
cy.contains(
|
||||
@ -147,23 +159,29 @@ context(
|
||||
).should('be.visible');
|
||||
});
|
||||
|
||||
it('Able to submit a valid freeform proposal - with minimum required tokens associated', function () {
|
||||
cy.ensure_specified_unstaked_tokens_are_associated(
|
||||
this.minProposerBalance
|
||||
);
|
||||
cy.navigate_to_page_if_not_already_loaded('governance');
|
||||
cy.go_to_make_new_proposal(governanceProposalType.FREEFORM);
|
||||
cy.enter_unique_freeform_proposal_body('50');
|
||||
cy.get(newProposalSubmitButton).should('be.visible').click();
|
||||
cy.contains('Confirm transaction in wallet', epochTimeout).should(
|
||||
'be.visible'
|
||||
);
|
||||
cy.contains('Awaiting network confirmation', epochTimeout).should(
|
||||
'be.visible'
|
||||
);
|
||||
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
|
||||
cy.get(dialogCloseButton).click();
|
||||
});
|
||||
it(
|
||||
'Able to submit a valid freeform proposal - with minimum required tokens associated',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
cy.ensure_specified_unstaked_tokens_are_associated(
|
||||
this.minProposerBalance
|
||||
);
|
||||
cy.navigate_to_page_if_not_already_loaded('governance');
|
||||
cy.go_to_make_new_proposal(governanceProposalType.FREEFORM);
|
||||
cy.enter_unique_freeform_proposal_body('50');
|
||||
cy.get(newProposalSubmitButton).should('be.visible').click();
|
||||
cy.contains('Confirm transaction in wallet', epochTimeout).should(
|
||||
'be.visible'
|
||||
);
|
||||
cy.contains('Awaiting network confirmation', epochTimeout).should(
|
||||
'be.visible'
|
||||
);
|
||||
cy.contains('Proposal submitted', proposalTimeout).should(
|
||||
'be.visible'
|
||||
);
|
||||
cy.get(dialogCloseButton).click();
|
||||
}
|
||||
);
|
||||
|
||||
it('Able to submit a valid freeform proposal - with minimum required tokens associated - but also staked', function () {
|
||||
cy.ensure_specified_unstaked_tokens_are_associated(
|
||||
|
@ -54,60 +54,64 @@ context(
|
||||
}
|
||||
);
|
||||
|
||||
it('Able to stake against a validator - using vega from wallet', function () {
|
||||
cy.staking_page_associate_tokens('3');
|
||||
it(
|
||||
'Able to stake against a validator - using vega from wallet',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
cy.staking_page_associate_tokens('3');
|
||||
|
||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
||||
'contain',
|
||||
3.0,
|
||||
txTimeout
|
||||
);
|
||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
||||
'contain',
|
||||
3.0,
|
||||
txTimeout
|
||||
);
|
||||
|
||||
cy.get(ethWalletTotalAssociatedBalance, txTimeout)
|
||||
.contains('3.0', txTimeout)
|
||||
.should('be.visible');
|
||||
cy.get(ethWalletTotalAssociatedBalance, txTimeout)
|
||||
.contains('3.0', txTimeout)
|
||||
.should('be.visible');
|
||||
|
||||
cy.get(ethWalletAssociatedBalances, txTimeout)
|
||||
.contains(vegaWalletPublicKeyShort, txTimeout)
|
||||
.parent()
|
||||
.should('contain', 3.0, txTimeout);
|
||||
cy.get(ethWalletAssociatedBalances, txTimeout)
|
||||
.contains(vegaWalletPublicKeyShort, txTimeout)
|
||||
.parent()
|
||||
.should('contain', 3.0, txTimeout);
|
||||
|
||||
cy.get('button').contains('Select a validator to nominate').click();
|
||||
cy.get('button').contains('Select a validator to nominate').click();
|
||||
|
||||
// 2001-STKE-031
|
||||
cy.click_on_validator_from_list(0);
|
||||
// 2001-STKE-031
|
||||
cy.click_on_validator_from_list(0);
|
||||
|
||||
// 2001-STKE-033, 2001-STKE-034, 2001-STKE-037
|
||||
cy.staking_validator_page_add_stake('2');
|
||||
// 2001-STKE-033, 2001-STKE-034, 2001-STKE-037
|
||||
cy.staking_validator_page_add_stake('2');
|
||||
|
||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
||||
'contain',
|
||||
1.0,
|
||||
txTimeout
|
||||
);
|
||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
||||
'contain',
|
||||
1.0,
|
||||
txTimeout
|
||||
);
|
||||
|
||||
// 2001-STKE-039
|
||||
cy.get(vegaWalletStakedBalances, txTimeout)
|
||||
.should('contain', 2.0, txTimeout)
|
||||
.and('contain', partValidatorId);
|
||||
// 2001-STKE-039
|
||||
cy.get(vegaWalletStakedBalances, txTimeout)
|
||||
.should('contain', 2.0, txTimeout)
|
||||
.and('contain', partValidatorId);
|
||||
|
||||
cy.get(stakeNextEpochValue, epochTimeout) // 2001-STKE-016
|
||||
.contains(2.0, epochTimeout)
|
||||
.should('be.visible');
|
||||
cy.get(stakeNextEpochValue, epochTimeout) // 2001-STKE-016
|
||||
.contains(2.0, epochTimeout)
|
||||
.should('be.visible');
|
||||
|
||||
cy.get(stakeThisEpochValue, epochTimeout) // 2001-STKE-013
|
||||
.contains(2.0, epochTimeout)
|
||||
.should('be.visible');
|
||||
cy.get(stakeThisEpochValue, epochTimeout) // 2001-STKE-013
|
||||
.contains(2.0, epochTimeout)
|
||||
.should('be.visible');
|
||||
|
||||
cy.navigate_to('staking');
|
||||
cy.navigate_to('staking');
|
||||
|
||||
cy.validate_validator_list_total_stake_and_share(
|
||||
'0',
|
||||
'',
|
||||
'2.00',
|
||||
'100%'
|
||||
);
|
||||
});
|
||||
cy.validate_validator_list_total_stake_and_share(
|
||||
'0',
|
||||
'',
|
||||
'2.00',
|
||||
'100%'
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('Able to stake against a validator - using vega from vesting contract', function () {
|
||||
cy.staking_page_associate_tokens('3', { type: 'contract' });
|
||||
|
@ -1,5 +1,3 @@
|
||||
const noOpenProposals = '[data-testid="no-open-proposals"]';
|
||||
const noClosedProposals = '[data-testid="no-closed-proposals"]';
|
||||
const proposalDocumentationLink = '[data-testid="external-link"]';
|
||||
const newProposalButton = '[data-testid="new-proposal-link"]';
|
||||
const newProposalLink = '[data-testid="new-proposal-link"]';
|
||||
@ -53,16 +51,6 @@ context(
|
||||
.and('equal', '/governance/propose');
|
||||
});
|
||||
|
||||
it('should be able to see that no proposals exist', function () {
|
||||
// 1004-VOTE-003
|
||||
cy.get(noOpenProposals)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'There are no open or yet to enact proposals');
|
||||
cy.get(noClosedProposals)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'There are no enacted or rejected proposals');
|
||||
});
|
||||
|
||||
// Skipping this test for now, the new proposal button no longer takes a user directly
|
||||
// to a proposal form, instead it takes them to a page where they can select a proposal type.
|
||||
// Keeping this test here for now as it can be repurposed to test the new proposal forms.
|
||||
|
@ -14,120 +14,124 @@ const stakeNumberRegex = /^\d*\.?\d*$/;
|
||||
const ownStake = '[data-testid="own-stake"]';
|
||||
const nominatedStake = '[data-testid="nominated-stake"]';
|
||||
|
||||
context(
|
||||
'Staking Page - verify elements on page',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
before('navigate to staking page', function () {
|
||||
cy.visit('/').navigate_to('staking');
|
||||
});
|
||||
context('Staking Page - verify elements on page', function () {
|
||||
before('navigate to staking page', function () {
|
||||
cy.visit('/').navigate_to('staking');
|
||||
});
|
||||
|
||||
describe('with wallets disconnected', function () {
|
||||
describe('description section', function () {
|
||||
it('should have staking tab highlighted', function () {
|
||||
cy.verify_tab_highlighted('staking');
|
||||
});
|
||||
|
||||
it('should have STAKING ON VEGA header visible', function () {
|
||||
cy.verify_page_header('Staking');
|
||||
});
|
||||
|
||||
it('should have Staking Guide link visible', function () {
|
||||
// 2001-STKE-003
|
||||
cy.get(guideLink)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'Read more about staking on Vega')
|
||||
.and(
|
||||
'have.attr',
|
||||
'href',
|
||||
'https://docs.vega.xyz/docs/mainnet/concepts/vega-chain/#staking-on-vega'
|
||||
);
|
||||
});
|
||||
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
||||
describe('description section', function () {
|
||||
it('should have staking tab highlighted', function () {
|
||||
cy.verify_tab_highlighted('staking');
|
||||
});
|
||||
|
||||
describe('Should be able to see validator list from the staking page', function () {
|
||||
// 2001-STKE-050
|
||||
it('Should be able to see validator names', function () {
|
||||
cy.get('[col-id="validator"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($name) => {
|
||||
cy.wrap($name).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
it('should have STAKING ON VEGA header visible', function () {
|
||||
cy.verify_page_header('Staking');
|
||||
});
|
||||
|
||||
it('Should be able to see validator status', function () {
|
||||
cy.get('[col-id="status"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($status) => {
|
||||
cy.wrap($status).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see total stake for this epoch', function () {
|
||||
cy.get('[col-id="totalStakeThisEpoch"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($totalStaked) => {
|
||||
cy.wrap($totalStaked).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see validator staked for this epoch', function () {
|
||||
cy.get('[col-id="validatorStake"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($validatorStake) => {
|
||||
cy.wrap($validatorStake).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see validator staked for next epoch', function () {
|
||||
cy.get('[col-id="pendingStake"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($pendingStake) => {
|
||||
cy.wrap($pendingStake).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-021
|
||||
it('Should be able to see validator ranking score', function () {
|
||||
cy.get('.ag-body-horizontal-scroll-viewport').scrollTo('right');
|
||||
cy.get('[col-id="rankingScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($rankingScore) => {
|
||||
cy.wrap($rankingScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-022
|
||||
it('Should be able to see validator stake score', function () {
|
||||
cy.get('[col-id="stakeScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($stakeScore) => {
|
||||
cy.wrap($stakeScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-023
|
||||
it('Should be able to see validator performance score', function () {
|
||||
cy.get('[col-id="performanceScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($performanceScore) => {
|
||||
cy.wrap($performanceScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-024
|
||||
it('Should be able to see validator voting power score', function () {
|
||||
cy.get('[col-id="votingPower"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($votingPower) => {
|
||||
cy.wrap($votingPower).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
it('should have Staking Guide link visible', function () {
|
||||
// 2001-STKE-003
|
||||
cy.get(guideLink)
|
||||
.should('be.visible')
|
||||
.and('have.text', 'Read more about staking on Vega')
|
||||
.and(
|
||||
'have.attr',
|
||||
'href',
|
||||
'https://docs.vega.xyz/docs/mainnet/concepts/vega-chain/#staking-on-vega'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-050
|
||||
describe('Should be able to see static information about a validator', function () {
|
||||
describe(
|
||||
'Should be able to see validator list from the staking page',
|
||||
{ tags: '@regression' },
|
||||
function () {
|
||||
// 2001-STKE-050
|
||||
it('Should be able to see validator names', function () {
|
||||
cy.get('[col-id="validator"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($name) => {
|
||||
cy.wrap($name).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see validator status', function () {
|
||||
cy.get('[col-id="status"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($status) => {
|
||||
cy.wrap($status).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see total stake for this epoch', function () {
|
||||
cy.get('[col-id="totalStakeThisEpoch"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($totalStaked) => {
|
||||
cy.wrap($totalStaked).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see validator staked for this epoch', function () {
|
||||
cy.get('[col-id="validatorStake"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($validatorStake) => {
|
||||
cy.wrap($validatorStake).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
it('Should be able to see validator staked for next epoch', function () {
|
||||
cy.get('[col-id="pendingStake"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($pendingStake) => {
|
||||
cy.wrap($pendingStake).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-021
|
||||
it('Should be able to see validator ranking score', function () {
|
||||
cy.get('.ag-body-horizontal-scroll-viewport').scrollTo('right');
|
||||
cy.get('[col-id="rankingScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($rankingScore) => {
|
||||
cy.wrap($rankingScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-022
|
||||
it('Should be able to see validator stake score', function () {
|
||||
cy.get('[col-id="stakeScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($stakeScore) => {
|
||||
cy.wrap($stakeScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-023
|
||||
it('Should be able to see validator performance score', function () {
|
||||
cy.get('[col-id="performanceScore"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($performanceScore) => {
|
||||
cy.wrap($performanceScore).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
|
||||
// 2001-STKE-024
|
||||
it('Should be able to see validator voting power score', function () {
|
||||
cy.get('[col-id="votingPower"]')
|
||||
.should('have.length.at.least', 1)
|
||||
.each(($votingPower) => {
|
||||
cy.wrap($votingPower).should('not.be.empty');
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
// 2001-STKE-050
|
||||
describe(
|
||||
'Should be able to see static information about a validator',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
before('connect wallets and click on validator', function () {
|
||||
cy.vega_wallet_import();
|
||||
cy.vega_wallet_connect();
|
||||
@ -210,6 +214,6 @@ context(
|
||||
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
@ -29,7 +29,7 @@ const txTimeout = Cypress.env('txTimeout');
|
||||
|
||||
context(
|
||||
'Vega Wallet - verify elements on widget',
|
||||
{ tags: '@smoke' },
|
||||
{ tags: '@regression' },
|
||||
function () {
|
||||
before('visit token home page', function () {
|
||||
cy.visit('/');
|
||||
@ -145,7 +145,13 @@ context(
|
||||
describe('when vega wallet connected', function () {
|
||||
before('connect vega wallet', function () {
|
||||
cy.vega_wallet_import();
|
||||
|
||||
cy.visit('/');
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(connectButton).click();
|
||||
});
|
||||
cy.get(connectorsList).within(() => {
|
||||
cy.get('button').click();
|
||||
});
|
||||
// cy.vega_wallet_connect(); - to be changed when dialog state is fixed - https://github.com/vegaprotocol/frontend-monorepo/issues/838
|
||||
// then code below can be removed
|
||||
cy.get(restConnectorForm).within(() => {
|
||||
@ -165,13 +171,17 @@ context(
|
||||
});
|
||||
});
|
||||
|
||||
it('should have truncated account number visible', function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(accountNo)
|
||||
.should('be.visible')
|
||||
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
||||
});
|
||||
});
|
||||
it(
|
||||
'should have truncated account number visible',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(accountNo)
|
||||
.should('be.visible')
|
||||
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
it.skip('should have wallet name visible', function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
@ -189,15 +199,19 @@ context(
|
||||
});
|
||||
});
|
||||
|
||||
it('should have Vega Associated currency value visible', function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(currencyValue)
|
||||
.should('be.visible')
|
||||
.and('have.text', `0.000000000000000000`);
|
||||
});
|
||||
});
|
||||
it(
|
||||
'should have Vega Associated currency value visible',
|
||||
{ tags: '@smoke' },
|
||||
function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(currencyValue)
|
||||
.should('be.visible')
|
||||
.and('have.text', `0.000000000000000000`);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
it('should have Unstaked value visible', function () {
|
||||
it('should have Unstaked value visible', { tags: '@smoke' }, function () {
|
||||
cy.get(walletContainer).within(() => {
|
||||
cy.get(vegaUnstaked)
|
||||
.should('be.visible')
|
||||
|
@ -166,5 +166,5 @@ Cypress.Commands.add('get_sort_order_of_supplied_array', (suppliedArray) => {
|
||||
|
||||
Cypress.Commands.add('go_to_make_new_proposal', (proposalType) => {
|
||||
cy.get(newProposalButton).should('be.visible').click();
|
||||
cy.get('a.underline').contains(proposalType).click();
|
||||
cy.get('li').contains(proposalType).click();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user