Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single Screen Interaction, Approve Button Fix and Code Cleanup #9

Merged
merged 6 commits into from
Mar 4, 2024
8 changes: 2 additions & 6 deletions commands/keplr.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let extensionId;
let extensionVersion;
let registrationUrl;
let permissionsUrl;
let switchBackToCypressWindow;

const keplr = {
async resetState() {
Expand Down Expand Up @@ -71,12 +72,7 @@ const keplr = {
return true;
},
async importWallet(secretWordsOrPrivateKey, password, newAccount) {
const keplrWindow = playwright.keplrWindow();
const currentUrl = await keplrWindow.url();
if (!currentUrl.includes('registr')) {
await module.exports.goToRegistration();
}

await module.exports.goToRegistration();
await playwright.waitAndClickByText(
newAccount
? onboardingElements.createWalletButton
Expand Down
1 change: 1 addition & 0 deletions commands/metamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ const metamask = {
return true;
},
async disconnectWalletFromDapp() {
await playwright.switchToKeplrWindow();
await switchToMetamaskIfNotActive();
await playwright.waitAndClick(mainPageElements.optionsMenu.button);
await playwright.waitAndClick(
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/specs/keplr/keplr-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ describe('Keplr', () => {
});
});
it(`should disconnect the wallet from all the connected DAPPs`, () => {
cy.switchToExtensionWindow().then(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a reminder: we should also create a separate PR to move all other instances where explicitly call switchToExtensionWindow in our tests

cy.disconnectWalletFromDapp().then(taskCompleted => {
expect(taskCompleted).to.be.true;
});
cy.disconnectWalletFromDapp().then(taskCompleted => {
expect(taskCompleted).to.be.true;
});
});
});
Expand Down
Loading