Skip to content

Commit

Permalink
diff network spec
Browse files Browse the repository at this point in the history
  • Loading branch information
seaona committed Oct 9, 2024
1 parent 5f38b47 commit d4d1ffe
Showing 1 changed file with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ const {
unlockWallet,
DAPP_URL,
DAPP_ONE_URL,
regularDelayMs,
WINDOW_TITLES,
defaultGanacheOptions,
largeDelayMs,
switchToNotificationWindow,
} = require('../../helpers');
const { PAGES } = require('../../webdriver/driver');

Expand Down Expand Up @@ -49,14 +47,11 @@ describe('Request Queuing for Multiple Dapps and Txs on different networks', fun
await openDapp(driver, undefined, DAPP_URL);

// Connect to dapp 1
await driver.findClickableElement({ text: 'Connect', tag: 'button' });
await driver.clickElement('#connectButton');
await driver.clickElement({ text: 'Connect', tag: 'button' });

await driver.delay(regularDelayMs);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await switchToNotificationWindow(driver);

await driver.clickElement({
await driver.clickElementAndWaitForWindowToClose({
text: 'Connect',
tag: 'button',
});
Expand All @@ -82,14 +77,11 @@ describe('Request Queuing for Multiple Dapps and Txs on different networks', fun
await openDapp(driver, undefined, DAPP_ONE_URL);

// Connect to dapp 2
await driver.findClickableElement({ text: 'Connect', tag: 'button' });
await driver.clickElement('#connectButton');

await driver.delay(regularDelayMs);
await driver.clickElement({ text: 'Connect', tag: 'button' });

await switchToNotificationWindow(driver, 4);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await driver.clickElement({
await driver.clickElementAndWaitForWindowToClose({
text: 'Connect',
tag: 'button',
});
Expand All @@ -108,24 +100,29 @@ describe('Request Queuing for Multiple Dapps and Txs on different networks', fun
await driver.clickElement('#sendButton');
await driver.clickElement('#sendButton');

await switchToNotificationWindow(driver, 4);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await driver.findElement(
await driver.waitForSelector(
By.xpath("//div[normalize-space(.)='1 of 2']"),
);

// Reject All Transactions
await driver.clickElement('.page-container__footer-secondary a');

await driver.clickElement({ text: 'Reject all', tag: 'button' }); // TODO: Do we want to confirm here?
// TODO: Do we want to confirm here?
await driver.clickElementAndWaitForWindowToClose({
text: 'Reject all',
tag: 'button',
});

// Wait for confirmation to close
await driver.waitUntilXWindowHandles(3);
// TODO: find a better way to handle different dialog ids
await driver.delay(2000);

// Wait for new confirmations queued from second dapp to open
await switchToNotificationWindow(driver, 4);
await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog);

await driver.findElement(
await driver.waitForSelector(
By.xpath("//div[normalize-space(.)='1 of 2']"),
);

Expand Down

0 comments on commit d4d1ffe

Please sign in to comment.