2023-03-10 15:46:51 +00:00
|
|
|
const ethWalletContainer = '[data-testid="ethereum-wallet"]:visible';
|
|
|
|
const connectToEthButton =
|
|
|
|
'[data-testid="connect-to-eth-wallet-button"]:visible';
|
2022-07-12 13:43:04 +00:00
|
|
|
const capsuleWalletConnectButton = '[data-testid="web3-connector-Unknown"]';
|
2022-07-08 10:48:51 +00:00
|
|
|
|
2023-03-22 17:35:00 +00:00
|
|
|
export function ethereumWalletConnect() {
|
2022-07-08 10:48:51 +00:00
|
|
|
cy.highlight('Connecting Eth Wallet');
|
2023-05-24 08:23:31 +00:00
|
|
|
cy.get(connectToEthButton, { timeout: 60000 }).within(() => {
|
2022-07-08 10:48:51 +00:00
|
|
|
cy.contains('Connect Ethereum wallet to associate $VEGA')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
});
|
2022-07-12 13:43:04 +00:00
|
|
|
cy.get(capsuleWalletConnectButton).click();
|
|
|
|
cy.get(capsuleWalletConnectButton, { timeout: 60000 }).should('not.exist');
|
|
|
|
cy.get(ethWalletContainer).within(() => {
|
2022-07-08 10:48:51 +00:00
|
|
|
// this check is required since it ensures the wallet is fully (not partially) loaded
|
|
|
|
cy.contains('Locked', { timeout: 15000 }).should('be.visible');
|
|
|
|
});
|
2022-09-16 17:12:08 +00:00
|
|
|
// Even once eth wallet connected - attempting a transaction will fail
|
|
|
|
// It needs a few seconds before becoming operational
|
|
|
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
|
|
|
cy.wait(4000);
|
2023-03-22 17:35:00 +00:00
|
|
|
}
|