auto scroll

This commit is contained in:
Ken Yasue
2025-03-24 06:57:25 +01:00
parent b6cad2a241
commit 1ffea0f61f
3 changed files with 42 additions and 16 deletions

View File

@ -41,18 +41,18 @@ async function visitCityPages(): Promise<void> {
console.log("Logo click")
if (!await UIActions.gotoHome(driver)) throw `${city} failed`;
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
console.log("Exec Search")
if (!await UIActions.execSearch(driver, city)) throw `${city} failed`;
await WebDriverUtils.wait(5);
await WebDriverUtils.wait(driver);
console.log("Click See all")
if (!await UIActions.clickSeeAll(driver)) {
if (!await UIActions.clickTourismLink(driver)) throw `${city} failed`;
if (!await UIActions.clickSeeAll(driver)) throw `${city} failed`;
}
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
console.log("Switch tab")
let windows = await driver.getAllWindowHandles();
@ -66,7 +66,7 @@ async function visitCityPages(): Promise<void> {
console.log("Click See all attractions")
if (!await UIActions.clickSeeAllAttractions(driver)) throw `${city} failed`;
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
console.log("Switch tab to Attraction")
windows = await driver.getAllWindowHandles();
@ -81,7 +81,7 @@ async function visitCityPages(): Promise<void> {
// click museum
console.log("Click Museum link");
if (!await UIActions.clickMuseumsLink(driver)) throw `${city} failed`;
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
let page = 1;
while (1) {
@ -89,12 +89,12 @@ async function visitCityPages(): Promise<void> {
// get list of museums
console.log("Get list of museums");
const museumElms = await UIActions.getMusiums(driver);
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
for (const listItem of museumElms) {
await listItem.click();
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
windows = await driver.getAllWindowHandles();
for (const handle of windows) {
@ -111,10 +111,10 @@ async function visitCityPages(): Promise<void> {
museumWindow && await driver.switchTo().window(museumWindow);
await driver.close();
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
attactionsWindow && await driver.switchTo().window(attactionsWindow);
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
}
@ -123,7 +123,7 @@ async function visitCityPages(): Promise<void> {
if (page > 10) break;
UIActions.clickPagination(driver, page);
await WebDriverUtils.wait();
await WebDriverUtils.wait(driver);
}