@bigbinary/neeto-playwright-commons 1.23.2 → 1.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -5225,6 +5225,8 @@ const THEMES_SELECTORS = {
5225
5225
  colorPickerDropdownContainer: (colorHex) => `${colorHex}-dropdown-container`,
5226
5226
  baseThemeStyle: (styleType) => `theme-style-${neetoCist.hyphenate(styleType)}`,
5227
5227
  introPageThemeStyle: (styleType) => `intro-page-theme-style-${neetoCist.hyphenate(styleType)}`,
5228
+ themeSwitcherButton: "theme-switcher-button",
5229
+ themeSwitcherDarkButton: "theme-switcher-dark-button",
5228
5230
  };
5229
5231
 
5230
5232
  const ADMIN_PANEL_SELECTORS = {
@@ -117970,6 +117972,10 @@ const COMMON_TEXTS = {
117970
117972
  const ORGANIZATION_TEXTS = {
117971
117973
  subdomainAvailable: "Subdomain is available",
117972
117974
  };
117975
+ const THEMES_TEXTS = {
117976
+ lightThemeClass: /neeto-ui-theme--light/,
117977
+ darkThemeClass: /neeto-ui-theme--dark/,
117978
+ };
117973
117979
 
117974
117980
  class HelpAndProfilePage {
117975
117981
  constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
@@ -118388,6 +118394,35 @@ class HelpAndProfilePage {
118388
118394
  ]);
118389
118395
  });
118390
118396
  };
118397
+ this.verifyThemeSwitcher = async (expectedScreenshot) => {
118398
+ let bodyElement, fabContainer;
118399
+ await test.test.step("1: Verify light theme", async () => {
118400
+ bodyElement = this.page.locator("body");
118401
+ await Promise.all([
118402
+ test.expect(bodyElement).toHaveClass(THEMES_TEXTS.lightThemeClass),
118403
+ test.expect(bodyElement).not.toHaveClass(THEMES_TEXTS.darkThemeClass),
118404
+ ]);
118405
+ });
118406
+ await test.test.step("2: Open Help Center", () => this.openHelpCenter());
118407
+ await test.test.step("3: Switch to dark theme", async () => {
118408
+ await this.page.getByTestId(THEMES_SELECTORS.themeSwitcherButton).click();
118409
+ await this.page
118410
+ .getByTestId(THEMES_SELECTORS.themeSwitcherDarkButton)
118411
+ .click();
118412
+ });
118413
+ await test.test.step("4: Verify dark theme", async () => {
118414
+ fabContainer = this.page
118415
+ .getByTestId(COMMON_SELECTORS.dropdownContainer)
118416
+ .filter({ hasText: this.t("neetoMolecules.sidebar.myProfile") });
118417
+ await Promise.all([
118418
+ test.expect(bodyElement).toHaveClass(THEMES_TEXTS.darkThemeClass),
118419
+ test.expect(bodyElement).not.toHaveClass(THEMES_TEXTS.lightThemeClass),
118420
+ ]);
118421
+ await test.expect(fabContainer).toHaveScreenshot(expectedScreenshot, {
118422
+ maxDiffPixelRatio: 0.1,
118423
+ });
118424
+ });
118425
+ };
118391
118426
  this.page = page;
118392
118427
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
118393
118428
  this.chatApiBaseURL = chatApiBaseURL;
@@ -128178,6 +128213,7 @@ exports.TEXT_MODIFIER_SELECTORS = TEXT_MODIFIER_SELECTORS;
128178
128213
  exports.TEXT_MODIFIER_TAGS = TEXT_MODIFIER_TAGS;
128179
128214
  exports.THANK_YOU_SELECTORS = THANK_YOU_SELECTORS;
128180
128215
  exports.THEMES_SELECTORS = THEMES_SELECTORS;
128216
+ exports.THEMES_TEXTS = THEMES_TEXTS;
128181
128217
  exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
128182
128218
  exports.TIME_RANGES = TIME_RANGES;
128183
128219
  exports.TOASTR_MESSAGES = TOASTR_MESSAGES;