Skip to content

Commit

Permalink
check that report address includes city and province
Browse files Browse the repository at this point in the history
  • Loading branch information
banders committed May 7, 2024
1 parent 3236f68 commit 079bb67
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions frontend/e2e/pages/report.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Locator, expect, Page } from '@playwright/test';
import { PTPage } from './page';
import { Locator, Page, expect } from '@playwright/test';
import { PagePaths } from '../utils';
import { GenerateReportPage, IReportDetails } from './generate-report';
import { GenerateReportPage } from './generate-report';
import { PTPage } from './page';

export class BaseReportPage extends PTPage {
public downloadPDFButton: Locator;
Expand Down Expand Up @@ -35,9 +35,21 @@ export class BaseReportPage extends PTPage {
await expect(
await this.instance.getByRole('cell', { name: 'Address' }),
).toBeVisible();
await expect(
await this.instance.getByRole('cell', { name: user.addressLine1 }),
).toBeVisible();

const addressValue = await this.instance.getByRole('cell', {
name: user.addressLine1,
});
await expect(addressValue).toBeVisible();

if (user.addressLine2) {
await expect(addressValue).toContainText(user.addressLine2);
}
if (user.city) {
await expect(addressValue).toContainText(user.city);
}
if (user.province) {
await expect(addressValue).toContainText(user.province);
}
}

async downloadPDF() {
Expand Down

0 comments on commit 079bb67

Please sign in to comment.