Add no comp locator to logic

This commit is contained in:
JennyNou 2025-06-19 11:12:39 -04:00
parent a7936496f6
commit 037d8ec01f

View file

@ -10,6 +10,7 @@ export class CoverageStatementPage extends InsuranceBasePage {
readonly cancelMyClaimButton: Locator;
readonly deductibleAmount: Locator;
readonly verifyingCoverageText: Locator;
readonly noCompText: Locator;
readonly continueButton: Locator; // For ITAC/NoComp
url = process.env['BASE_URL']! + '/FixMyGlass/CoverageStatement.aspx';
@ -20,6 +21,7 @@ export class CoverageStatementPage extends InsuranceBasePage {
this.cancelMyClaimButton = this.page.getByText('Cancel my claim');
this.deductibleAmount = this.page.getByRole('heading', { name: '$' }).locator('span');
this.verifyingCoverageText = this.page.getByRole('heading', { name: 'We\'re verifying your coverage' });
this.noCompText = this.page.getByRole('heading', { name: 'Your policy doesn\'t cover this service' });
this.continueButton = page.getByRole('button', { name: 'Continue' });
// this.validateURL(this.url);
}
@ -54,7 +56,7 @@ export class CoverageStatementPage extends InsuranceBasePage {
await expect(deductibleElement).toContainText(`$${expectedDeductibleRegex}`);
}
if (await unverifiedDeductibleElement.isVisible()) {
if (await unverifiedDeductibleElement.isVisible() || await this.noCompText.isVisible()) {
// Click on continue button if unverified header is visible
await this.continueButton.click();
}