Skip to content

Commit

Permalink
Try clicking after wait
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Aug 6, 2023
1 parent c68f7f9 commit 975bc7c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/kiwix-js.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ function runTests (driver, modes) {
// }, 5000);
await prefix.sendKeys('Ray');
await prefix.click();
// Wait for the result to appear and click it
// Wait for the result to appear
let resultElement;
await driver.wait(async function () {
const resultElement = await driver.findElement(By.xpath("//div[@id='articleList']/a[text()='Ray Charles']"));
resultElement = await driver.findElement(By.xpath("//div[@id='articleList']/a[text()='Ray Charles']"));
const resultText = await resultElement.getText();
assert.equal('Ray Charles', resultText);
await resultElement.click();
return resultText;
}, 5000);
}, 8000);
// Now click the result
await resultElement.click();
await driver.switchTo().frame('articleContent');
// Wait until the article has loaded and check title
await driver.wait(async function () {
Expand Down

0 comments on commit 975bc7c

Please sign in to comment.