vega-frontend-monorepo/apps/token-e2e/src/support/wallet-eth.functions.js
AndyWhiteVega 85c3eff31e
Test/746 expand coverage of tfe tests (#759)
* test: adding extra checks within tests

* test: lint

* test: refactor to bring assertions inline with new wallet locators

* test: lint

* test: lint correction

* test: formatting for lint

* test: formatting for lint

* test: fix test and make use of common functions

* test: lint
2022-07-14 15:21:51 +01:00

19 lines
804 B
JavaScript

const ethWalletContainer = '[data-testid="ethereum-wallet"]';
const connectToEthButton = '[data-testid="connect-to-eth-wallet-button"]';
const capsuleWalletConnectButton = '[data-testid="web3-connector-Unknown"]';
Cypress.Commands.add('ethereum_wallet_connect', () => {
cy.highlight('Connecting Eth Wallet');
cy.get(connectToEthButton).within(() => {
cy.contains('Connect Ethereum wallet to associate $VEGA')
.should('be.visible')
.click();
});
cy.get(capsuleWalletConnectButton).click();
cy.get(capsuleWalletConnectButton, { timeout: 60000 }).should('not.exist');
cy.get(ethWalletContainer).within(() => {
// this check is required since it ensures the wallet is fully (not partially) loaded
cy.contains('Locked', { timeout: 15000 }).should('be.visible');
});
});