-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
portalicious: test iframe on monitoring page (#5884)
AB#30569
- Loading branch information
Showing
3 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ class ProjectMonitoring extends BasePage { | |
readonly cashDisbursedTile: Locator; | ||
readonly projectDescriptionTile: Locator; | ||
readonly metricTileComponent: Locator; | ||
readonly monitoringIframe: Locator; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
|
@@ -25,9 +26,14 @@ class ProjectMonitoring extends BasePage { | |
'metric-project-description', | ||
); | ||
this.metricTileComponent = this.page.getByTestId('metric-tile-component'); | ||
this.monitoringIframe = this.page.getByTestId('monitoring-iframe'); | ||
} | ||
|
||
async assertMonitoringTabElements() { | ||
async assertMonitoringTabElements({ | ||
shouldHaveIframe, | ||
}: { | ||
shouldHaveIframe: boolean; | ||
}) { | ||
await expect(this.peopleRegisteredTile).toContainText('People registered'); | ||
await expect(this.peopleIncludedTile).toContainText('People included'); | ||
await expect(this.remainingBudgetTile).toContainText('Remaining budget'); | ||
|
@@ -36,7 +42,15 @@ class ProjectMonitoring extends BasePage { | |
'Project description', | ||
); | ||
|
||
// For the moment we are not checking the iframe area because there are no visible elemnts in it | ||
const iframe = await this.monitoringIframe.locator('iframe').all(); | ||
if (shouldHaveIframe) { | ||
await expect(iframe.length).toBe(1); | ||
} else { | ||
await expect(iframe.length).toBe(0); | ||
await expect(this.monitoringIframe).toContainText( | ||
'No PowerBI dashboard has been configured for this project, please contact [email protected] to set this up', | ||
); | ||
} | ||
} | ||
|
||
async assertValuesInMonitoringTab({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters