@bigbinary/neeto-playwright-commons 3.3.12 → 4.0.0

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.js CHANGED
@@ -4,16 +4,16 @@ import * as fs from 'fs';
4
4
  import fs__default, { readFileSync, promises, existsSync, writeFileSync, unlinkSync, mkdirSync, rmSync, createWriteStream } from 'fs';
5
5
  import os from 'os';
6
6
  import * as path from 'path';
7
- import path__default from 'path';
7
+ import path__default, { dirname } from 'path';
8
8
  import test, { expect, test as test$1, chromium as chromium$1, defineConfig, devices } from '@playwright/test';
9
9
  import { getI18nInstance, initI18n } from 'playwright-i18next-fixture';
10
10
  import { curry, isNotNil, not, isEmpty, pluck, mergeAll, isNil, mergeDeepLeft } from 'ramda';
11
11
  import { execSync, spawn } from 'child_process';
12
+ import require$$2$2, { fileURLToPath } from 'url';
12
13
  import dayjs from 'dayjs';
13
14
  import require$$1$3 from 'events';
14
15
  import require$$0$5 from 'assert';
15
16
  import require$$0$4 from 'util';
16
- import require$$2$2 from 'url';
17
17
  import require$$1$2 from 'tty';
18
18
  import require$$0$6 from 'stream';
19
19
  import require$$0$7 from 'crypto';
@@ -27,9 +27,9 @@ import require$$1$6 from 'node:stream';
27
27
  import require$$1$7 from 'zlib';
28
28
  import stealth$1 from 'puppeteer-extra-plugin-stealth';
29
29
  import { globSync } from 'node:fs';
30
- import customParseFormat from 'dayjs/plugin/customParseFormat';
31
- import timezone from 'dayjs/plugin/timezone';
32
- import utc from 'dayjs/plugin/utc';
30
+ import customParseFormat from 'dayjs/plugin/customParseFormat.js';
31
+ import timezone from 'dayjs/plugin/timezone.js';
32
+ import utc from 'dayjs/plugin/utc.js';
33
33
  import https from 'https';
34
34
  import * as http from 'http';
35
35
 
@@ -1108,6 +1108,30 @@ const generateStagingData = (product = "invoice") => {
1108
1108
  email,
1109
1109
  };
1110
1110
  };
1111
+ const DEFAULT_STAGING_ORGANIZATION_TTL_IN_DAYS = 3;
1112
+ const getStagingOrganizationTtlInDays = () => {
1113
+ const ttl = Number(process.env.STAGING_ORGANIZATION_TTL_IN_DAYS);
1114
+ return Number.isFinite(ttl) && ttl > 0
1115
+ ? ttl
1116
+ : DEFAULT_STAGING_ORGANIZATION_TTL_IN_DAYS;
1117
+ };
1118
+ const isStagingOrganizationExpired = (subdomainName) => {
1119
+ if (!subdomainName?.startsWith("cpt"))
1120
+ return false;
1121
+ const match = subdomainName.match(/-(\d{2})(\d{2})-(\d{2})(\d{2})-(\d{2})(\d{3})(?:-\d+)?$/);
1122
+ if (!match)
1123
+ return false;
1124
+ const [, day, month, hour, minute, second, millisecond] = match;
1125
+ const now = dayjs();
1126
+ // The subdomain timestamp does not include a year, so assume the current year.
1127
+ // If that places the creation date in the future, it was created last year.
1128
+ let createdAt = dayjs(`${now.year()}-${month}-${day}T${hour}:${minute}:${second}.${millisecond}`);
1129
+ if (!createdAt.isValid())
1130
+ return false;
1131
+ if (createdAt.isAfter(now))
1132
+ createdAt = createdAt.subtract(1, "year");
1133
+ return now.diff(createdAt, "day") >= getStagingOrganizationTtlInDays();
1134
+ };
1111
1135
 
1112
1136
  const execCommand = (command) => execSync(command)
1113
1137
  .toString("utf-8")
@@ -1126,6 +1150,7 @@ const readFileSyncIfExists = (path = STORAGE_STATE) => {
1126
1150
  return {};
1127
1151
  }
1128
1152
  };
1153
+ const getDirname = (metaUrl) => dirname(fileURLToPath(metaUrl));
1129
1154
  const getGlobalUserState = () => readFileSyncIfExists()?.user;
