@bigbinary/neeto-playwright-commons 1.6.5 → 1.6.7
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 +20 -18
- package/index.cjs.js.map +1 -1
- package/index.d.ts +6 -0
- package/index.js +21 -19
- package/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
:
|
|
334
|
+
: CREDENTIALS.email,
|
|
331
335
|
};
|
|
332
336
|
};
|
|
333
337
|
|
|
@@ -7233,11 +7237,13 @@ const KEYBOARD_SHORTCUTS_SELECTORS = {
|
|
|
7233
7237
|
hotKeyItem: "hotkey-item",
|
|
7234
7238
|
};
|
|
7235
7239
|
|
|
7236
|
-
/* eslint-disable playwright/
|
|
7240
|
+
/* eslint-disable playwright/no-raw-locators */
|
|
7237
7241
|
class HelpAndProfilePage {
|
|
7238
7242
|
constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
|
|
7243
|
+
this.hoverOnBody = () => this.page.locator("body").hover();
|
|
7239
7244
|
this.openHelpCenter = async () => {
|
|
7240
7245
|
await test.expect(async () => {
|
|
7246
|
+
await this.hoverOnBody();
|
|
7241
7247
|
const helpButton = this.page.getByTestId(CHAT_WIDGET_SELECTORS.helpButton);
|
|
7242
7248
|
await helpButton.scrollIntoViewIfNeeded();
|
|
7243
7249
|
await helpButton.hover();
|
|
@@ -7302,8 +7308,10 @@ class HelpAndProfilePage {
|
|
|
7302
7308
|
});
|
|
7303
7309
|
};
|
|
7304
7310
|
this.openChangelogPane = async () => {
|
|
7305
|
-
await
|
|
7306
|
-
|
|
7311
|
+
await test.expect(async () => {
|
|
7312
|
+
await this.page.getByTestId(HELP_CENTER_SELECTORS.whatsNewButton).click();
|
|
7313
|
+
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
|
|
7314
|
+
}).toPass({ timeout: 15000 });
|
|
7307
7315
|
};
|
|
7308
7316
|
this.openAndVerifyChangelog = async () => {
|
|
7309
7317
|
await test.test.step("Step 1: Open Help Center links", this.openHelpCenter);
|
|
@@ -7387,12 +7395,14 @@ class HelpAndProfilePage {
|
|
|
7387
7395
|
this.openAppSwitcherAndVerify = async () => {
|
|
7388
7396
|
const appSwitcher = this.page.getByTestId(COMMON_SELECTORS.appSwitcherButton);
|
|
7389
7397
|
await test.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test.expect(async () => {
|
|
7398
|
+
await this.hoverOnBody();
|
|
7390
7399
|
await appSwitcher.scrollIntoViewIfNeeded();
|
|
7391
7400
|
await appSwitcher.hover();
|
|
7392
7401
|
await test.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
7393
7402
|
}).toPass({ timeout: 15000 }));
|
|
7394
7403
|
};
|
|
7395
7404
|
this.openProfilePopup = () => test.expect(async () => {
|
|
7405
|
+
await this.hoverOnBody();
|
|
7396
7406
|
await this.profileSectionButton.scrollIntoViewIfNeeded();
|
|
7397
7407
|
await this.profileSectionButton.hover();
|
|
7398
7408
|
await test.expect(this.page.getByTestId(PROFILE_SECTION_SELECTORS.profilePopup)).toBeVisible();
|
|
@@ -7597,6 +7607,7 @@ const NEETO_EDITOR_SELECTORS = {
|
|
|
7597
7607
|
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
7598
7608
|
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
7599
7609
|
imageWrapper: "neeto-editor-image-wrapper",
|
|
7610
|
+
contentField: "neeto-editor-content",
|
|
7600
7611
|
};
|
|
7601
7612
|
|
|
7602
7613
|
const NEETO_FILTERS_SELECTORS = {
|
|
@@ -7704,19 +7715,10 @@ const MERGE_TAGS_SELECTORS = {
|
|
|
7704
7715
|
const initializeCredentials = (product) => {
|
|
7705
7716
|
const { user } = readFileSyncIfExists();
|
|
7706
7717
|
const stagingData = generateStagingData(product);
|
|
7707
|
-
const
|
|
7708
|
-
|
|
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));
|
|
7718
|
+
const newUserState = ramda.mergeLeft(user, stagingData);
|
|
7719
|
+
writeDataToFile(JSON.stringify({ user: newUserState }, null, 2));
|
|
7718
7720
|
if (IS_STAGING_ENV) {
|
|
7719
|
-
const baseUrl = `https://${
|
|
7721
|
+
const baseUrl = `https://${newUserState.subdomainName}.${stagingData.domain}`;
|
|
7720
7722
|
process.env.BASE_URL = baseUrl;
|
|
7721
7723
|
}
|
|
7722
7724
|
};
|