Skip to content

Commit

Permalink
Merge pull request #386 from Agoric/fraz/test-smart-wallet-dialog
Browse files Browse the repository at this point in the history
test: fixed flake due to smart wallet required dialog
  • Loading branch information
frazarshad authored Oct 23, 2024
2 parents 3f6cb7f + a1453b0 commit dd37ace
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
22 changes: 13 additions & 9 deletions test/e2e/specs/test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,20 @@ describe('Vaults UI Test Cases', () => {
},
() => {
cy.contains('button', 'Create Vault').click();

cy.confirmTransaction().then(taskCompleted => {
expect(taskCompleted).to.be.true;
cy.contains(
'p',
'You can manage your vaults from the "My Vaults" view.',
{ timeout: MINUTE_MS },
).should('exist');
cy.contains('Manage my Vaults').click();
cy.get('body').then($body => {
if ($body.find('div:contains("Smart Wallet Required")').length > 0) {
cy.get('button').contains('Proceed').click();
}
});

cy.confirmTransaction();

cy.contains(
'p',
'You can manage your vaults from the "My Vaults" view.',
{ timeout: MINUTE_MS },
).should('exist');
cy.contains('Manage my Vaults').click();
},
);

Expand Down
7 changes: 5 additions & 2 deletions test/e2e/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ const connectWalletLocalChain = ({ isVaultsTests = false }) => {
}
};

const connectWalletTestnet = () => {
const connectWalletTestnet = ({ isVaultsTests }) => {
if (isVaultsTests) {
cy.contains('button', 'Dismiss').click();
}
cy.get('button').contains('Local Network').click();
cy.get('button').contains(agoricNetworks[AGORIC_NET]).click();
cy.get('body').then($body => {
Expand Down Expand Up @@ -223,7 +226,7 @@ Cypress.Commands.add('connectWithWallet', (options = {}) => {
if (AGORIC_NET === networks.LOCAL) {
connectWalletLocalChain({ isVaultsTests });
} else {
connectWalletTestnet();
connectWalletTestnet({ isVaultsTests });
}
});

Expand Down

0 comments on commit dd37ace

Please sign in to comment.