Skip to content

Commit

Permalink
Update fulfillment.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Adameddy26 authored Jun 15, 2024
1 parent fd95e6c commit 402d80c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tests/fulfillment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,17 @@ test('Fulfillment', async () => {

// Function to open a new tab when a picklist, packing slip or shipping label is generated
async function newTab() {
const newTabPopup = page.waitForEvent('popup');
const newTab = await newTabPopup;
console.log('f');
await newTab.waitForLoadState();
console.log('i');
await newTab.close();
const [newTab] = await Promise.all([
page.waitForEvent('popup'),
page.waitForTimeout(4000)
]);

if (newTab) {
await newTab.waitForLoadState({ timeout: 20000 });
await newTab.close();
} else {
console.error("New tab did not open");
}
}

// Function to pack and ship the order incase there is no picker present in the picklist
Expand Down

0 comments on commit 402d80c

Please sign in to comment.