diff --git a/playwright-tests/pages/BasePage.ts b/playwright-tests/pages/BasePage.ts index fbb71ccb6..0e8c65219 100644 --- a/playwright-tests/pages/BasePage.ts +++ b/playwright-tests/pages/BasePage.ts @@ -140,11 +140,18 @@ export class BasePage { let loaderElements = await this.page.locator('button .loader, .buy-loader, timeout, .modal-loader').all(); return !(await Promise.any(loaderElements.map(el => el.isVisible())).catch(() => false)); }); + + // Take a screenshot of the page before validating the progress bar + await this.page.screenshot({ path: `test-results\\ortoni-data\\progress-bar-${Date.now()}.png`, fullPage: true }); + // Wait until the progress bar element is attached and visible + const actualProgressPercentage = await this.progressBar.evaluate( - (element) => element.style.width || "Not Found" + async (element) => { + await new Promise(resolve => setTimeout(resolve, 200)); + return element.style.width || "Not Found"; + } ); Soft.expect(actualProgressPercentage).toBe(progressPercentage); console.log(`Progress Bar Percentage: Actual - ${actualProgressPercentage} vs Expected - ${progressPercentage}`); } - } \ No newline at end of file diff --git a/playwright-tests/pages/OrderConfirmationPage.ts b/playwright-tests/pages/OrderConfirmationPage.ts index b3a3862a8..74a5a49e1 100644 --- a/playwright-tests/pages/OrderConfirmationPage.ts +++ b/playwright-tests/pages/OrderConfirmationPage.ts @@ -69,7 +69,7 @@ export class OrderConfirmationPage extends BasePage { expect.soft(servicePackageValue).toContain('New wiper blades'); } if (servicePackage === ServicePackage.Premium) { - expect.soft(servicePackageValue).toContain('Rain Defenseā„¢'); + expect.soft(servicePackageValue).toContain('Rain Repel Treatment'); } // Promo Code Validation diff --git a/playwright-tests/pages/PaymentMethodPage.ts b/playwright-tests/pages/PaymentMethodPage.ts index 11ee47443..240d0e03e 100644 --- a/playwright-tests/pages/PaymentMethodPage.ts +++ b/playwright-tests/pages/PaymentMethodPage.ts @@ -148,7 +148,7 @@ export class PaymentMethodPage extends BasePage { expect.soft(servicePackageValue).toContain('New wiper blades'); } if (servicePackage === ServicePackage.Premium) { - expect.soft(servicePackageValue).toContain('Rain repel treatment'); + expect.soft(servicePackageValue).toContain('Rain Repel Treatment'); } // Promo Code Validation diff --git a/playwright-tests/pages/forms/AddressForm.ts b/playwright-tests/pages/forms/AddressForm.ts index afa9d9c85..7080fea48 100644 --- a/playwright-tests/pages/forms/AddressForm.ts +++ b/playwright-tests/pages/forms/AddressForm.ts @@ -43,6 +43,7 @@ export class AddressForm extends BasePage { // await this.forceAddressFormToAppear(); await this.streetAddressTextBox.click(); await this.streetAddressTextBox.pressSequentially(`${customerDetails.address.street}, ${customerDetails.address.city}, ${customerDetails.address.state} ${customerDetails.address.postalCode}`).then( async() => { + await new Promise(resolve => setTimeout(resolve, 1000)); await this.streetAddressTextBox.dispatchEvent('keydown', { key: 'ArrowDown' }); await this.streetAddressTextBox.dispatchEvent('keyup', { key: 'ArrowDown' }); });