Skip to content

Commit

Permalink
Fix for switching between keplr windows with same url (#27)
Browse files Browse the repository at this point in the history
* fix: checking added for window instance

* test: test added for edge case
  • Loading branch information
frazarshad authored Mar 13, 2024
1 parent 3ae40a6 commit 96b238b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/playwright-keplr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/specs/keplr/keplr-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 96b238b

Please sign in to comment.