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 epochTimeout = Cypress.env('epochTimeout');
|
||||||
const proposalTimeout = { timeout: 14000 };
|
const proposalTimeout = { timeout: 14000 };
|
||||||
const restConnectorForm = '[data-testid="rest-connector-form"]';
|
const restConnectorForm = '[data-testid="rest-connector-form"]';
|
||||||
|
const noOpenProposals = '[data-testid="no-open-proposals"]';
|
||||||
|
const noClosedProposals = '[data-testid="no-closed-proposals"]';
|
||||||
|
|
||||||
const governanceProposalType = {
|
const governanceProposalType = {
|
||||||
NETWORK_PARAMETER: 'Network parameter',
|
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 () {
|
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.go_to_make_new_proposal(governanceProposalType.NEW_MARKET);
|
||||||
cy.contains(
|
cy.contains(
|
||||||
@ -147,7 +159,10 @@ context(
|
|||||||
).should('be.visible');
|
).should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to submit a valid freeform proposal - with minimum required tokens associated', function () {
|
it(
|
||||||
|
'Able to submit a valid freeform proposal - with minimum required tokens associated',
|
||||||
|
{ tags: '@smoke' },
|
||||||
|
function () {
|
||||||
cy.ensure_specified_unstaked_tokens_are_associated(
|
cy.ensure_specified_unstaked_tokens_are_associated(
|
||||||
this.minProposerBalance
|
this.minProposerBalance
|
||||||
);
|
);
|
||||||
@ -161,9 +176,12 @@ context(
|
|||||||
cy.contains('Awaiting network confirmation', epochTimeout).should(
|
cy.contains('Awaiting network confirmation', epochTimeout).should(
|
||||||
'be.visible'
|
'be.visible'
|
||||||
);
|
);
|
||||||
cy.contains('Proposal submitted', proposalTimeout).should('be.visible');
|
cy.contains('Proposal submitted', proposalTimeout).should(
|
||||||
|
'be.visible'
|
||||||
|
);
|
||||||
cy.get(dialogCloseButton).click();
|
cy.get(dialogCloseButton).click();
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it('Able to submit a valid freeform proposal - with minimum required tokens associated - but also staked', function () {
|
it('Able to submit a valid freeform proposal - with minimum required tokens associated - but also staked', function () {
|
||||||
cy.ensure_specified_unstaked_tokens_are_associated(
|
cy.ensure_specified_unstaked_tokens_are_associated(
|
||||||
|
@ -54,7 +54,10 @@ context(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
it('Able to stake against a validator - using vega from wallet', function () {
|
it(
|
||||||
|
'Able to stake against a validator - using vega from wallet',
|
||||||
|
{ tags: '@smoke' },
|
||||||
|
function () {
|
||||||
cy.staking_page_associate_tokens('3');
|
cy.staking_page_associate_tokens('3');
|
||||||
|
|
||||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
cy.get(vegaWalletUnstakedBalance, txTimeout).should(
|
||||||
@ -107,7 +110,8 @@ context(
|
|||||||
'2.00',
|
'2.00',
|
||||||
'100%'
|
'100%'
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it('Able to stake against a validator - using vega from vesting contract', function () {
|
it('Able to stake against a validator - using vega from vesting contract', function () {
|
||||||
cy.staking_page_associate_tokens('3', { type: 'contract' });
|
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 proposalDocumentationLink = '[data-testid="external-link"]';
|
||||||
const newProposalButton = '[data-testid="new-proposal-link"]';
|
const newProposalButton = '[data-testid="new-proposal-link"]';
|
||||||
const newProposalLink = '[data-testid="new-proposal-link"]';
|
const newProposalLink = '[data-testid="new-proposal-link"]';
|
||||||
@ -53,16 +51,6 @@ context(
|
|||||||
.and('equal', '/governance/propose');
|
.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
|
// 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.
|
// 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.
|
// Keeping this test here for now as it can be repurposed to test the new proposal forms.
|
||||||
|
@ -14,15 +14,12 @@ const stakeNumberRegex = /^\d*\.?\d*$/;
|
|||||||
const ownStake = '[data-testid="own-stake"]';
|
const ownStake = '[data-testid="own-stake"]';
|
||||||
const nominatedStake = '[data-testid="nominated-stake"]';
|
const nominatedStake = '[data-testid="nominated-stake"]';
|
||||||
|
|
||||||
context(
|
context('Staking Page - verify elements on page', function () {
|
||||||
'Staking Page - verify elements on page',
|
|
||||||
{ tags: '@smoke' },
|
|
||||||
function () {
|
|
||||||
before('navigate to staking page', function () {
|
before('navigate to staking page', function () {
|
||||||
cy.visit('/').navigate_to('staking');
|
cy.visit('/').navigate_to('staking');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with wallets disconnected', function () {
|
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
||||||
describe('description section', function () {
|
describe('description section', function () {
|
||||||
it('should have staking tab highlighted', function () {
|
it('should have staking tab highlighted', function () {
|
||||||
cy.verify_tab_highlighted('staking');
|
cy.verify_tab_highlighted('staking');
|
||||||
@ -44,8 +41,12 @@ context(
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('Should be able to see validator list from the staking page', function () {
|
describe(
|
||||||
|
'Should be able to see validator list from the staking page',
|
||||||
|
{ tags: '@regression' },
|
||||||
|
function () {
|
||||||
// 2001-STKE-050
|
// 2001-STKE-050
|
||||||
it('Should be able to see validator names', function () {
|
it('Should be able to see validator names', function () {
|
||||||
cy.get('[col-id="validator"]')
|
cy.get('[col-id="validator"]')
|
||||||
@ -123,11 +124,14 @@ context(
|
|||||||
cy.wrap($votingPower).should('not.be.empty');
|
cy.wrap($votingPower).should('not.be.empty');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
// 2001-STKE-050
|
// 2001-STKE-050
|
||||||
describe('Should be able to see static information about a validator', function () {
|
describe(
|
||||||
|
'Should be able to see static information about a validator',
|
||||||
|
{ tags: '@smoke' },
|
||||||
|
function () {
|
||||||
before('connect wallets and click on validator', function () {
|
before('connect wallets and click on validator', function () {
|
||||||
cy.vega_wallet_import();
|
cy.vega_wallet_import();
|
||||||
cy.vega_wallet_connect();
|
cy.vega_wallet_connect();
|
||||||
@ -210,6 +214,6 @@ context(
|
|||||||
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
@ -29,7 +29,7 @@ const txTimeout = Cypress.env('txTimeout');
|
|||||||
|
|
||||||
context(
|
context(
|
||||||
'Vega Wallet - verify elements on widget',
|
'Vega Wallet - verify elements on widget',
|
||||||
{ tags: '@smoke' },
|
{ tags: '@regression' },
|
||||||
function () {
|
function () {
|
||||||
before('visit token home page', function () {
|
before('visit token home page', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
@ -145,7 +145,13 @@ context(
|
|||||||
describe('when vega wallet connected', function () {
|
describe('when vega wallet connected', function () {
|
||||||
before('connect vega wallet', function () {
|
before('connect vega wallet', function () {
|
||||||
cy.vega_wallet_import();
|
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
|
// 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
|
// then code below can be removed
|
||||||
cy.get(restConnectorForm).within(() => {
|
cy.get(restConnectorForm).within(() => {
|
||||||
@ -165,13 +171,17 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have truncated account number visible', function () {
|
it(
|
||||||
|
'should have truncated account number visible',
|
||||||
|
{ tags: '@smoke' },
|
||||||
|
function () {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
cy.get(accountNo)
|
cy.get(accountNo)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
.and('have.text', Cypress.env('vegaWalletPublicKeyShort'));
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
it.skip('should have wallet name visible', function () {
|
it.skip('should have wallet name visible', function () {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
@ -189,15 +199,19 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have Vega Associated currency value visible', function () {
|
it(
|
||||||
|
'should have Vega Associated currency value visible',
|
||||||
|
{ tags: '@smoke' },
|
||||||
|
function () {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
cy.get(currencyValue)
|
cy.get(currencyValue)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', `0.000000000000000000`);
|
.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(walletContainer).within(() => {
|
||||||
cy.get(vegaUnstaked)
|
cy.get(vegaUnstaked)
|
||||||
.should('be.visible')
|
.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) => {
|
Cypress.Commands.add('go_to_make_new_proposal', (proposalType) => {
|
||||||
cy.get(newProposalButton).should('be.visible').click();
|
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