-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Test automation] OpenShift Learning Path. The link from the learning…
… path should open a new tab (#1320) * [Test automation] OpenShift Learning Path. The link from the learning path should open a new tab * Added blank page check for new tab * learning path new page PR fix * PR fix timeout * Changing PR fix * Changing PR fix * PR fix --------- Co-authored-by: Joseph Kim <[email protected]>
- Loading branch information
Showing
3 changed files
with
166 additions
and
135 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 |
---|---|---|
|
@@ -67,4 +67,4 @@ site | |
.idea | ||
|
||
# e2e test results | ||
junit-results.xml | ||
junit-results.xml |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { UIhelper } from '../utils/UIhelper'; | ||
import { Common } from '../utils/Common'; | ||
|
||
test.describe('Learning Paths', () => { | ||
let common: Common; | ||
let uiHelper: UIhelper; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
uiHelper = new UIhelper(page); | ||
common = new Common(page); | ||
await common.loginAsGuest(); | ||
}); | ||
|
||
test('Verify that links in Learning Paths for Backstage opens in a new tab', async ({ | ||
page, | ||
}) => { | ||
await uiHelper.openSidebar('Learning Paths'); | ||
|
||
for (let i = 0; i < 5; i++) { | ||
const popupPromise = page.waitForEvent('popup'); | ||
await page.locator(`div[class*="MuiCardHeader-root"]`).nth(i).click(); | ||
const popup = await popupPromise; | ||
await popup.waitForLoadState('domcontentloaded', { timeout: 120000 }); | ||
const url = await popup.evaluate('location.href'); | ||
console.log(url); | ||
expect(url).not.toBe('about:blank'); | ||
await popup.close(); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.