wip
This commit is contained in:
22
src/index.ts
22
src/index.ts
@ -50,7 +50,7 @@ async function visitCityPages(): Promise<void> {
|
||||
|
||||
console.log("Logo click")
|
||||
if (!await UIActions.gotoHome(driver)) throw `${city} failed`;
|
||||
await WebDriverUtils.wait(5);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
console.log("Exec Search")
|
||||
if (!await UIActions.execSearch(driver, city)) throw `${city} failed`;
|
||||
@ -61,7 +61,7 @@ async function visitCityPages(): Promise<void> {
|
||||
if (!await UIActions.clickTourismLink(driver)) throw `${city} failed`;
|
||||
if (!await UIActions.clickSeeAll(driver)) throw `${city} failed`;
|
||||
}
|
||||
await WebDriverUtils.wait(5);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
console.log("Switch tab")
|
||||
let windows = await driver.getAllWindowHandles();
|
||||
@ -75,7 +75,7 @@ async function visitCityPages(): Promise<void> {
|
||||
|
||||
console.log("Click See all attractions")
|
||||
if (!await UIActions.clickSeeAllAttractions(driver)) throw `${city} failed`;
|
||||
await WebDriverUtils.wait(5);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
console.log("Switch tab to Attraction")
|
||||
windows = await driver.getAllWindowHandles();
|
||||
@ -90,7 +90,7 @@ async function visitCityPages(): Promise<void> {
|
||||
// click museum
|
||||
console.log("Click Museum link");
|
||||
if (!await UIActions.clickMuseumsLink(driver)) throw `${city} failed`;
|
||||
await WebDriverUtils.wait(5);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
let page = 1;
|
||||
while (1) {
|
||||
@ -98,12 +98,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(1);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
for (const listItem of museumElms) {
|
||||
|
||||
await listItem.click();
|
||||
await WebDriverUtils.wait(3);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
windows = await driver.getAllWindowHandles();
|
||||
for (const handle of windows) {
|
||||
@ -120,10 +120,10 @@ async function visitCityPages(): Promise<void> {
|
||||
|
||||
museumWindow && await driver.switchTo().window(museumWindow);
|
||||
await driver.close();
|
||||
await WebDriverUtils.wait(1);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
attactionsWindow && await driver.switchTo().window(attactionsWindow);
|
||||
await WebDriverUtils.wait(1);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ async function visitCityPages(): Promise<void> {
|
||||
if (page > 10) break;
|
||||
|
||||
UIActions.clickPagination(driver, page);
|
||||
await WebDriverUtils.wait(5);
|
||||
await WebDriverUtils.wait();
|
||||
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ async function visitCityPages(): Promise<void> {
|
||||
|
||||
if (i < cities.length - 1) {
|
||||
console.log(`Waiting for 5000 seconds before next city...`);
|
||||
await WebDriverUtils.wait(5); // Wait 5000 seconds before next city
|
||||
await WebDriverUtils.wait(); // Wait 5000 seconds before next city
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@ -150,7 +150,7 @@ async function visitCityPages(): Promise<void> {
|
||||
|
||||
// If the button is not found within the timeout, log and continue to the next city
|
||||
console.log(`No Museums button found for ${city}. Moving to next city after 5 seconds...`);
|
||||
await WebDriverUtils.wait(5); // Wait 5 seconds before next city
|
||||
await WebDriverUtils.wait(); // Wait 5 seconds before next city
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user