Add bailout success page
This commit is contained in:
parent
7ef067f1d3
commit
d73ce9ff85
2 changed files with 37 additions and 0 deletions
|
|
@ -34,9 +34,11 @@ import { PolicyDriverPage } from "../pages/PolicyDriverPage"
|
|||
import { ServiceZipPage } from "../pages/ServiceZipPage"
|
||||
import { MobileDetailsPage } from "pages/MobileDetailsPage";
|
||||
import { BailoutPage } from '../pages/BailoutPage';
|
||||
import { BailoutSuccessPage } from '../pages/BailoutSuccessPage';
|
||||
|
||||
export interface ITestPages {
|
||||
bailoutPage: BailoutPage,
|
||||
bailoutSuccessPage: BailoutSuccessPage,
|
||||
capabilityQuestionsPage: CapabilityQuestionsPage,
|
||||
ccPolicyInfoPage: CCPolicyInfoPage,
|
||||
contactDetailsPage: ContactDetailsPage,
|
||||
|
|
@ -75,6 +77,7 @@ export interface ITestPages {
|
|||
export const createTestPages: TestPagesFactory<ITestPages> = (page: Page) => {
|
||||
const pages: ITestPages = {
|
||||
bailoutPage: new BailoutPage(page),
|
||||
bailoutSuccessPage: new BailoutSuccessPage(page),
|
||||
capabilityQuestionsPage: new CapabilityQuestionsPage(page),
|
||||
ccPolicyInfoPage: new CCPolicyInfoPage(page),
|
||||
contactDetailsPage: new ContactDetailsPage(page),
|
||||
|
|
|
|||
34
playwright-tests/pages/BailoutSuccessPage.ts
Normal file
34
playwright-tests/pages/BailoutSuccessPage.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { type Locator, type Page, expect } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
import { TestSuccessAlert } from 'safelite-playwright-core';
|
||||
import { step } from 'framework/localTypes/Step';
|
||||
|
||||
export class BailoutSuccessPage extends BasePage {
|
||||
readonly thankYouHeading: Locator;
|
||||
readonly bodyText: Locator;
|
||||
readonly returnToHomepageButton: Locator;
|
||||
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
this.thankYouHeading = page.getByText("Thanks! We'll get back to you soon");
|
||||
this.bodyText = page.getByText(/We've got it from here!/);
|
||||
this.returnToHomepageButton = page.locator('#btn-vehicle-not-listed');
|
||||
}
|
||||
|
||||
async validateBailoutSuccessPage() {
|
||||
await expect(this.page).toHaveURL(/bailout-success/);
|
||||
await expect(this.thankYouHeading).toBeVisible();
|
||||
await expect(this.bodyText).toBeVisible();
|
||||
await expect(this.bodyText).toHaveText(
|
||||
/We've got it from here! One of our experts will be in touch to schedule your appointment\. If you have any questions, please contact 1-888-238-4527/
|
||||
);
|
||||
await expect(this.returnToHomepageButton).toBeVisible();
|
||||
}
|
||||
|
||||
@step("BailoutSuccessPage >> Validate bailout success page and return to vehicle page")
|
||||
async handleBailoutSuccessPage() {
|
||||
await this.validateBailoutSuccessPage();
|
||||
await this.returnToHomepageButton.click();
|
||||
await expect(this.page).toHaveURL(/vehicle/);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue