@bigbinary/neeto-playwright-commons 1.22.23 → 1.22.25

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
@@ -3343,6 +3343,36 @@ var lib$e = {
3343
3343
 
3344
3344
  var qs$1 = /*@__PURE__*/getDefaultExportFromCjs(lib$e);
3345
3345
 
3346
+ const ENVIRONMENT = {
3347
+ development: "development",
3348
+ staging: "staging",
3349
+ review: "review",
3350
+ };
3351
+ const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
3352
+ const STORAGE_STATE = "./e2e/auth/user.json";
3353
+ const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
3354
+ const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
3355
+ const CREDENTIALS = {
3356
+ name: "Oliver Smith",
3357
+ email: "oliver@example.com",
3358
+ password: "welcome",
3359
+ };
3360
+ const OTP_EMAIL_PATTERN = "is your login code";
3361
+ const SLACK_DEFAULT_CHANNEL = "general";
3362
+ const CUSTOM_DOMAIN_SUFFIX = "aceinvoice.com";
3363
+ const ZAPIER_TEST_EMAIL = (product) => `neeto-${product}-zapier-test@${process.env.FASTMAIL_DOMAIN_NAME}`;
3364
+ // constants for translation
3365
+ const SINGULAR = { count: 1 };
3366
+ const PLURAL = { count: 2 };
3367
+ const COLOR = {
3368
+ transparent: "rgba(0, 0, 0, 0)",
3369
+ softBlue: "rgb(230, 244, 255)",
3370
+ };
3371
+ const DATE_TEXTS = { now: "Now", nextYear: "next-year" };
3372
+ const EMPTY_STORAGE_STATE = {
3373
+ storageState: { cookies: [], origins: [] },
3374
+ };
3375
+
3346
3376
  const COMMON_SELECTORS = {
3347
3377
  emailInputError: "email-input-error",
3348
3378
  pane: "pane-wrapper",
@@ -3473,6 +3503,7 @@ const COMMON_SELECTORS = {
3473
3503
  emailInputWrapper: "email-input-wrapper",
3474
3504
  switchWrapper: "nui-switch-wrapper",
3475
3505
  switchLabel: "nui-switch-item",
3506
+ antdSliderRail: ".ant-slider-rail",
3476
3507
  columnVisibilityBtn: (action) => `column-visibility-${action}-button`,
3477
3508
  customSwitch: (switchLabel) => `${neetoCist.hyphenate(switchLabel)}-switch`,
3478
3509
  customMenuItem: (label) => `${neetoCist.hyphenate(label)}-menu-item`,
@@ -3512,36 +3543,6 @@ const THANK_YOU_SELECTORS = {
3512
3543
  thankYouMessageWrapper: "thank-you-message-wrapper",
3513
3544
  };
3514
3545
 
3515
- const ENVIRONMENT = {
3516
- development: "development",
3517
- staging: "staging",
3518
- review: "review",
3519
- };
3520
- const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
3521
- const STORAGE_STATE = "./e2e/auth/user.json";
3522
- const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
3523
- const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
3524
- const CREDENTIALS = {
3525
- name: "Oliver Smith",
3526
- email: "oliver@example.com",
3527
- password: "welcome",
3528
- };
3529
- const OTP_EMAIL_PATTERN = "is your login code";
3530
- const SLACK_DEFAULT_CHANNEL = "general";
3531
- const CUSTOM_DOMAIN_SUFFIX = "aceinvoice.com";
3532
- const ZAPIER_TEST_EMAIL = (product) => `neeto-${product}-zapier-test@${process.env.FASTMAIL_DOMAIN_NAME}`;
3533
- // constants for translation
3534
- const SINGULAR = { count: 1 };
3535
- const PLURAL = { count: 2 };
3536
- const COLOR = {
3537
- transparent: "rgba(0, 0, 0, 0)",
3538
- softBlue: "rgb(230, 244, 255)",
3539
- };
3540
- const DATE_TEXTS = { now: "Now", nextYear: "next-year" };
3541
- const EMPTY_STORAGE_STATE = {
3542
- storageState: { cookies: [], origins: [] },
3543
- };
3544
-
3545
3546
  const generateStagingData = (product = "invoice") => {
3546
3547
  const jobCompletionIndex = process.env.JOB_COMPLETION_INDEX;
3547
3548
  const dateTimeString = dayjs().format("DDMM-HHmm-ssSSS");
@@ -4584,6 +4585,29 @@ class CustomCommands {
4584
4585
  await alertBox.getByTestId(buttonSelector).click();
4585
4586
  await test$1.expect(alertBox).toBeHidden();
4586
4587
  };
4588
+ this.setSliderValue = async ({ parentLocator = this.page, valueAsPercent, startFromCenter = false, }) => {
4589
+ const sliderLocator = parentLocator.locator(COMMON_SELECTORS.antdSliderRail);
4590
+ await sliderLocator.evaluate(node => node.scrollIntoView({ behavior: "instant", block: "center" }));
4591
+ const sliderBoundingBox = await sliderLocator.boundingBox();
4592
+ let targetX = sliderBoundingBox.width * valueAsPercent;
4593
+ if (startFromCenter)
4594
+ targetX = targetX / 2;
4595
+ let sliderSourceX = sliderBoundingBox.x;
4596
+ if (startFromCenter)
4597
+ sliderSourceX += sliderBoundingBox.width / 2;
4598
+ const sliderSourceY = sliderBoundingBox.y + sliderBoundingBox.height / 2;
4599
+ await this.page.mouse.move(sliderSourceX, sliderSourceY, { steps: 5 });
4600
+ await this.page.mouse.down();
4601
+ await this.page.mouse.move(sliderSourceX + targetX, sliderSourceY, {
4602
+ steps: 5,
4603
+ });
4604
+ await this.page.mouse.up();
4605
+ };
4606
+ this.assertCardDetails = ({ cardLocator, title, description, }) => Promise.all([
4607
+ test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemHeading)).toHaveText(title),
4608
+ test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemDescription)).toHaveText(description),
4609
+ test$1.expect(this.page.getByTestId(COMMON_SELECTORS.sidebarSubLink(title))).toHaveCSS("background-color", COLOR.transparent),
4610
+ ]);
4587
4611
  this.page = page;
4588
4612
  this.responses = [];
4589
4613
  this.request = request;
@@ -188786,6 +188810,9 @@ const i18nFixture = {
188786
188810
 
188787
188811
  class AdminPanelPage {
188788
188812
  constructor(page, neetoPlaywrightUtilities) {
188813
+ /**
188814
+ * @deprecated This method is deprecated. Use assertCardDetails from neetoPlaywrightUtilities instead.
188815
+ */
188789
188816
  this.verifyAdminPanelCard = ({ cardLocator, title, description, }) => Promise.all([
188790
188817
  test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemHeading)).toHaveText(title),
188791
188818
  test$1.expect(cardLocator.getByTestId(ADMIN_PANEL_SELECTORS.settingsItemDescription)).toHaveText(description),
@@ -194208,6 +194235,7 @@ const unFreezeAllColumns = async ({ columnHeaders, columnOffset, page, t, }) =>
194208
194235
  for (let i = columnHeaders.length - 1; i >= columnOffset; i--) {
194209
194236
  const currentHeader = columnHeaders[i];
194210
194237
  await currentHeader.getByTestId(TABLE_SELECTORS.columnMenuButton).click();
194238
+ await test$1.expect(page.getByTestId(COMMON_SELECTORS.dropdownContainer)).toBeVisible();
194211
194239
  (await unFreezeColumnButton.isVisible())
194212
194240
  ? await unFreezeColumnButton.click()
194213
194241
  : await currentHeader