-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHIDP-744 [Test Automation] Automate RHDH theme customization - E2E
Refactor custom theme E2E test and update uihelper functions The custom theme end-to-end test was refactored to be more focused and reliable. The 'UIhelper' was enriched with new functions that improve reusability in tests. Also, configuration for application theming and authentication methods were updated. Signed-off-by: Gustavo Lira <guga.java@gmail.com>
- Loading branch information
1 parent
e38c2e7
commit a137a55
Showing
5 changed files
with
98 additions
and
54 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
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
e2e-tests/playwright/e2e/plugins/custom-theme/custom-theme.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,52 @@ | ||
import { test, Page, TestInfo } from '@playwright/test'; | ||
import { Common, setupBrowser } from '../../../utils/Common'; | ||
import { ThemeVerifier } from './theme-verifier'; | ||
|
||
let page: Page; | ||
|
||
test.describe('CustomTheme should be applied', () => { | ||
let common: Common; | ||
let themeVerifier: ThemeVerifier; | ||
|
||
test.beforeAll(async ({ browser }, testInfo) => { | ||
page = (await setupBrowser(browser, testInfo)).page; | ||
common = new Common(page); | ||
themeVerifier = new ThemeVerifier(page); | ||
|
||
await common.loginAsGuest(); | ||
}); | ||
|
||
// eslint-disable-next-line no-empty-pattern | ||
test('Verify that theme light colors are applied and make screenshots', async ({}, testInfo: TestInfo) => { | ||
await themeVerifier | ||
.setTheme('Light') | ||
.verifyHeaderGradient( | ||
'none, linear-gradient(90deg, rgb(248, 248, 248), rgb(248, 248, 248))', | ||
) | ||
.verifyBorderLeftColor('rgb(255, 95, 21)') | ||
.takeScreenshotAndAttach( | ||
'screenshots/custom-theme-light-inspection.png', | ||
testInfo, | ||
'custom-theme-light-inspection', | ||
) | ||
.verifyPrimaryColors('rgb(255, 95, 21)') | ||
.execute(); | ||
}); | ||
|
||
// eslint-disable-next-line no-empty-pattern | ||
test('Verify that theme dark colors are applied and make screenshots', async ({}, testInfo: TestInfo) => { | ||
await themeVerifier | ||
.setTheme('Dark') | ||
.verifyHeaderGradient( | ||
'none, linear-gradient(90deg, rgb(0, 0, 208), rgb(255, 246, 140))', | ||
) | ||
.verifyBorderLeftColor('rgb(244, 238, 169)') | ||
.takeScreenshotAndAttach( | ||
'screenshots/custom-theme-dark-inspection.png', | ||
testInfo, | ||
'custom-theme-dark-inspection', | ||
) | ||
.verifyPrimaryColors('#ab75cf') | ||
.execute(); | ||
}); | ||
}); |
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