1130
1155
  const writeDataToFile = data => {
1131
1156
  try {
@@ -1142,11 +1167,12 @@ const updateCredentials = ({ key, value }) => {
1142
1167
  return writeDataToFile(JSON.stringify(data));
1143
1168
  };
1144
1169
  const removeCredentialFile = () => {
1145
- fs.unlink(STORAGE_STATE, error => {
1146
- if (!error)
1147
- return;
1170
+ try {
1171
+ fs.existsSync(STORAGE_STATE) && fs.unlinkSync(STORAGE_STATE);
1172
+ }
1173
+ catch (error) {
1148
1174
  console.log(error);
1149
- });
1175
+ }
1150
1176
  };
1151
1177
  const clearCredentials = () => {
1152
1178
  if (shouldSkipSetupAndTeardown())
@@ -1954,12 +1980,14 @@ const generateRandomFile = ({ sizeInKB, fileType, fileName = `sample.${fileType}
1954
1980
  return { file, fileName };
1955
1981
  };
1956
1982
 
1983
+ const __dirname$6 = getDirname(import.meta.url);
1957
1984
  const getImagePathAndName = (localImagePath) => {
1958
- const imagePath = path__default.join(__dirname, localImagePath);
1985
+ const imagePath = path__default.join(__dirname$6, localImagePath);
1959
1986
  const imageName = path__default.basename(localImagePath, path__default.extname(localImagePath));
1960
1987
  return { imagePath, imageName };
1961
1988
  };
1962
1989
 
1990
+ const __dirname$5 = getDirname(import.meta.url);
1963
1991
  class CustomCommands {
1964
1992
  page;
1965
1993
  t;
@@ -2132,7 +2160,7 @@ class CustomCommands {
2132
2160
  await expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toHaveAttribute("src", new RegExp(imageName), { timeout: 20_000 });
2133
2161
  };
2134
2162
  uploadFileViaDispatch = async ({ fileNameWithType, assetsPath = "../../../e2e/assets/", dispatchEvent = "drop", droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), }) => {
2135
- const filePath = path__default.join(__dirname, `${assetsPath}/${fileNameWithType}`);
2163
+ const filePath = path__default.join(__dirname$5, `${assetsPath}/${fileNameWithType}`);
2136
2164
  const buffer = readFileSync(filePath).toString("base64");
2137
2165
  const dataTransfer = await droppableZone.evaluateHandle((_, { buffer, fileNameWithType }) => {
2138
2166
  const dataTransfer = new DataTransfer();
@@ -119650,31 +119678,6 @@ class HelpAndProfilePage {
119650
119678
  })).toHaveScreenshot(expectedScreenshot, { maxDiffPixelRatio: 0.1 });
119651
119679
  });
119652
119680
  };
119653
- /**
119654
- * @deprecated This method is deprecated. Use updateBasicInfo instead.
119655
- */
119656
- updateProfile = async ({ firstName, lastName }) => {
119657
- await this.openHelpCenter();
119658
- await this.page
119659
- .getByTestId(PROFILE_SECTION_SELECTORS.myProfileButton)
119660
- .click();
119661
- await this.page
119662
- .getByTestId(COMMON_SELECTORS.pane)
119663
- .getByTestId(COMMON_SELECTORS.dropdownIcon)
119664
- .click();
119665
- await this.page.getByTestId(PROFILE_SECTION_SELECTORS.editBtn).click();
119666
- firstName &&
119667
- (await this.page
119668
- .getByTestId(PROFILE_SECTION_SELECTORS.firstNameTextField)
119669
- .fill(firstName));
119670
- lastName &&
119671
- (await this.page
119672
- .getByTestId(PROFILE_SECTION_SELECTORS.lastNameTextField)
119673
- .fill(lastName));
119674
- await this.page.getByTestId(PROFILE_SECTION_SELECTORS.submitButton).click();
119675
- await this.neetoPlaywrightUtilities.waitForPageLoad();
119676
- await expect(this.page.getByTestId(COMMON_SELECTORS.paneModalCrossIcon)).toBeHidden();
119677
- };
119678
119681
  }
119679
119682
 
119680
119683
  class MicrosoftPage extends IntegrationBase {
@@ -120005,32 +120008,6 @@ class SlackPage extends IntegrationBase {
120005
120008
  await nextButton.click();
120006
120009
  await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.inviteToWorkspaceSkipButton).click();
120007
120010
  };
120008
- /**
120009
- * @deprecated Use {@link SlackPage.archiveChannelViaAPI} instead. This flow
120010
- * drives the Slack web UI to permanently delete a channel and is brittle;
120011
- * `archiveChannelViaAPI` archives via the Slack Web API (requires
120012
- * `SLACK_BOT_TOKEN`).
120013
- */
120014
- deleteSlackChannel = async (channel) => {
120015
- const channelItem = this.slackWebappPage.locator(SLACK_SELECTORS.channelItems, { hasText: channel });
120016
- await channelItem.click({ button: "right" });
120017
- await this.slackWebappPageDataQa([
120018
- SLACK_DATA_QA_SELECTORS.menuItems,
120019
- SLACK_DATA_QA_SELECTORS.channelDetailsModal,
120020
- ]).click();
120021
- await expect(this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.channelDetailsModal)).toBeVisible();
120022
- await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.channelDetailsSettingsTab).click();
120023
- await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.skModalContent)
120024
- .getByRole("button", { name: SLACK_WEB_TEXTS.deleteThisChannel })
120025
- .click();
120026
- await this.slackWebappPage
120027
- .getByLabel(SLACK_WEB_TEXTS.permanentlyDeleteTheChannel)
120028
- .check();
120029
- await this.slackWebappPage
120030
- .getByRole("button", { name: SLACK_WEB_TEXTS.deleteChannel })
120031
- .click();
120032
- await expect(channelItem).toBeHidden();
120033
- };
120034
120011
  archiveChannelViaAPI = async (name) => {
120035
120012
  const response = await this.slackApi.listChannels();
120036
120013
  const { channels } = (await response?.json());
@@ -120342,7 +120319,7 @@ class ZapierPage extends IntegrationBase {
120342
120319
  message: TOASTR_MESSAGES.zapierApiKeyGenerated,
120343
120320
  });
120344
120321
  await this.page.getByTestId(COMMON_SELECTORS.copyToClipboardButton).click();
120345
- const apiKey = await this.page.evaluate(() => navigator.clipboard.readText());
120322
+ const apiKey = await getClipboardContent(this.page);
120346
120323
  await this.verifyIntegrationStatus();
120347
120324
  return apiKey;
120348
120325
  };
@@ -120479,6 +120456,7 @@ const LIST_MODIFIER_TAGS = {
120479
120456
  orderedList: "ol",
120480
120457
  };
120481
120458
 
120459
+ const __dirname$4 = getDirname(import.meta.url);
120482
120460
  class SlashCommandEditorPage {
120483
120461
  page;
120484
120462
  neetoPlaywrightUtilities;
@@ -120598,7 +120576,7 @@ class SlashCommandEditorPage {
120598
120576
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
120599
120577
  .click();
120600
120578
  const fileUploader = await fileUploaderPromise;
120601
- const imagePath = path.join(__dirname, filePath);
120579
+ const imagePath = path.join(__dirname$4, filePath);
120602
120580
  await fileUploader.setFiles(imagePath);
120603
120581
  await expect(this.imageWrapper).toBeVisible({ timeout: 15_000 });
120604
120582
  if (shouldRemoveImage) {
@@ -120673,6 +120651,7 @@ class SlashCommandEditorPage {
120673
120651
  };
120674
120652
  }
120675
120653
 
120654
+ const __dirname$3 = getDirname(import.meta.url);
120676
120655
  class EditorPage {
120677
120656
  page;
120678
120657
  neetoPlaywrightUtilities;
@@ -120903,7 +120882,7 @@ class EditorPage {
120903
120882
  isButtonInMoreMenu && (await this.moreMenuSelector.click());
120904
120883
  await this.editorAttachmentsButton.click();
120905
120884
  const fileUploader = await fileUploaderPromise;
120906
- const imagePath = path.join(__dirname, filePath);
120885
+ const imagePath = path.join(__dirname$3, filePath);
120907
120886
  await fileUploader.setFiles(imagePath);
120908
120887
  await expect(this.attachmentPreview).toBeVisible();
120909
120888
  if (shouldRemoveAttachment) {
@@ -120929,7 +120908,7 @@ class EditorPage {
120929
120908
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
120930
120909
  .click();
120931
120910
  const fileUploader = await fileUploaderPromise;
120932
- const imagePath = path.join(__dirname, filePath);
120911
+ const imagePath = path.join(__dirname$3, filePath);
120933
120912
  await fileUploader.setFiles(imagePath);
120934
120913
  await expect(this.imageWrapper).toBeVisible({ timeout: 15_000 });
120935
120914
  if (shouldRemoveImage) {
@@ -121036,7 +121015,7 @@ class EditorPage {
121036
121015
  .getByTestId(NEETO_EDITOR_SELECTORS.imageUploadButton)
121037
121016
  .click();
121038
121017
  const fileUploader = await fileUploaderPromise;
121039
- const imagePath = path.join(__dirname, filePath);
121018
+ const imagePath = path.join(__dirname$3, filePath);
121040
121019
  await fileUploader.setFiles(imagePath);
121041
121020
  await expect(this.page.getByRole("figure")).toBeVisible({
121042
121021
  timeout: 20_000,
@@ -122620,19 +122599,15 @@ const PHONE_NUMBER_FORMATS = [
122620
122599
  const initializeCredentials = (product) => {
122621
122600
  if (process.env.SKIP_SETUP === "true" && getGlobalUserState()) {
122622
122601
  const { email } = getGlobalUserState();
122623
- if (IS_STAGING_ENV) {
122624
- email.endsWith("example.com") && removeCredentialFile();
122625
- }
122626
- else {
122627
- email.endsWith("bigbinary.com") && removeCredentialFile();
122628
- }
122602
+ const domain = IS_STAGING_ENV ? "example.com" : "bigbinary.com";
122603
+ email.endsWith(domain) && removeCredentialFile();
122629
122604
  readFileSyncIfExists();
122630
122605
  }
122606
+ isStagingOrganizationExpired(getGlobalUserState()?.subdomainName) &&
122607
+ removeCredentialFile();
122631
122608
  const skipSetup = shouldSkipSetupAndTeardown();
122632
122609
  if (skipSetup) {
122633
- if (IS_STAGING_ENV) {
122634
- process.env.BASE_URL = getGlobalUserState()?.baseUrl;
122635
- }
122610
+ IS_STAGING_ENV && (process.env.BASE_URL = getGlobalUserState()?.baseUrl);
122636
122611
  return;
122637
122612
  }
122638
122613
  const stagingData = generateStagingData(product);
@@ -125790,10 +125765,8 @@ async function warmup({ urls = DEFAULT_WARMUP_URLS, timeout = 60_000, } = {}) {
125790
125765
  try {
125791
125766
  for (const url of urls) {
125792
125767
  const fullUrl = url.startsWith("http") ? url : `${baseURL}${url}`;
125793
- await page.goto(fullUrl, {
125794
- waitUntil: "networkidle", // eslint-disable-line playwright/no-networkidle
125795
- timeout,
125796
- });
125768
+ // eslint-disable-next-line playwright/no-networkidle
125769
+ await page.goto(fullUrl, { waitUntil: "networkidle", timeout });
125797
125770
  }
125798
125771
  }
125799
125772
  finally {
@@ -125808,7 +125781,8 @@ const CONFIG$1 = {
125808
125781
  MAX_WAIT_MS: 120_000,
125809
125782
  EMAIL_INIT: "/tmp/neeto-auth-web/config/initializers/playwright_email_capture.rb",
125810
125783
  };
125811
- const SCRIPTS_DIR$1 = path.join(__dirname, "scripts", "neeto-auth");
125784
+ const __dirname$2 = getDirname(import.meta.url);
125785
+ const SCRIPTS_DIR$1 = path.join(__dirname$2, "scripts", "neeto-auth");
125812
125786
  const escapeRubyString = (value) => value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
125813
125787
  const buildEmailCaptureInitializer = (targetApp) => {
125814
125788
  const template = fs.readFileSync(path.join(SCRIPTS_DIR$1, "playwright_email_capture.rb.template"), "utf-8");
@@ -125968,7 +125942,8 @@ const CONFIG = {
125968
125942
  };
125969
125943
  const DEFAULT_STATE = { pid: null, refCount: 0 };
125970
125944
  const WIDGET_BASE_URL = `http://localhost:${CONFIG.PORT}`;
125971
- const SCRIPTS_DIR = path.join(__dirname, "scripts", "neeto-chat-widget");
125945
+ const __dirname$1 = getDirname(import.meta.url);
125946
+ const SCRIPTS_DIR = path.join(__dirname$1, "scripts", "neeto-chat-widget");
125972
125947
  const log = (msg) => console.log(`[NeetoChatWidget] ${msg}`);
125973
125948
  const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
125974
125949
  const httpCheck = (timeout = 3000) => new Promise(resolve => {
@@ -126285,17 +126260,17 @@ class EmailDeliveryUtils {
126285
126260
  };
126286
126261
  }
126287
126262
 
126288
- var main$1 = {exports: {}};
126263
+ var main = {exports: {}};
126289
126264
 
126290
126265
  var version = "17.3.1";
126291
126266
  var require$$4 = {
126292
126267
  version: version};
126293
126268
 
126294
- var hasRequiredMain$1;
126269
+ var hasRequiredMain;
126295
126270
 
126296
- function requireMain$1 () {
126297
- if (hasRequiredMain$1) return main$1.exports;
126298
- hasRequiredMain$1 = 1;
126271
+ function requireMain () {
126272
+ if (hasRequiredMain) return main.exports;
126273
+ hasRequiredMain = 1;
126299
126274
  const fs = fs__default;
126300
126275
  const path = path__default;
126301
126276
  const os$1 = os;
@@ -126718,130 +126693,20 @@ function requireMain$1 () {
126718
126693
  populate
126719
126694
  };
126720
126695
 
126721
- main$1.exports.configDotenv = DotenvModule.configDotenv;
126722
- main$1.exports._configVault = DotenvModule._configVault;
126723
- main$1.exports._parseVault = DotenvModule._parseVault;
126724
- main$1.exports.config = DotenvModule.config;
126725
- main$1.exports.decrypt = DotenvModule.decrypt;
126726
- main$1.exports.parse = DotenvModule.parse;
126727
- main$1.exports.populate = DotenvModule.populate;
126728
-
126729
- main$1.exports = DotenvModule;
126730
- return main$1.exports;
126731
- }
126732
-
126733
- var mainExports$1 = requireMain$1();
126734
- var dotenv = /*@__PURE__*/getDefaultExportFromCjs(mainExports$1);
126735
-
126736
- var main = {};
126737
-
126738
- var hasRequiredMain;
126739
-
126740
- function requireMain () {
126741
- if (hasRequiredMain) return main;
126742
- hasRequiredMain = 1;
126743
-
126744
- function _resolveEscapeSequences (value) {
126745
- return value.replace(/\\\$/g, '$')
126746
- }
126747
-
126748
- function expandValue (value, processEnv, runningParsed) {
126749
- const env = { ...runningParsed, ...processEnv }; // process.env wins
126750
-
126751
- const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
126752
-
126753
- let result = value;
126754
- let match;
126755
- const seen = new Set(); // self-referential checker
126756
-
126757
- while ((match = regex.exec(result)) !== null) {
126758
- seen.add(result);
126759
-
126760
- const [template, bracedExpression, unbracedExpression] = match;
126761
- const expression = bracedExpression || unbracedExpression;
126762
-
126763
- // match the operators `:+`, `+`, `:-`, and `-`
126764
- const opRegex = /(:\+|\+|:-|-)/;
126765
- // find first match
126766
- const opMatch = expression.match(opRegex);
126767
- const splitter = opMatch ? opMatch[0] : null;
126768
-
126769
- const r = expression.split(splitter);
126770
-
126771
- let defaultValue;
126772
- let value;
126773
-
126774
- const key = r.shift();
126775
-
126776
- if ([':+', '+'].includes(splitter)) {
126777
- defaultValue = env[key] ? r.join(splitter) : '';
126778
- value = null;
126779
- } else {
126780
- defaultValue = r.join(splitter);
126781
- value = env[key];
126782
- }
126783
-
126784
- if (value) {
126785
- // self-referential check
126786
- if (seen.has(value)) {
126787
- result = result.replace(template, defaultValue);
126788
- } else {
126789
- result = result.replace(template, value);
126790
- }
126791
- } else {
126792
- result = result.replace(template, defaultValue);
126793
- }
126794
-
126795
- // if the result equaled what was in process.env and runningParsed then stop expanding
126796
- if (result === runningParsed[key]) {
126797
- break
126798
- }
126799
-
126800
- regex.lastIndex = 0; // reset regex search position to re-evaluate after each replacement
126801
- }
126802
-
126803
- return result
126804
- }
126805
-
126806
- function expand (options) {
126807
- // for use with progressive expansion
126808
- const runningParsed = {};
126809
-
126810
- let processEnv = process.env;
126811
- if (options && options.processEnv != null) {
126812
- processEnv = options.processEnv;
126813
- }
126814
-
126815
- // dotenv.config() ran before this so the assumption is process.env has already been set
126816
- for (const key in options.parsed) {
126817
- let value = options.parsed[key];
126818
-
126819
- // short-circuit scenario: process.env was already set prior to the file value
126820
- if (processEnv[key] && processEnv[key] !== value) {
126821
- value = processEnv[key];
126822
- } else {
126823
- value = expandValue(value, processEnv, runningParsed);
126824
- }
126825
-
126826
- options.parsed[key] = _resolveEscapeSequences(value);
126827
-
126828
- // for use with progressive expansion
126829
- runningParsed[key] = _resolveEscapeSequences(value);
126830
- }
126831
-
126832
- for (const processKey in options.parsed) {
126833
- processEnv[processKey] = options.parsed[processKey];
126834
- }
126835
-
126836
- return options
126837
- }
126696
+ main.exports.configDotenv = DotenvModule.configDotenv;
126697
+ main.exports._configVault = DotenvModule._configVault;
126698
+ main.exports._parseVault = DotenvModule._parseVault;
126699
+ main.exports.config = DotenvModule.config;
126700
+ main.exports.decrypt = DotenvModule.decrypt;
126701
+ main.exports.parse = DotenvModule.parse;
126702
+ main.exports.populate = DotenvModule.populate;
126838
126703
 
126839
- main.expand = expand;
126840
- return main;
126704
+ main.exports = DotenvModule;
126705
+ return main.exports;
126841
126706
  }
126842
126707
 
126843
126708
  var mainExports = requireMain();
126844
- var dotenvExpand = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
126709
+ var dotenv = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
126845
126710
 
126846
126711
  const E2E_TEST_DIR = "e2e/tests";
126847
126712
  const LOG_PREFIX = "[playwright.config]";
@@ -126902,11 +126767,11 @@ const parseSpecPatterns = () => {
126902
126767
  };
126903
126768
 
126904
126769
  // @ts-check
126905
- const loadEnv = (path) => dotenvExpand.expand(dotenv.config({ path, quiet: true }));
126906
126770
  const envBasePath = "./e2e/config/.env";
126907
126771
  const envLocalPath = `${envBasePath}.local`;
126908
126772
  const reporterPackageName = "@bigbinary/neeto-playwright-reporter";
126909
126773
  process.env.TEST_ENV = process.env.TEST_ENV ?? ENVIRONMENT.development;
126774
+ const loadEnv = (path) => dotenv.config({ path, quiet: true });
126910
126775
  loadEnv(`${envBasePath}.${process.env.TEST_ENV}`);
126911
126776
  fs.existsSync(envLocalPath) && loadEnv(envLocalPath);
126912
126777
  const playdashStagingConfig = {
@@ -127110,5 +126975,4 @@ const definePlaywrightConfig = (overrides) => {
127110
126975
  });
127111
126976
  };
127112
126977
 
127113
- export { ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_KEYS_SELECTORS, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, ApiKeysApi, ApiKeysPage, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, ColorPickerUtils, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXAMPLE_URL, EXPANDED_FONT_SIZE, EXPORT_FILE_TYPES, EditorPage, EmailDeliveryUtils, EmbedBase, FILE_FORMATS, FONTS_RESOURCES, FONT_SIZE_SELECTORS, FROM_EMAIL_ENV_KEYS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_ANALYTICS_SELECTORS, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GOOGLE_SHEETS_SELECTORS, GooglePage, HELP_CENTER_ROUTES, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IPRestrictionsPage, IP_RESTRICTIONS_SELECTORS, IS_CI, IS_DEV_ENV, IS_STAGING_ENV, ImageUploader, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, Member, MemberApis, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoAuthServer, NeetoChatWidget, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PRODUCT_ROLES_ROUTE_MAP, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RailsEmailApiClient, RailsEmailUtils, RoleApis, RolesPage, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEAM_MEMBER_TEXTS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THEMES_TEXTS, THIRD_PARTY_RESOURCES, THIRD_PARTY_ROUTES, TIME_RANGES, TOASTR_MESSAGES, TWILIO_SELECTORS, TagsApi, TagsPage, TeamMembers, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WEBHOOK_SELECTORS, WebhookSiteApi, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, fillCredentialsAndSubmit, filterUtils, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getFormattedPhoneNumber, getFullUrl, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, warmup, withCookieCache, writeDataToFile };
127114
- //# sourceMappingURL=index.js.map
126978
+ export { ACTIONS, ADMIN_PANEL_SELECTORS, ALL_RESOURCES, ANALYTICS_RESOURCES, API_KEYS_SELECTORS, API_ROUTES, APP_RESOURCES, AUDIT_LOGS_SELECTORS, ApiKeysApi, ApiKeysPage, AuditLogsPage, BASE_URL, CALENDAR_LABELS, CERTIFICATE_LIMIT_EXCEEDED_MESSAGE, CERTIFICATE_LIMIT_EXCEEDED_REGEXP, CHANGELOG_WIDGET_SELECTORS, CHAT_WIDGET_SELECTORS, CHAT_WIDGET_TEXTS, COLOR, COMMON_SELECTORS, COMMON_TEXTS, COMMUNITY_TEXTS, CREDENTIALS, CURRENT_TIME_RANGES, CUSTOM_DOMAIN_SELECTORS, CUSTOM_DOMAIN_SUFFIX, ColorPickerUtils, CustomCommands, CustomDomainApi, CustomDomainPage, DATE_FORMATS, DATE_PICKER_SELECTORS, DATE_RANGES, DATE_TEXTS, DEFAULT_WEBHOOKS_RESPONSE_TEXT, DESCRIPTION_EDITOR_TEXTS, EMBED_SELECTORS, EMOJI_LABEL, EMPTY_STORAGE_STATE, ENGAGE_TEXTS, ENVIRONMENT, EXAMPLE_URL, EXPANDED_FONT_SIZE, EXPORT_FILE_TYPES, EditorPage, EmailDeliveryUtils, EmbedBase, FILE_FORMATS, FONTS_RESOURCES, FONT_SIZE_SELECTORS, FROM_EMAIL_ENV_KEYS, GLOBAL_TRANSLATIONS_PATTERN, GOOGLE_ANALYTICS_SELECTORS, GOOGLE_CALENDAR_DATE_FORMAT, GOOGLE_LOGIN_SELECTORS, GOOGLE_LOGIN_TEXTS, GOOGLE_SHEETS_SELECTORS, GooglePage, HELP_CENTER_ROUTES, HELP_CENTER_SELECTORS, HelpAndProfilePage, INTEGRATIONS_TEXTS, INTEGRATION_SELECTORS, IPRestrictionsPage, IP_RESTRICTIONS_SELECTORS, IS_CI, IS_DEV_ENV, IS_STAGING_ENV, ImageUploader, IntegrationBase, IpRestrictionsApi, KEYBOARD_SHORTCUTS_SELECTORS, KEYBOARD_SHORTCUT_TEST_CASES, LIST_MODIFIER_SELECTORS, LIST_MODIFIER_TAGS, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MEMBER_TEXTS, MERGE_TAGS_SELECTORS, MICROSOFT_LOGIN_SELECTORS, MICROSOFT_LOGIN_TEXTS, MailerUtils, Member, MemberApis, MicrosoftPage, NEETO_AUTH_BASE_URL, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, NEETO_IMAGE_UPLOADER_SELECTORS, NEETO_ROUTES, NEETO_SEO_SELECTORS, NEETO_TEXT_MODIFIER_SELECTORS, NeetoAuthServer, NeetoChatWidget, NeetoEmailDeliveryApi, NeetoTowerApi, ONBOARDING_SELECTORS, ORGANIZATION_TEXTS, OTP_EMAIL_PATTERN, OrganizationPage, PAST_TIME_RANGES, PHONE_NUMBER_FORMATS, PLURAL, PRODUCT_ROLES_ROUTE_MAP, PROFILE_LINKS, PROFILE_SECTION_SELECTORS, PROJECT_NAMES, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, RailsEmailApiClient, RailsEmailUtils, RoleApis, RolesPage, SIGNUP_SELECTORS, SINGULAR, SLACK_DATA_QA_SELECTORS, SLACK_DEFAULT_CHANNEL, SLACK_SELECTORS, SLACK_WEB_TEXTS, STATUS_TEXTS, STORAGE_STATE, SecurityApi, SidebarSection, SlackApi, SlackPage, TABLE_SELECTORS, TAB_SELECTORS, TAGS_SELECTORS, TEAM_MEMBER_TEXTS, TEXT_MODIFIER_ROLES, TEXT_MODIFIER_SELECTORS, TEXT_MODIFIER_TAGS, THANK_YOU_SELECTORS, THEMES_SELECTORS, THEMES_TEXTS, THIRD_PARTY_RESOURCES, THIRD_PARTY_ROUTES, TIME_RANGES, TOASTR_MESSAGES, TWILIO_SELECTORS, TagsApi, TagsPage, TeamMembers, ThankYouApi, ThankYouPage, TwilioApi, USER_AGENTS, WEBHOOK_SELECTORS, WebhookSiteApi, WebhooksPage, ZAPIER_LIMIT_EXHAUSTED_MESSAGE, ZAPIER_SELECTORS, ZAPIER_TEST_EMAIL, ZAPIER_WEB_TEXTS, ZapierPage, baseURLGenerator, basicHTMLContent, clearCredentials, commands, cpuThrottlingUsingCDP, createOrganizationViaRake, currencyUtils, dataQa, decodeQRCodeFromFile, definePlaywrightConfig, executeWithThrottledResources, extractSubdomainFromError, fillCredentialsAndSubmit, filterUtils, generatePhoneNumber, generatePhoneNumberDetails, generateRandomBypassEmail, generateRandomFile, generateStagingData, getByDataQA, getClipboardContent, getDirname, getFormattedPhoneNumber, getFullUrl, getGlobalUserProps, getGlobalUserState, getImagePathAndName, getIsoCodeFromPhoneCode, getListCount, globalShortcuts, grantClipboardPermissions, hexToRGB, hexToRGBA, i18nFixture, imageRegex, initializeCredentials, initializeTestData, initializeTotp, isGithubIssueOpen, isStagingOrganizationExpired, joinHyphenCase, joinString, login, loginWithoutSSO, networkConditions, networkThrottlingUsingCDP, readFileSyncIfExists, removeCredentialFile, serializeFileForBrowser, shouldSkipCustomDomainSetup, shouldSkipSetupAndTeardown, simulateClickWithDelay, simulateTypingWithDelay, skipTest, squish, stealth as stealthTest, tableUtils, toCamelCase, updateCredentials, warmup, withCookieCache, writeDataToFile };
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-playwright-commons",
3
- "version": "3.3.12",
3
+ "version": "4.0.0",
4
4
  "description": "A package encapsulating common playwright code across neeto projects.",
5
5
  "repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
6
6
  "license": "apache-2.0",
7
- "main": "./index.cjs.js",
8
- "module": "./index.js",
9
- "types": "./index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./index.d.ts",
11
+ "import": "./index.js"
12
+ },
13
+ "./configs/*": "./configs/*"
14
+ },
10
15
  "scripts": {
11
16
  "prepare": "husky install",
12
17
  "build": "NODE_ENV=production tsc && rollup -c rollup.config.mjs && yarn build:jsdoc",
@@ -85,7 +90,6 @@
85
90
  "@bigbinary/neeto-commons-frontend": "^4.13.120",
86
91
  "countries-list": "^3.3.0",
87
92
  "dotenv": "17.3.1",
88
- "dotenv-expand": "12.0.3",
89
93
  "ioredis": "^5.4.1",
90
94
  "jimp": "1.6.0",
91
95
  "jsqr": "1.4.0",