42 lines
No EOL
1.8 KiB
TypeScript
42 lines
No EOL
1.8 KiB
TypeScript
import { expect, type Locator, type Page } from '@playwright/test';
|
|
import { InsuranceBasePage } from './InsuranceBasePage';
|
|
import { ITestData } from 'framework/TestData';
|
|
import { step } from 'framework/localTypes/Step';
|
|
|
|
export class HeritageProblemGlassQuestionsPage extends InsuranceBasePage {
|
|
readonly provideVinManuallyButton: Locator;
|
|
readonly provideLicensePlateButton: Locator;
|
|
readonly provideHomeAddressButton: Locator;
|
|
readonly continueOnVinPopUpButton: Locator;
|
|
readonly dontShareVinButton: Locator;
|
|
|
|
readonly yestoGlassQuestionButton: Locator;
|
|
readonly notoGlassQuestionButton: Locator;
|
|
readonly continueButton: Locator;
|
|
|
|
|
|
constructor(page: Page) {
|
|
super(page);
|
|
|
|
this.provideVinManuallyButton = page.locator('label[for="VINManually"]');
|
|
this.provideLicensePlateButton = page.locator('label[for="licensePlate"]');
|
|
this.provideHomeAddressButton = page.locator('label[for="HomeAddress"]');
|
|
this.continueOnVinPopUpButton = page.locator('button:has-text("Continue")');
|
|
this.dontShareVinButton = page.getByRole('button', { name: "I would rather not share my VIN" });
|
|
|
|
this.yestoGlassQuestionButton = page.locator('label:has-text("Yes")');
|
|
this.notoGlassQuestionButton = page.locator('label:has-text("No")');
|
|
this.continueButton = page.locator('button[type="submit"].btn-success.nav-continue');
|
|
|
|
}
|
|
|
|
|
|
@step("HeritageProblemGlassQuestionsPage >> Handle VIN popup and answer glass question on heritage")
|
|
// Handles OEM scenario with vehicle that has only one glass question
|
|
async handleHeritageProblemGlassQuestionsPage(testData: Partial<ITestData>){
|
|
|
|
await this.dontShareVinButton.click();
|
|
await this.yestoGlassQuestionButton.click();
|
|
await this.continueButton.click();
|
|
}
|
|
} |