Skip to content

Commit

Permalink
Fix mocha timeout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
biancadanforth committed Aug 19, 2019
1 parent 68b791b commit 4c69f81
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions test/functional/isVisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ describe('isVisible', () => {
);
}

it('should return false when an element is hidden', async () => {
it('should return false when an element is hidden', async function () {
this.timeout(WAIT_MS);
const hiddenElementIds = await driver.executeScript(`
return [].slice.call(document.querySelectorAll('[id^="not-visible-"]')).map((element) => element.id);
`);
Expand All @@ -41,10 +42,12 @@ describe('isVisible', () => {

for (const id of hiddenElementIds) {
await checkVisibility(id, false);

}
}).timeout(60000);
});

it('should return true when an element is visible', async () => {
it('should return true when an element is visible', async function () {
this.timeout(WAIT_MS);
const visibleElementIds = await driver.executeScript(`
return [].slice.call(document.querySelectorAll('[id^="visible-"]')).map((element) => element.id);
`);
Expand All @@ -53,7 +56,10 @@ describe('isVisible', () => {
for (const id of visibleElementIds) {
await checkVisibility(id, true);
}
}).timeout(60000);
});

after(async () => driver.quit());
after(async function () {
this.timeout(WAIT_MS);
return driver.quit();
});
});

0 comments on commit 4c69f81

Please sign in to comment.