diff --git a/apps/token-e2e/src/integration/flow/staking.test.js b/apps/token-e2e/src/integration/flow/staking.test.js index d762bb313..346d4314f 100644 --- a/apps/token-e2e/src/integration/flow/staking.test.js +++ b/apps/token-e2e/src/integration/flow/staking.test.js @@ -25,6 +25,7 @@ context('Staking Tab - with vega wallet connected', function () { beforeEach('drill into a specific validator', function () { cy.vega_wallet_teardown(); + // cy.vega_wallet_teardown_ui(); cy.get(navigation.staking).first().click(); cy.get(navigation.spinner, { timeout: 20000 }).should('not.exist'); cy.get(staking.validatorNames).contains(this.validatorName).click(); @@ -33,66 +34,66 @@ context('Staking Tab - with vega wallet connected', function () { it('Able to associate tokens for first time - requires approval', function () { cy.ethereum_wallet_approveAndAssociateTokens('2'); - cy.vega_wallet_check_associatedValue_is('2.0'); + cy.vega_wallet_check_associatedValue_is('2.000000000000000000'); }) it('Able to associate tokens - having previously approved', function () { cy.ethereum_wallet_associateTokens('2'); - cy.vega_wallet_check_associatedValue_is('2.0'); + cy.vega_wallet_check_associatedValue_is('2.000000000000000000'); }) it('Able to disassociate all tokens', function () { cy.ethereum_wallet_associateTokens('2'); - cy.vega_wallet_check_associatedValue_is('2.0'); + cy.vega_wallet_check_associatedValue_is('2.000000000000000000'); cy.ethereum_wallet_disassociateAllTokens(); - cy.vega_wallet_check_associatedValue_is('0.0'); + cy.vega_wallet_check_associatedValue_is('0.000000000000000000'); }) it('Able to stake against a validator', function () { cy.ethereum_wallet_associateTokens('3'); - cy.vega_wallet_check_unstakedValue_is('3.0'); + cy.vega_wallet_check_unstakedValue_is('3.000000000000000000'); cy.get('button').contains('Select a validator to nominate').click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); cy.staking_validator_page_addStake('2'); - cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.0'); - cy.vega_wallet_check_unstakedValue_is('1.0'); + cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.000000000000000000'); + cy.vega_wallet_check_unstakedValue_is('1.000000000000000000'); }); it('Able to remove stake against a validator', function () { cy.ethereum_wallet_associateTokens('3'); - cy.vega_wallet_check_unstakedValue_is('3.0'); + cy.vega_wallet_check_unstakedValue_is('3.000000000000000000'); cy.get('button').contains('Select a validator to nominate').click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); cy.staking_validator_page_addStake('1'); cy.staking_validator_page_check_stakeNextEpochValue('1.0'); - cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '1.0'); - cy.vega_wallet_check_unstakedValue_is('2.0'); + cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '1.000000000000000000'); + cy.vega_wallet_check_unstakedValue_is('2.000000000000000000'); cy.get(navigation.staking).first().click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); cy.staking_validator_page_removeStake('1'); cy.staking_validator_page_check_stakeNextEpochValue('0.0'); - cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '0.0'); - cy.vega_wallet_check_unstakedValue_is('3.0'); + cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '0.000000000000000000'); + cy.vega_wallet_check_unstakedValue_is('3.000000000000000000'); }); it('Unable to remove a stake with a negative value for a validator', function () { cy.ethereum_wallet_associateTokens('3'); - cy.vega_wallet_check_unstakedValue_is('3.0'); + cy.vega_wallet_check_unstakedValue_is('3.000000000000000000'); cy.get('button').contains('Select a validator to nominate').click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); cy.staking_validator_page_addStake('2'); cy.staking_validator_page_check_stakeNextEpochValue('2.0'); - cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.0'); - cy.vega_wallet_check_unstakedValue_is('1.0'); + cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.000000000000000000'); + cy.vega_wallet_check_unstakedValue_is('1.000000000000000000'); cy.get(navigation.staking).first().click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); @@ -107,15 +108,15 @@ context('Staking Tab - with vega wallet connected', function () { it('Unable to remove a stake greater than staked amount next epoch for a validator', function () { cy.ethereum_wallet_associateTokens('3'); - cy.vega_wallet_check_unstakedValue_is('3.0'); + cy.vega_wallet_check_unstakedValue_is('3.000000000000000000'); cy.get('button').contains('Select a validator to nominate').click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); cy.staking_validator_page_addStake('2'); cy.staking_validator_page_check_stakeNextEpochValue('2.0'); - cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.0'); - cy.vega_wallet_check_unstakedValue_is('1.0'); + cy.vega_wallet_check_validator_stakeNextEpochValue_is(this.validatorName, '2.000000000000000000'); + cy.vega_wallet_check_unstakedValue_is('1.000000000000000000'); cy.get(navigation.staking).first().click(); cy.get(staking.validatorNames).contains(this.validatorName).click(); diff --git a/apps/token-e2e/src/support/wallet.functions.js b/apps/token-e2e/src/support/wallet.functions.js index e64e8e8f3..6f6e49e7b 100644 --- a/apps/token-e2e/src/support/wallet.functions.js +++ b/apps/token-e2e/src/support/wallet.functions.js @@ -11,14 +11,13 @@ const vegaWalletPassphrase = Cypress.env("VEGA_WALLET_PASSPHRASE"); Cypress.Commands.add('vega_wallet_teardown', function () { const token = new StakingBridge(); - cy.log(token) - // const vegaPubKey = '0bd8d51ac46d563af70e4c92fdc53552f800ad527109146e9dff72f6413c10c9'; - // const ethPubKey = '0xEe7D375bcB50C26d52E1A4a472D8822A2A22d94F'; + const vegaPubKey = '0bd8d51ac46d563af70e4c92fdc53552f800ad527109146e9dff72f6413c10c9'; + const ethPubKey = '0xEe7D375bcB50C26d52E1A4a472D8822A2A22d94F'; - // token.stakeBalance(ethPubKey, vegaPubKey).then((amount => { - // cy.log(amount) - // token.removeStake(amount, vegaPubKey) - // })) + token.stakeBalance(ethPubKey, vegaPubKey).then((amount => { + cy.log(amount) + token.removeStake(amount, vegaPubKey) + })) }) // ----------------------------------------------------------------------