test: tweaks
This commit is contained in:
parent
056edfe132
commit
cda6caccec
@ -11,53 +11,68 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
cy.get(navigation.section, { timeout: 20000 }).should('be.visible');
|
cy.get(navigation.section, { timeout: 20000 }).should('be.visible');
|
||||||
cy.vega_wallet_connect();
|
cy.vega_wallet_connect();
|
||||||
cy.vega_wallet_set_specified_approval_amount_and_reload('1000');
|
cy.vega_wallet_set_specified_approval_amount_and_reload('1000');
|
||||||
cy.get(navigation.section, { timeout: 20000 }).should('be.visible');
|
cy.get(navigation.section, { timeout: 20000 }).should('be.visible');
|
||||||
cy.ethereum_wallet_connect();
|
cy.ethereum_wallet_connect();
|
||||||
cy.get(navigation.staking).first().click();
|
cy.get(navigation.staking).first().click();
|
||||||
cy.get(navigation.spinner, { timeout: 20000 }).should('not.exist');
|
cy.get(navigation.spinner, { timeout: 20000 }).should('not.exist');
|
||||||
cy.get(staking.validatorNames).first().invoke('text').as('validatorName');
|
cy.get(staking.validatorNames).first().invoke('text').as('validatorName');
|
||||||
cy.wrap(Cypress.env('vega_wallet_public_key_short')).as('vegaPublicKeyShort');
|
cy.wrap(Cypress.env('vega_wallet_public_key_short')).as(
|
||||||
|
'vegaPublicKeyShort'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Vega wallet - contains VEGA tokens', function () {
|
describe('Vega wallet - contains VEGA tokens', function () {
|
||||||
|
beforeEach(
|
||||||
|
'teardown wallet & drill into a specific validator',
|
||||||
|
function () {
|
||||||
|
cy.vega_wallet_teardown();
|
||||||
|
cy.get(navigation.staking).first().click();
|
||||||
|
cy.get(navigation.spinner, { timeout: 20000 }).should('not.exist');
|
||||||
|
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
||||||
|
cy.contains('Your Stake On Node (This Epoch)').should('be.visible');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
beforeEach('teardown wallet & drill into a specific validator', function () {
|
|
||||||
cy.vega_wallet_teardown();
|
|
||||||
cy.get(navigation.staking).first().click();
|
|
||||||
cy.get(navigation.spinner, { timeout: 20000 }).should('not.exist');
|
|
||||||
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
|
||||||
cy.contains('Your Stake On Node (This Epoch)').should('be.visible');
|
|
||||||
})
|
|
||||||
|
|
||||||
it('Able to associate tokens', function () {
|
it('Able to associate tokens', function () {
|
||||||
cy.ethereum_wallet_associate_tokens('2');
|
cy.ethereum_wallet_associate_tokens('2');
|
||||||
cy.ethereum_wallet_check_associated_vega_key_value_is(this.vegaPublicKeyShort, '2.000000000000000000');
|
cy.ethereum_wallet_check_associated_vega_key_value_is(
|
||||||
|
this.vegaPublicKeyShort,
|
||||||
|
'2.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Able to associate more tokens than the approved amount of 1000 - requires re-approval', function () {
|
it('Able to associate more tokens than the approved amount of 1000 - requires re-approval', function () {
|
||||||
cy.ethereum_wallet_associate_tokens('1001', 'Approve');
|
cy.ethereum_wallet_associate_tokens('1001', 'Approve');
|
||||||
cy.ethereum_wallet_check_associated_vega_key_value_is(this.vegaPublicKeyShort, '1,001.000000000000000000');
|
cy.ethereum_wallet_check_associated_vega_key_value_is(
|
||||||
|
this.vegaPublicKeyShort,
|
||||||
|
'1,001.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_associated_value_is('1,001.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('1,001.000000000000000000');
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Able to disassociate a partial amount of tokens currently associated', function () {
|
it('Able to disassociate a partial amount of tokens currently associated', function () {
|
||||||
cy.ethereum_wallet_associate_tokens('2');
|
cy.ethereum_wallet_associate_tokens('2');
|
||||||
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
||||||
|
|
||||||
cy.ethereum_wallet_disassociate_tokens('1');
|
cy.ethereum_wallet_disassociate_tokens('1');
|
||||||
cy.ethereum_wallet_check_associated_vega_key_value_is(this.vegaPublicKeyShort, '1.000000000000000000');
|
cy.ethereum_wallet_check_associated_vega_key_value_is(
|
||||||
|
this.vegaPublicKeyShort,
|
||||||
|
'1.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_associated_value_is('1.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('1.000000000000000000');
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Able to disassociate all tokens', function () {
|
it('Able to disassociate all tokens', function () {
|
||||||
cy.ethereum_wallet_associate_tokens('2');
|
cy.ethereum_wallet_associate_tokens('2');
|
||||||
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('2.000000000000000000');
|
||||||
|
|
||||||
cy.ethereum_wallet_disassociate_all_tokens();
|
cy.ethereum_wallet_disassociate_all_tokens();
|
||||||
cy.ethereum_wallet_check_associated_vega_key_is_no_longer_showing(this.vegaPublicKeyShort);
|
cy.ethereum_wallet_check_associated_vega_key_is_no_longer_showing(
|
||||||
|
this.vegaPublicKeyShort
|
||||||
|
);
|
||||||
cy.vega_wallet_check_associated_value_is('0.000000000000000000');
|
cy.vega_wallet_check_associated_value_is('0.000000000000000000');
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Able to stake against a validator', function () {
|
it('Able to stake against a validator', function () {
|
||||||
cy.ethereum_wallet_associate_tokens('3');
|
cy.ethereum_wallet_associate_tokens('3');
|
||||||
@ -67,7 +82,10 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
||||||
|
|
||||||
cy.staking_validator_page_add_stake('2');
|
cy.staking_validator_page_add_stake('2');
|
||||||
cy.vega_wallet_check_validator_stake_next_epoch_value_is(this.validatorName, '2.000000000000000000');
|
cy.vega_wallet_check_validator_stake_next_epoch_value_is(
|
||||||
|
this.validatorName,
|
||||||
|
'2.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -80,15 +98,21 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
|
|
||||||
cy.staking_validator_page_add_stake('1');
|
cy.staking_validator_page_add_stake('1');
|
||||||
cy.staking_validator_page_check_stake_next_epoch_value('1.0');
|
cy.staking_validator_page_check_stake_next_epoch_value('1.0');
|
||||||
cy.vega_wallet_check_validator_stake_next_epoch_value_is(this.validatorName, '1.000000000000000000');
|
cy.vega_wallet_check_validator_stake_next_epoch_value_is(
|
||||||
|
this.validatorName,
|
||||||
|
'1.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_unstaked_value_is('2.000000000000000000');
|
cy.vega_wallet_check_unstaked_value_is('2.000000000000000000');
|
||||||
|
|
||||||
cy.get(navigation.staking).first().click();
|
cy.get(navigation.staking).first().click();
|
||||||
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
||||||
|
|
||||||
cy.staking_validator_page_removeStake('1');
|
cy.staking_validator_page_removeStake('1');
|
||||||
cy.staking_validator_page_check_stake_next_epoch_value('0.0');
|
cy.staking_validator_page_check_stake_next_epoch_value('0.0');
|
||||||
cy.vega_wallet_check_validator_stake_next_epoch_value_is(this.validatorName, '0.000000000000000000');
|
cy.vega_wallet_check_validator_stake_next_epoch_value_is(
|
||||||
|
this.validatorName,
|
||||||
|
'0.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_unstaked_value_is('3.000000000000000000');
|
cy.vega_wallet_check_unstaked_value_is('3.000000000000000000');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,12 +122,15 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
|
|
||||||
cy.get('button').contains('Select a validator to nominate').click();
|
cy.get('button').contains('Select a validator to nominate').click();
|
||||||
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
||||||
|
|
||||||
cy.staking_validator_page_add_stake('2');
|
cy.staking_validator_page_add_stake('2');
|
||||||
cy.staking_validator_page_check_stake_next_epoch_value('2.0');
|
cy.staking_validator_page_check_stake_next_epoch_value('2.0');
|
||||||
cy.vega_wallet_check_validator_stake_next_epoch_value_is(this.validatorName, '2.000000000000000000');
|
cy.vega_wallet_check_validator_stake_next_epoch_value_is(
|
||||||
|
this.validatorName,
|
||||||
|
'2.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
||||||
|
|
||||||
cy.get(navigation.staking).first().click();
|
cy.get(navigation.staking).first().click();
|
||||||
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
cy.get(staking.validatorNames).contains(this.validatorName).click();
|
||||||
cy.get(staking.removeStakeRadioButton).click({ force: true });
|
cy.get(staking.removeStakeRadioButton).click({ force: true });
|
||||||
@ -124,7 +151,10 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
|
|
||||||
cy.staking_validator_page_add_stake('2');
|
cy.staking_validator_page_add_stake('2');
|
||||||
cy.staking_validator_page_check_stake_next_epoch_value('2.0');
|
cy.staking_validator_page_check_stake_next_epoch_value('2.0');
|
||||||
cy.vega_wallet_check_validator_stake_next_epoch_value_is(this.validatorName, '2.000000000000000000');
|
cy.vega_wallet_check_validator_stake_next_epoch_value_is(
|
||||||
|
this.validatorName,
|
||||||
|
'2.000000000000000000'
|
||||||
|
);
|
||||||
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
cy.vega_wallet_check_unstaked_value_is('1.000000000000000000');
|
||||||
|
|
||||||
cy.get(navigation.staking).first().click();
|
cy.get(navigation.staking).first().click();
|
||||||
@ -134,8 +164,8 @@ context('Staking Tab - with vega wallet connected', function () {
|
|||||||
cy.contains('Waiting for next epoch to start', { timeout: 10000 });
|
cy.contains('Waiting for next epoch to start', { timeout: 10000 });
|
||||||
cy.get(staking.tokenInputSubmit)
|
cy.get(staking.tokenInputSubmit)
|
||||||
.should('be.disabled', { timeout: 8000 })
|
.should('be.disabled', { timeout: 8000 })
|
||||||
.and('contain',`Remove 4 $VEGA tokens at the end of epoch`)
|
.and('contain', `Remove 4 $VEGA tokens at the end of epoch`)
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,6 @@ import '@vegaprotocol/cypress';
|
|||||||
|
|
||||||
// Hide fetch/XHR requests - They create a lot of noise in command log
|
// Hide fetch/XHR requests - They create a lot of noise in command log
|
||||||
const app = window.top;
|
const app = window.top;
|
||||||
|
|
||||||
if (!app.document.head.querySelector('[data-hide-command-log-request]')) {
|
if (!app.document.head.querySelector('[data-hide-command-log-request]')) {
|
||||||
const style = app.document.createElement('style');
|
const style = app.document.createElement('style');
|
||||||
style.innerHTML =
|
style.innerHTML =
|
||||||
|
Loading…
Reference in New Issue
Block a user