@bigbinary/neeto-playwright-commons 1.6.4 → 1.6.6

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.
@@ -8,6 +8,7 @@ const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "" }) => {
8
8
  "@bigbinary/neeto/no-missing-localization": "warn",
9
9
  "@bigbinary/neeto/use-standard-date-time-formats": "warn",
10
10
  "@bigbinary/neeto/no-dangling-constants": "off",
11
+ "@bigbinary/neeto/use-webpack-alias": "off",
11
12
  ...rules,
12
13
  },
13
14
  });
package/index.cjs.js CHANGED
@@ -8,12 +8,12 @@ var faker = require('@faker-js/faker');
8
8
  var ramda = require('ramda');
9
9
  var MailosaurClient = require('mailosaur');
10
10
  var dayjs = require('dayjs');
11
- var playwrightI18nextFixture = require('playwright-i18next-fixture');
12
11
  var require$$2 = require('os');
13
12
  var require$$0$1 = require('path');
14
13
  var require$$0$2 = require('util');
15
14
  var require$$0$3 = require('stream');
16
15
  var require$$0$4 = require('events');
16
+ var playwrightI18nextFixture = require('playwright-i18next-fixture');
17
17
  var require$$3 = require('crypto');
18
18
 
19
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -173,6 +173,9 @@ const COMMON_SELECTORS = {
173
173
  appSwitcherButton: "app-switcher-button",
174
174
  appSwitcherWrapper: "switcher-wrapper",
175
175
  tableSpinner: ".ant-spin",
176
+ pageLoader: "neeto-molecules-page-loader",
177
+ homeButton: "home-button",
178
+ neetoUiSwitch: "nui-switch",
176
179
  };
177
180
 
178
181
  class CustomCommands {
@@ -225,11 +228,12 @@ class CustomCommands {
225
228
  await this.page.reload();
226
229
  await reloadRequests;
227
230
  };
228
- this.apiRequest = async ({ url, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
231
+ this.apiRequest = async ({ url, failOnStatusCode = true, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
229
232
  const csrfToken = await this.page
230
233
  .locator("[name='csrf-token']")
231
234
  .getAttribute("content");
232
235
  const requestOptions = {
236
+ failOnStatusCode,
233
237
  headers: {
234
238
  ...additionalHeaders,
235
239
  "accept-encoding": "gzip",
@@ -327,7 +331,7 @@ const generateStagingData = (product = "invoice") => {
327
331
  subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
328
332
  email: IS_STAGING_ENV
329
333
  ? `cypresstest${otpBypassKey}+${product}+${timestamp}-playwright@bigbinary.com`
330
- : "oliver@example.com",
334
+ : CREDENTIALS.email,
331
335
  };
332
336
  };
333
337
 
@@ -7597,6 +7601,7 @@ const NEETO_EDITOR_SELECTORS = {
7597
7601
  undoOption: "neeto-editor-fixed-menu-undo-option",
7598
7602
  redoOption: "neeto-editor-fixed-menu-redo-option",
7599
7603
  imageWrapper: "neeto-editor-image-wrapper",
7604
+ contentField: "neeto-editor-content",
7600
7605
  };
7601
7606
 
7602
7607
  const NEETO_FILTERS_SELECTORS = {
@@ -7704,19 +7709,10 @@ const MERGE_TAGS_SELECTORS = {
7704
7709
  const initializeCredentials = (product) => {
7705
7710
  const { user } = readFileSyncIfExists();
7706
7711
  const stagingData = generateStagingData(product);
7707
- const newState = {
7708
- ...user,
7709
- businessName: (user === null || user === void 0 ? void 0 : user.businessName) || stagingData.businessName,
7710
- currentUserName: (user === null || user === void 0 ? void 0 : user.currentUserName) || stagingData.currentUserName,
7711
- email: (user === null || user === void 0 ? void 0 : user.email) || stagingData.email,
7712
- firstName: (user === null || user === void 0 ? void 0 : user.firstName) || stagingData.firstName,
7713
- lastName: (user === null || user === void 0 ? void 0 : user.lastName) || stagingData.lastName,
7714
- subdomainName: (user === null || user === void 0 ? void 0 : user.subdomainName) || stagingData.subdomainName,
7715
- skipSetup: user === null || user === void 0 ? void 0 : user.skipSetup,
7716
- };
7717
- writeDataToFile(JSON.stringify({ user: newState }, null, 2));
7712
+ const newUserState = ramda.mergeLeft(user, stagingData);
7713
+ writeDataToFile(JSON.stringify({ user: newUserState }, null, 2));
7718
7714
  if (IS_STAGING_ENV) {
7719
- const baseUrl = `https://${newState.subdomainName}.${stagingData.domain}`;
7715
+ const baseUrl = `https://${newUserState.subdomainName}.${stagingData.domain}`;
7720
7716
  process.env.BASE_URL = baseUrl;
7721
7717
  }
7722
7718
  };