From 1ed63bdeefa446d25a63a2e761ff60aa4cb5553e Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Wed, 13 Mar 2024 15:58:55 +0500 Subject: [PATCH 1/2] fix: checking added for window instance --- commands/playwright-keplr.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/playwright-keplr.js b/commands/playwright-keplr.js index 2c2f42fcb..45b8e5e5f 100644 --- a/commands/playwright-keplr.js +++ b/commands/playwright-keplr.js @@ -340,7 +340,8 @@ module.exports = { if ( page .url() - .includes(`chrome-extension://${keplrExtensionData.id}/popup.html`) + .includes(`chrome-extension://${keplrExtensionData.id}/popup.html`) && + page !== keplrWindow ) { keplrNotificationWindow = page; retries = 0; From ad694af0dbc52402cea6ebb7211444aea3b8c584 Mon Sep 17 00:00:00 2001 From: Fraz Arshad Date: Wed, 13 Mar 2024 15:59:21 +0500 Subject: [PATCH 2/2] test: test added for edge case --- tests/e2e/specs/keplr/keplr-spec.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/e2e/specs/keplr/keplr-spec.js b/tests/e2e/specs/keplr/keplr-spec.js index a2f9b1791..927c2d128 100644 --- a/tests/e2e/specs/keplr/keplr-spec.js +++ b/tests/e2e/specs/keplr/keplr-spec.js @@ -103,6 +103,16 @@ describe('Keplr', () => { expect(tokenValue).to.equal(331); }); }); + it(`should differntiate between keplrWindow and keplrNotificationWindow when they have the same URL`, () => { + cy.getTokenAmount('ATOM').then(tokenValue => { + expect(tokenValue).to.equal(0); + }); + + cy.contains('Make an Offer').click(); + cy.confirmTransaction().then(taskCompleted => { + expect(taskCompleted).to.be.true; + }); + }); it(`should disconnect the wallet from all the connected DAPPs`, () => { cy.disconnectWalletFromDapp().then(taskCompleted => { expect(taskCompleted).to.be.true;