Skip to content

Commit

Permalink
updated methods in searchFlights test
Browse files Browse the repository at this point in the history
  • Loading branch information
raultifrea committed May 22, 2024
1 parent 86c65bb commit 19edfb1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions PageObjects/ExplorePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class ExplorePage {
interface FlightInfo {
Destination: string | null;
Period: string | null;
Price: Number;
Price: string | null;
Duration: string | null;
Airline: string | null;
}
Expand All @@ -79,15 +79,15 @@ export default class ExplorePage {
flightData.push({
Destination: destination,
Period: period,
Price: Number(price.split('€')[1]),
Price: price,
Duration: duration,
Airline: airline
});
} else {
break
}
}
flightData.sort((a: any, b: any) => a.Price - b.Price);
flightData.sort((a: any, b: any) => Number(a.Price.split('€')[1]) - Number(b.Price.split('€')[1]));
console.table(flightData);
}
}
2 changes: 1 addition & 1 deletion e2e/searchFlights.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('Search for nonstop flights in Europe', async ({browser}) => {
await page.waitForLoadState('networkidle');
await page.getByRole('button', { name: 'Explore' }).first().click();
await page.waitForTimeout(1000);
explorePage.changeTripDetails('September', 'Weekend');
explorePage.changeTripDetails('August', 'Weekend');
await page.waitForTimeout(2000);
explorePage.changeStopsNo('Nonstop only');
await page.waitForTimeout(2000);
Expand Down

0 comments on commit 19edfb1

Please sign in to comment.