Skip to content

Commit

Permalink
a variable to hold a constant. #1362
Browse files Browse the repository at this point in the history
  • Loading branch information
davemfish committed Aug 10, 2023
1 parent 18a356e commit 864a29e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions workbench/tests/binary_tests/puppet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { APP_HAS_RUN_TOKEN } from '../../src/main/setupCheckFirstRun';

jest.setTimeout(240000);
const PORT = 9009;
const WAIT_TO_CLICK = 300; // ms
let ELECTRON_PROCESS;
let BROWSER;

Expand Down Expand Up @@ -166,7 +167,7 @@ test('Run a real invest model', async () => {
const downloadModal = await page.waitForSelector('.modal-dialog');
const downloadModalCancel = await downloadModal.waitForSelector(
'aria/[name="Cancel"][role="button"]');
await page.waitForTimeout(300); // waiting for click handler to be ready
await page.waitForTimeout(WAIT_TO_CLICK); // waiting for click handler to be ready
await downloadModalCancel.click();
// We need to get the modelButton from w/in this list-group because there
// are buttons with the same name in the Recent Jobs container.
Expand Down Expand Up @@ -235,17 +236,17 @@ test('Check local userguide links', async () => {
const downloadModal = await page.waitForSelector('.modal-dialog');
const downloadModalCancel = await downloadModal.waitForSelector(
'aria/[name="Cancel"][role="button"]');
await page.waitForTimeout(500); // waiting for click handler to be ready
await page.waitForTimeout(WAIT_TO_CLICK); // waiting for click handler to be ready
await downloadModalCancel.click();

const investList = await page.waitForSelector('.invest-list-group');
const modelButtons = await investList.$$('aria/[role="button"]');

await page.waitForTimeout(300); // first btn click does not register w/o this pause
await page.waitForTimeout(WAIT_TO_CLICK); // first btn click does not register w/o this pause
for (const btn of modelButtons) {
await btn.click();
const link = await page.waitForSelector('text/User\'s Guide');
await page.waitForTimeout(300); // link.click() not working w/o this pause
await page.waitForTimeout(WAIT_TO_CLICK); // link.click() not working w/o this pause
const hrefHandle = await link.getProperty('href');
const hrefValue = await hrefHandle.jsonValue();
await link.click();
Expand Down

0 comments on commit 864a29e

Please sign in to comment.