-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
help links tests + clean up of system info
- Loading branch information
1 parent
70d3630
commit 8b1191c
Showing
2 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/HelpPanel/helpLinks.spec.ts
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,41 @@ | ||
import { test } from '@umbraco/playwright-testhelpers'; | ||
import { expect } from '@playwright/test'; | ||
|
||
test.describe("Help panel links", () => { | ||
const enCulture = "en-US"; | ||
|
||
test.beforeEach(async ({ umbracoApi }, testInfo) => { | ||
await umbracoApi.report.report(testInfo); | ||
await umbracoApi.login(); | ||
await umbracoApi.users.setCurrentLanguage(enCulture); | ||
}); | ||
|
||
test.afterEach(async ({ umbracoApi }) => { | ||
await umbracoApi.users.setCurrentLanguage(enCulture); | ||
}); | ||
|
||
test("Check the youtube link works as expected", async ({ page, umbracoUi }) => { | ||
// Action | ||
await umbracoUi.clickElement(umbracoUi.getGlobalHelp()); | ||
let watchVideoLink = await page.locator('[key="help_umbracoLearningBase"]'); | ||
await watchVideoLink.click(); | ||
|
||
// Wait for a popup event | ||
const youtubeConsent = page.waitForEvent("popup"); | ||
const youtubePopup = await youtubeConsent; | ||
|
||
if (youtubePopup) { | ||
// If the YouTube consent popup is displayed, interact with it | ||
const rejectAllButton = await youtubePopup.locator('[aria-label="Reject all"]').first(); | ||
await rejectAllButton.waitFor({ state: "visible" }); | ||
await rejectAllButton.click(); | ||
|
||
// Assert the URL of the popup | ||
await expect(youtubePopup).toHaveURL(/.*UmbracoLearningBase/); | ||
await youtubePopup.close(); | ||
|
||
} else { | ||
await expect(page).toHaveURL(/.*UmbracoLearningBase/); | ||
} | ||
}); | ||
}); |
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