Skip to content

Commit

Permalink
Fix percy tests and add openEditIfNeeded function
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-corson-ibigroup committed Oct 30, 2024
1 parent 15252ba commit a00d5b5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions percy/percy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ async function loadPath(otpPath) {
return page
}

const openEditIfNeeded = async (page, isMobile) => {
if (isMobile) {
await page.click('button.edit-search-button')
}
}

beforeAll(async () => {
try {
// Launch OTP-RR web server
Expand Down Expand Up @@ -114,9 +120,7 @@ async function executeTest(page, isMobile, isCallTaker) {

if (!isCallTaker) {
// Edit trip params [mobile-specific]
if (isMobile) {
await page.click('button.edit-search-button')
}
await openEditIfNeeded(page, isMobile)

// Change the modes: Activate Transit and remove Bike.
await page.click('label[title="Transit"]')
Expand Down Expand Up @@ -148,6 +152,8 @@ async function executeTest(page, isMobile, isCallTaker) {
await page.waitForTimeout(500)
// Delete both origin and destination

await openEditIfNeeded(page, isMobile)

await page.click('.from-form-control')
await page.waitForTimeout(300)
// Click the clear button next to it
Expand Down

0 comments on commit a00d5b5

Please sign in to comment.