@bigbinary/neeto-playwright-commons 1.2.0 → 1.3.1
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 +423 -147
- package/index.cjs.js.map +1 -1
- package/index.d.ts +197 -33
- package/index.js +395 -130
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var test = require('@playwright/test');
|
|
6
|
-
var dayjs = require('dayjs');
|
|
7
6
|
var require$$0$3 = require('fs');
|
|
8
7
|
var require$$2 = require('os');
|
|
9
8
|
var require$$0 = require('path');
|
|
@@ -11,29 +10,30 @@ var require$$0$1 = require('util');
|
|
|
11
10
|
var require$$0$2 = require('stream');
|
|
12
11
|
var require$$0$4 = require('events');
|
|
13
12
|
var ramda = require('ramda');
|
|
13
|
+
var dayjs = require('dayjs');
|
|
14
|
+
var require$$0$5 = require('i18next');
|
|
14
15
|
var require$$3 = require('crypto');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
18
19
|
function _interopNamespace(e) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
if (e && e.__esModule) return e;
|
|
21
|
+
var n = Object.create(null);
|
|
22
|
+
if (e) {
|
|
23
|
+
Object.keys(e).forEach(function (k) {
|
|
24
|
+
if (k !== 'default') {
|
|
25
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
26
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return e[k]; }
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
n["default"] = e;
|
|
34
|
+
return Object.freeze(n);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
37
37
|
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
|
|
38
38
|
var require$$0__namespace = /*#__PURE__*/_interopNamespace(require$$0$3);
|
|
39
39
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
@@ -41,130 +41,10 @@ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
|
41
41
|
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
42
42
|
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
43
43
|
var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
|
|
44
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
45
|
+
var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5);
|
|
44
46
|
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);
|
|
45
47
|
|
|
46
|
-
const COMMON_SELECTORS = {
|
|
47
|
-
toastMessage: "toastr-message-container",
|
|
48
|
-
toastIcon: ".Toastify__toast-icon",
|
|
49
|
-
toastCloseButton: "toastr-close-button",
|
|
50
|
-
dropdownIcon: "nui-dropdown-icon",
|
|
51
|
-
checkbox: "nui-checkbox-input",
|
|
52
|
-
spinner: ".neeto-ui-spinner",
|
|
53
|
-
input: "nui-input-field",
|
|
54
|
-
alertModalSubmitButton: "alert-submit-button",
|
|
55
|
-
selectContainer: "nui-select-container",
|
|
56
|
-
subheaderText: "subheader-left",
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
class CustomCommands {
|
|
60
|
-
constructor(page, request) {
|
|
61
|
-
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse((response) => {
|
|
62
|
-
var _a, _b, _c;
|
|
63
|
-
if (response.request().resourceType() === "xhr" &&
|
|
64
|
-
response.status() === 200 &&
|
|
65
|
-
response.url().includes(responseUrl) &&
|
|
66
|
-
response
|
|
67
|
-
.url()
|
|
68
|
-
.startsWith((_a = baseUrl !== null && baseUrl !== void 0 ? baseUrl : process.env.BASE_URL) !== null && _a !== void 0 ? _a : "") &&
|
|
69
|
-
!this.responses.includes((_b = response.headers()) === null || _b === void 0 ? void 0 : _b["x-request-id"])) {
|
|
70
|
-
this.responses.push((_c = response.headers()) === null || _c === void 0 ? void 0 : _c["x-request-id"]);
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}, { timeout: 10000 })));
|
|
75
|
-
this.recursiveMethod = async (callback, condition, timeout, startTime) => {
|
|
76
|
-
if (Date.now() - timeout >= startTime) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
else if (await condition()) {
|
|
80
|
-
return await callback();
|
|
81
|
-
}
|
|
82
|
-
return await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
83
|
-
};
|
|
84
|
-
this.executeRecursively = async ({ callback, condition, timeout = 5000, }) => {
|
|
85
|
-
const startTime = Date.now();
|
|
86
|
-
await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
87
|
-
};
|
|
88
|
-
this.verifySuccessToast = async ({ message, closeAfterVerification = true, }) => {
|
|
89
|
-
if (message) {
|
|
90
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toHaveValue(message);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toHaveValue("👍");
|
|
94
|
-
closeAfterVerification &&
|
|
95
|
-
(await this.page
|
|
96
|
-
.getByTestId(COMMON_SELECTORS.toastCloseButton)
|
|
97
|
-
.click());
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
this.reloadAndWait = async (requestCount) => {
|
|
101
|
-
const reloadRequests = this.interceptMultipleResponses({
|
|
102
|
-
times: requestCount,
|
|
103
|
-
});
|
|
104
|
-
await this.page.reload();
|
|
105
|
-
await reloadRequests;
|
|
106
|
-
};
|
|
107
|
-
this.apiRequest = async ({ url, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
108
|
-
const csrfToken = await this.page
|
|
109
|
-
.locator("[name='csrf-token']")
|
|
110
|
-
.getAttribute("content");
|
|
111
|
-
const requestOptions = {
|
|
112
|
-
headers: {
|
|
113
|
-
...additionalHeaders,
|
|
114
|
-
"accept-encoding": "gzip",
|
|
115
|
-
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
116
|
-
},
|
|
117
|
-
data,
|
|
118
|
-
params,
|
|
119
|
-
...otherOptions,
|
|
120
|
-
};
|
|
121
|
-
const httpMethodsHandlers = {
|
|
122
|
-
get: () => this.request.get(url, requestOptions),
|
|
123
|
-
post: () => this.request.post(url, requestOptions),
|
|
124
|
-
put: () => this.request.put(url, requestOptions),
|
|
125
|
-
delete: () => this.request.delete(url, requestOptions),
|
|
126
|
-
};
|
|
127
|
-
return await httpMethodsHandlers[method]();
|
|
128
|
-
};
|
|
129
|
-
this.verifyFieldValue = values => {
|
|
130
|
-
const verifyEachFieldValue = ({ field, value, }) => test.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
131
|
-
return Array.isArray(values)
|
|
132
|
-
? Promise.all(values.map(value => verifyEachFieldValue(value)))
|
|
133
|
-
: verifyEachFieldValue(values);
|
|
134
|
-
};
|
|
135
|
-
this.page = page;
|
|
136
|
-
this.responses = [];
|
|
137
|
-
this.request = request;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const commands = {
|
|
142
|
-
neetoPlaywrightUtilities: async ({ page, request }, use) => {
|
|
143
|
-
const commands = new CustomCommands(page, request);
|
|
144
|
-
await use(commands);
|
|
145
|
-
},
|
|
146
|
-
page: async ({ page }, use) => {
|
|
147
|
-
await page.goto("/");
|
|
148
|
-
await page.waitForLoadState();
|
|
149
|
-
await use(page);
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const ENVIRONMENT = {
|
|
154
|
-
development: "development",
|
|
155
|
-
staging: "staging",
|
|
156
|
-
review: "review",
|
|
157
|
-
};
|
|
158
|
-
const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
159
|
-
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
160
|
-
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
161
|
-
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
162
|
-
const CREDENTIALS = {
|
|
163
|
-
name: "Oliver Smith",
|
|
164
|
-
email: "oliver@example.com",
|
|
165
|
-
password: "welcome",
|
|
166
|
-
};
|
|
167
|
-
|
|
168
48
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
169
49
|
|
|
170
50
|
var tasks = {};
|
|
@@ -6863,6 +6743,21 @@ function assertPatternsInput(input) {
|
|
|
6863
6743
|
}
|
|
6864
6744
|
var out = FastGlob;
|
|
6865
6745
|
|
|
6746
|
+
const ENVIRONMENT = {
|
|
6747
|
+
development: "development",
|
|
6748
|
+
staging: "staging",
|
|
6749
|
+
review: "review",
|
|
6750
|
+
};
|
|
6751
|
+
const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
6752
|
+
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
6753
|
+
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
6754
|
+
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
6755
|
+
const CREDENTIALS = {
|
|
6756
|
+
name: "Oliver Smith",
|
|
6757
|
+
email: "oliver@example.com",
|
|
6758
|
+
password: "welcome",
|
|
6759
|
+
};
|
|
6760
|
+
|
|
6866
6761
|
const joinString = (string1, string2, string3 = "", separator = " ") => {
|
|
6867
6762
|
if (string3 === "") {
|
|
6868
6763
|
return string1 + separator + string2;
|
|
@@ -6907,6 +6802,166 @@ const readTranslations = () => {
|
|
|
6907
6802
|
});
|
|
6908
6803
|
return translations;
|
|
6909
6804
|
};
|
|
6805
|
+
const hyphenize = input => {
|
|
6806
|
+
const fallbackString = "";
|
|
6807
|
+
if (typeof input === "number")
|
|
6808
|
+
return String(input);
|
|
6809
|
+
if (input && typeof input === "string" && input.replace) {
|
|
6810
|
+
return input
|
|
6811
|
+
.replace(/[\s_]/g, "-")
|
|
6812
|
+
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
6813
|
+
.replace(/-+/g, "-")
|
|
6814
|
+
.toLowerCase();
|
|
6815
|
+
}
|
|
6816
|
+
return fallbackString;
|
|
6817
|
+
};
|
|
6818
|
+
const joinHyphenCase = (...args) => args.join(" ").replace(/\s+/g, "-").toLowerCase();
|
|
6819
|
+
|
|
6820
|
+
const COMMON_SELECTORS = {
|
|
6821
|
+
spinner: ".neeto-ui-spinner",
|
|
6822
|
+
subheaderText: "subheader-left",
|
|
6823
|
+
alertTitle: "alert-title",
|
|
6824
|
+
alertModalMessage: "alert-message",
|
|
6825
|
+
alertModalSubmitButton: "alert-submit-button",
|
|
6826
|
+
checkbox: "nui-checkbox-input",
|
|
6827
|
+
checkboxLabel: "nui-checkbox-label",
|
|
6828
|
+
dropdownContainer: "nui-dropdown-container",
|
|
6829
|
+
dropdownIcon: "nui-dropdown-icon",
|
|
6830
|
+
heading: "main-header",
|
|
6831
|
+
paneBody: "pane-body",
|
|
6832
|
+
paneHeader: "pane-header",
|
|
6833
|
+
profileSidebar: "profile-section",
|
|
6834
|
+
selectOption: (label) => `${hyphenize(label)}-select-option`,
|
|
6835
|
+
toastMessage: "toastr-message-container",
|
|
6836
|
+
toastCloseButton: "toastr-close-button",
|
|
6837
|
+
windowAlert: "#alert-box",
|
|
6838
|
+
body: "body",
|
|
6839
|
+
toastIcon: ".Toastify__toast-icon",
|
|
6840
|
+
paneModalCrossIcon: "pane-close-button",
|
|
6841
|
+
inputField: "nui-input-field",
|
|
6842
|
+
alertConfirmationText: "alert-confirmation-text",
|
|
6843
|
+
alertCancelButton: "alert-cancel-button",
|
|
6844
|
+
alertModalCrossIcon: "modal-close-button",
|
|
6845
|
+
saveChangesButton: "save-changes-button",
|
|
6846
|
+
cancelButton: "cancel-button",
|
|
6847
|
+
inputFieldError: "nui-input-error",
|
|
6848
|
+
selectDropDownError: "nui-select-error",
|
|
6849
|
+
subTitleHeading: "menubar-subtitle-heading",
|
|
6850
|
+
noDataTitle: "no-data-title",
|
|
6851
|
+
noDataDescription: "no-data-description",
|
|
6852
|
+
backdrop: "neeto-backdrop",
|
|
6853
|
+
menuBarHeading: "menubar-heading",
|
|
6854
|
+
dropdownWrapper: "nui-select-container-wrapper",
|
|
6855
|
+
toggleButton: "menubar-toggle-button",
|
|
6856
|
+
tooltip: "tooltip-box",
|
|
6857
|
+
articlePageTitle: ".serene-article__title",
|
|
6858
|
+
tabItem: "tab-item",
|
|
6859
|
+
labelInputError: "label-input-error",
|
|
6860
|
+
urlInputError: "url-input-error",
|
|
6861
|
+
noDataPrimaryButton: "no-data-primary-button",
|
|
6862
|
+
modalHeader: "modal-header",
|
|
6863
|
+
nameInputError: "name-input-error",
|
|
6864
|
+
selectContainer: "nui-select-container",
|
|
6865
|
+
dropdownMenu: "nui-select-menu",
|
|
6866
|
+
sidebarToggle: "neeto-molecules-sidebar-toggler",
|
|
6867
|
+
subheader: "subheader",
|
|
6868
|
+
settingsLink: "Settings",
|
|
6869
|
+
ticketFieldTextInput: (label) => `${hyphenize(label)}-text-input`,
|
|
6870
|
+
};
|
|
6871
|
+
|
|
6872
|
+
class CustomCommands {
|
|
6873
|
+
constructor(page, request) {
|
|
6874
|
+
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse((response) => {
|
|
6875
|
+
var _a, _b, _c;
|
|
6876
|
+
if (response.request().resourceType() === "xhr" &&
|
|
6877
|
+
response.status() === 200 &&
|
|
6878
|
+
response.url().includes(responseUrl) &&
|
|
6879
|
+
response
|
|
6880
|
+
.url()
|
|
6881
|
+
.startsWith((_a = baseUrl !== null && baseUrl !== void 0 ? baseUrl : process.env.BASE_URL) !== null && _a !== void 0 ? _a : "") &&
|
|
6882
|
+
!this.responses.includes((_b = response.headers()) === null || _b === void 0 ? void 0 : _b["x-request-id"])) {
|
|
6883
|
+
this.responses.push((_c = response.headers()) === null || _c === void 0 ? void 0 : _c["x-request-id"]);
|
|
6884
|
+
return true;
|
|
6885
|
+
}
|
|
6886
|
+
return false;
|
|
6887
|
+
}, { timeout: 10000 })));
|
|
6888
|
+
this.recursiveMethod = async (callback, condition, timeout, startTime) => {
|
|
6889
|
+
if (Date.now() - timeout >= startTime) {
|
|
6890
|
+
return false;
|
|
6891
|
+
}
|
|
6892
|
+
else if (await condition()) {
|
|
6893
|
+
return await callback();
|
|
6894
|
+
}
|
|
6895
|
+
return await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
6896
|
+
};
|
|
6897
|
+
this.executeRecursively = async ({ callback, condition, timeout = 5000, }) => {
|
|
6898
|
+
const startTime = Date.now();
|
|
6899
|
+
await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
6900
|
+
};
|
|
6901
|
+
this.verifySuccessToast = async ({ message, closeAfterVerification = true, }) => {
|
|
6902
|
+
if (message) {
|
|
6903
|
+
await test.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toHaveValue(message);
|
|
6904
|
+
}
|
|
6905
|
+
else {
|
|
6906
|
+
await test.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toHaveValue("👍");
|
|
6907
|
+
closeAfterVerification &&
|
|
6908
|
+
(await this.page
|
|
6909
|
+
.getByTestId(COMMON_SELECTORS.toastCloseButton)
|
|
6910
|
+
.click());
|
|
6911
|
+
}
|
|
6912
|
+
};
|
|
6913
|
+
this.reloadAndWait = async (requestCount) => {
|
|
6914
|
+
const reloadRequests = this.interceptMultipleResponses({
|
|
6915
|
+
times: requestCount,
|
|
6916
|
+
});
|
|
6917
|
+
await this.page.reload();
|
|
6918
|
+
await reloadRequests;
|
|
6919
|
+
};
|
|
6920
|
+
this.apiRequest = async ({ url, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
6921
|
+
const csrfToken = await this.page
|
|
6922
|
+
.locator("[name='csrf-token']")
|
|
6923
|
+
.getAttribute("content");
|
|
6924
|
+
const requestOptions = {
|
|
6925
|
+
headers: {
|
|
6926
|
+
...additionalHeaders,
|
|
6927
|
+
"accept-encoding": "gzip",
|
|
6928
|
+
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
6929
|
+
},
|
|
6930
|
+
data,
|
|
6931
|
+
params,
|
|
6932
|
+
...otherOptions,
|
|
6933
|
+
};
|
|
6934
|
+
const httpMethodsHandlers = {
|
|
6935
|
+
get: () => this.request.get(url, requestOptions),
|
|
6936
|
+
post: () => this.request.post(url, requestOptions),
|
|
6937
|
+
put: () => this.request.put(url, requestOptions),
|
|
6938
|
+
delete: () => this.request.delete(url, requestOptions),
|
|
6939
|
+
};
|
|
6940
|
+
return await httpMethodsHandlers[method]();
|
|
6941
|
+
};
|
|
6942
|
+
this.verifyFieldValue = values => {
|
|
6943
|
+
const verifyEachFieldValue = ({ field, value, }) => test.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
6944
|
+
return Array.isArray(values)
|
|
6945
|
+
? Promise.all(values.map(value => verifyEachFieldValue(value)))
|
|
6946
|
+
: verifyEachFieldValue(values);
|
|
6947
|
+
};
|
|
6948
|
+
this.page = page;
|
|
6949
|
+
this.responses = [];
|
|
6950
|
+
this.request = request;
|
|
6951
|
+
}
|
|
6952
|
+
}
|
|
6953
|
+
|
|
6954
|
+
const commands = {
|
|
6955
|
+
neetoPlaywrightUtilities: async ({ page, request }, use) => {
|
|
6956
|
+
const commands = new CustomCommands(page, request);
|
|
6957
|
+
await use(commands);
|
|
6958
|
+
},
|
|
6959
|
+
page: async ({ page }, use) => {
|
|
6960
|
+
await page.goto("/");
|
|
6961
|
+
await page.waitForLoadState();
|
|
6962
|
+
await use(page);
|
|
6963
|
+
},
|
|
6964
|
+
};
|
|
6910
6965
|
|
|
6911
6966
|
const generateStagingData = (product = "invoice") => {
|
|
6912
6967
|
const timestamp = dayjs__default["default"]().format("YYYYMMDDHH");
|
|
@@ -6930,7 +6985,86 @@ const generateStagingData = (product = "invoice") => {
|
|
|
6930
6985
|
};
|
|
6931
6986
|
};
|
|
6932
6987
|
|
|
6933
|
-
|
|
6988
|
+
var __create = Object.create;
|
|
6989
|
+
var __defProp = Object.defineProperty;
|
|
6990
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6991
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6992
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6993
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6994
|
+
var __export = (target, all) => {
|
|
6995
|
+
for (var name in all)
|
|
6996
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6997
|
+
};
|
|
6998
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6999
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7000
|
+
for (let key of __getOwnPropNames(from))
|
|
7001
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
7002
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
7003
|
+
}
|
|
7004
|
+
return to;
|
|
7005
|
+
};
|
|
7006
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
7007
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
7008
|
+
mod
|
|
7009
|
+
));
|
|
7010
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
7011
|
+
|
|
7012
|
+
// src/index.ts
|
|
7013
|
+
var src_exports = {};
|
|
7014
|
+
__export(src_exports, {
|
|
7015
|
+
createI18nFixture: () => createI18nFixture,
|
|
7016
|
+
getI18nInstance: () => getI18nInstance,
|
|
7017
|
+
initI18n: () => initI18n
|
|
7018
|
+
});
|
|
7019
|
+
var dist = __toCommonJS(src_exports);
|
|
7020
|
+
|
|
7021
|
+
// src/i18n.ts
|
|
7022
|
+
var import_i18next = __toESM(require$$0__default$5["default"]);
|
|
7023
|
+
var storedI18n;
|
|
7024
|
+
async function initI18n({
|
|
7025
|
+
plugins,
|
|
7026
|
+
options,
|
|
7027
|
+
cache
|
|
7028
|
+
}) {
|
|
7029
|
+
if (!cache || !storedI18n || !storedI18n.isInitialized) {
|
|
7030
|
+
const i18n2 = plugins.reduce(
|
|
7031
|
+
(i18n3, plugin) => i18n3 = i18n3.use(plugin),
|
|
7032
|
+
import_i18next.default.createInstance()
|
|
7033
|
+
);
|
|
7034
|
+
await i18n2.init(options);
|
|
7035
|
+
storedI18n = i18n2;
|
|
7036
|
+
}
|
|
7037
|
+
return storedI18n;
|
|
7038
|
+
}
|
|
7039
|
+
function getI18nInstance() {
|
|
7040
|
+
if (!storedI18n) {
|
|
7041
|
+
throw new Error("No i18n instance initialized");
|
|
7042
|
+
}
|
|
7043
|
+
return storedI18n;
|
|
7044
|
+
}
|
|
7045
|
+
|
|
7046
|
+
// src/fixture.ts
|
|
7047
|
+
var createI18nFixture = ({
|
|
7048
|
+
plugins = [],
|
|
7049
|
+
options = {},
|
|
7050
|
+
cache = true,
|
|
7051
|
+
auto = true
|
|
7052
|
+
}) => {
|
|
7053
|
+
return {
|
|
7054
|
+
i18n: [
|
|
7055
|
+
async ({}, use) => {
|
|
7056
|
+
const i18nInitialized = await initI18n({ plugins, options, cache });
|
|
7057
|
+
await use(i18nInitialized);
|
|
7058
|
+
},
|
|
7059
|
+
{ auto }
|
|
7060
|
+
],
|
|
7061
|
+
t: async ({ i18n: i18n2 }, use) => {
|
|
7062
|
+
await use(i18n2.t);
|
|
7063
|
+
}
|
|
7064
|
+
};
|
|
7065
|
+
};
|
|
7066
|
+
|
|
7067
|
+
const i18nFixture = dist.createI18nFixture({
|
|
6934
7068
|
// i18n configuration options
|
|
6935
7069
|
options: {
|
|
6936
7070
|
debug: false,
|
|
@@ -6943,17 +7077,24 @@ const i18n = {
|
|
|
6943
7077
|
// Run as auto fixture to be available through all tests by getI18nInstance()
|
|
6944
7078
|
// Default: true
|
|
6945
7079
|
auto: true,
|
|
6946
|
-
};
|
|
7080
|
+
});
|
|
6947
7081
|
|
|
6948
7082
|
const BASE_URL = "/api/v1";
|
|
6949
7083
|
const ROUTES = {
|
|
6950
7084
|
neetoAuth: "https://app.neetoauth.net",
|
|
7085
|
+
neetoAuthSignup: "https://app.neetoauth.net/signups/new",
|
|
6951
7086
|
profile: "/profile",
|
|
6952
7087
|
login: `${BASE_URL}/login`,
|
|
6953
7088
|
signup: `${BASE_URL}/signups`,
|
|
6954
7089
|
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
6955
7090
|
countries: `${BASE_URL}/countries`,
|
|
6956
7091
|
neetoApps: `${BASE_URL}/neeto_apps`,
|
|
7092
|
+
teamMembers: {
|
|
7093
|
+
all: "/team_members*/**",
|
|
7094
|
+
bulkUpdate: "/team_members/teams/bulk_update",
|
|
7095
|
+
index: "/team_members/teams",
|
|
7096
|
+
show: (id) => `/team_members/teams/${id}`,
|
|
7097
|
+
},
|
|
6957
7098
|
};
|
|
6958
7099
|
|
|
6959
7100
|
const SIGNUP_SELECTORS = {
|
|
@@ -6985,10 +7126,9 @@ class OrganizationPage {
|
|
|
6985
7126
|
const defaultOtp = "123456";
|
|
6986
7127
|
const appNameInLowerCase = appName.toLowerCase();
|
|
6987
7128
|
const isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
6988
|
-
const authUrl = "https://app.neetoauth.net/signups/new";
|
|
6989
7129
|
isNeetoAuth
|
|
6990
|
-
? await this.page.goto(
|
|
6991
|
-
: await this.page.goto(`${
|
|
7130
|
+
? await this.page.goto(ROUTES.neetoAuthSignup)
|
|
7131
|
+
: await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net`);
|
|
6992
7132
|
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
6993
7133
|
const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
6994
7134
|
responseUrl: ROUTES.signup,
|
|
@@ -7090,6 +7230,62 @@ class OrganizationPage {
|
|
|
7090
7230
|
}
|
|
7091
7231
|
}
|
|
7092
7232
|
|
|
7233
|
+
const NEETO_EDITOR_SELECTORS = {
|
|
7234
|
+
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
7235
|
+
italicOption: "neeto-editor-fixed-menu-italic-option",
|
|
7236
|
+
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
7237
|
+
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
7238
|
+
codeBlockOption: "neeto-editor-fixed-menu-code-option",
|
|
7239
|
+
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
7240
|
+
linkInput: "neeto-editor-fixed-menu-link-option-input",
|
|
7241
|
+
linkSubmitButton: "neeto-editor-fixed-menu-link-option-link-button",
|
|
7242
|
+
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
7243
|
+
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
7244
|
+
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
7245
|
+
uploadInput: "neeto-editor-media-uploader-input",
|
|
7246
|
+
editorMenuBarWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
7247
|
+
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
7248
|
+
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
7249
|
+
imageWrapper: "neeto-editor-image-wrapper",
|
|
7250
|
+
};
|
|
7251
|
+
|
|
7252
|
+
const NEETO_FILTERS_SELECTORS = {
|
|
7253
|
+
emailSelectContainer: "email-select-container-wrapper",
|
|
7254
|
+
filterPaneHeading: "neeto-filters-pane-header",
|
|
7255
|
+
neetoFiltersEmailBlock: "neeto-filters-email-block",
|
|
7256
|
+
neetoFiltersRoleBlock: "neeto-filters-role-block",
|
|
7257
|
+
neetoFiltersBarClearButton: "neeto-filters-bar-clear-btn",
|
|
7258
|
+
neetoFiltersNameFilterField: "neeto-filters-name-filter",
|
|
7259
|
+
neetoFilterNameBlock: "neeto-filters-name-block",
|
|
7260
|
+
roleSelectContainer: "role-select-container-wrapper",
|
|
7261
|
+
filterButton: "neeto-filters-toggle-btn",
|
|
7262
|
+
filtersClearButton: "neeto-filters-clear-btn",
|
|
7263
|
+
filterDoneButton: "neeto-filters-done-btn",
|
|
7264
|
+
filteredMembersCount: "ntm-filtered-members-count",
|
|
7265
|
+
allMenubarBlock: "ntm-members-menubar-all-block",
|
|
7266
|
+
filtersEmailFilter: "neeto-filters-email-filter",
|
|
7267
|
+
paneModalCrossIcon: "neeto-filters-close-button",
|
|
7268
|
+
};
|
|
7269
|
+
|
|
7270
|
+
const HELP_CENTER_SELECTORS = {
|
|
7271
|
+
helpButton: "help-button",
|
|
7272
|
+
documentationButton: "help-link-help-center-button",
|
|
7273
|
+
keyboardShortcutButton: "help-link-keyboard-shortcut-button",
|
|
7274
|
+
chatButton: "help-link-live-chat-button",
|
|
7275
|
+
whatsNewButton: "help-link-changelog-button",
|
|
7276
|
+
whatsNewWidgetInfo: "h1",
|
|
7277
|
+
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
7278
|
+
keyboardShortcutPaneHeading: "keyboard-shortcuts-pane-title",
|
|
7279
|
+
keyboardShortcutPaneCrossIcon: "keyboard-shortcuts-pane-close-button",
|
|
7280
|
+
};
|
|
7281
|
+
const CHAT_WIDGET_SELECTORS = {
|
|
7282
|
+
chatWidgetHomeCard: "neeto-chat-widget-cta-title",
|
|
7283
|
+
widgetSubmitButton: "neeto-chat-widget-pre-chat-submit-btn",
|
|
7284
|
+
chatBubbleMessage: "neeto-chat-widget-chat-message-bubble",
|
|
7285
|
+
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
7286
|
+
widgetIframe: "#neetochat-iframe",
|
|
7287
|
+
};
|
|
7288
|
+
|
|
7093
7289
|
const LOGIN_SELECTORS = {
|
|
7094
7290
|
appleAuthenticationButton: "apple-authentication-button",
|
|
7095
7291
|
emailTextField: "login-email-text-field",
|
|
@@ -7102,7 +7298,77 @@ const LOGIN_SELECTORS = {
|
|
|
7102
7298
|
twitterAuthenticationButton: "twitter-authentication-button",
|
|
7103
7299
|
};
|
|
7104
7300
|
|
|
7105
|
-
const
|
|
7301
|
+
const MEMBER_SELECTORS = {
|
|
7302
|
+
membersTab: "members-nav-tab",
|
|
7303
|
+
newButton: "ntm-add-member-button",
|
|
7304
|
+
continueButton: "ntm-manage-member-continue-button",
|
|
7305
|
+
submitButton: "ntm-manage-member-submit-button",
|
|
7306
|
+
searchTextField: "ntm-search-members-input",
|
|
7307
|
+
deactivatedAgentsButton: "ntm-members-menubar-deactivated-block",
|
|
7308
|
+
activatedMembersButton: "ntm-members-menubar-active-block",
|
|
7309
|
+
columnCheckBox: "neeto-ui-columns-checkbox",
|
|
7310
|
+
roleLabel: (role) => `${joinHyphenCase(role)}-radio-label`,
|
|
7311
|
+
dropDownIcon: "ntm-members-table-row-dropdown-button",
|
|
7312
|
+
editButton: "ntm-edit-member-button",
|
|
7313
|
+
menuBarHeading: "ntm-members-menubar-heading",
|
|
7314
|
+
activateOrDeactivateMember: "ntm-deactivate-member-button",
|
|
7315
|
+
columnsButton: "columns-dropdown-button",
|
|
7316
|
+
columnsDropdownContainer: "columns-dropdown-container",
|
|
7317
|
+
emailDropdownItemLabel: "email-checkbox-label",
|
|
7318
|
+
roleDropdownItemLabel: "role-checkbox-label",
|
|
7319
|
+
inviteStatusDropdownItemLabel: "invite-status-checkbox-label",
|
|
7320
|
+
heading: "ntm-manage-members-pane-header",
|
|
7321
|
+
activateButton: "ntm-activate-members-button",
|
|
7322
|
+
deactivateButton: "ntm-deactivate-members-button",
|
|
7323
|
+
rolesButton: "ntm-manage-member-roles-button",
|
|
7324
|
+
statusTag: "ntm-member-status-tag",
|
|
7325
|
+
};
|
|
7326
|
+
const MEMBER_FORM_SELECTORS = {
|
|
7327
|
+
emailTextField: "email-select-input-field",
|
|
7328
|
+
firstNameTextField: "ntm-edit-member-first-name-text-field",
|
|
7329
|
+
lastNameTextField: "ntm-edit-member-last-name-text-field",
|
|
7330
|
+
emailInput: "ntm-manage-member-email-input",
|
|
7331
|
+
emailErrorField: "emails-input-error",
|
|
7332
|
+
cancelButton: "ntm-manage-member-cancel-button",
|
|
7333
|
+
};
|
|
7334
|
+
|
|
7335
|
+
const ROLES_SELECTORS = {
|
|
7336
|
+
newButton: "ntm-add-role-button",
|
|
7337
|
+
proceedButton: "ntm-add-role-submit-button",
|
|
7338
|
+
cancelButton: "ntm-add-role-cancel-button",
|
|
7339
|
+
tableHeaderRoleName: "ntm-roles-table-role-header",
|
|
7340
|
+
nameTextField: "ntm-add-role-name-text-field",
|
|
7341
|
+
searchTextField: "ntm-search-roles-input",
|
|
7342
|
+
updateRolePaneHeading: "ntm-add-role-title",
|
|
7343
|
+
updateRoleCancelButton: "ntm-add-role-cancel-button",
|
|
7344
|
+
descriptionTextField: "ntm-add-role-description-text-field",
|
|
7345
|
+
permissionCategoryTitle: "ntm-roles-permission-category-title",
|
|
7346
|
+
headerColumn: "ntm-roles-table-header",
|
|
7347
|
+
dropDownIcon: "ntm-roles-table-header-role-dropdown-button",
|
|
7348
|
+
tableHeaderRoleTitle: "ntm-roles-table-header-role-title",
|
|
7349
|
+
};
|
|
7350
|
+
|
|
7351
|
+
const TAGS_SELECTORS = {
|
|
7352
|
+
newTagButton: "add-new-tag-button",
|
|
7353
|
+
tagNameTextField: "tag-name-text-field",
|
|
7354
|
+
editButton: "tags-edit-button",
|
|
7355
|
+
deleteButton: "tags-delete-button",
|
|
7356
|
+
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
7357
|
+
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
7358
|
+
searchTextField: "neeto-tags-search-text-input-field",
|
|
7359
|
+
descriptionTextArea: "tag-description-text-area",
|
|
7360
|
+
};
|
|
7361
|
+
const MERGE_TAGS_SELECTORS = {
|
|
7362
|
+
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
7363
|
+
mergeButton: "neeto-tags-merge-button",
|
|
7364
|
+
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
7365
|
+
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
7366
|
+
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
7367
|
+
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
7368
|
+
cancelButton: "neeto-tags-merge-cancel-button",
|
|
7369
|
+
proceedButton: "neeto-tags-merge-proceed-button",
|
|
7370
|
+
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
7371
|
+
};
|
|
7106
7372
|
|
|
7107
7373
|
const initializeCredentials = (product) => {
|
|
7108
7374
|
const { user } = readFileSyncIfExists();
|
|
@@ -7596,25 +7862,35 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7596
7862
|
};
|
|
7597
7863
|
|
|
7598
7864
|
exports.BASE_URL = BASE_URL;
|
|
7865
|
+
exports.CHAT_WIDGET_SELECTORS = CHAT_WIDGET_SELECTORS;
|
|
7599
7866
|
exports.COMMON_SELECTORS = COMMON_SELECTORS;
|
|
7600
|
-
exports.COMMON_TEXTS = COMMON_TEXTS;
|
|
7601
7867
|
exports.CREDENTIALS = CREDENTIALS;
|
|
7602
7868
|
exports.CustomCommands = CustomCommands;
|
|
7603
7869
|
exports.ENVIRONMENT = ENVIRONMENT;
|
|
7604
7870
|
exports.GLOBAL_TRANSLATIONS_PATTERN = GLOBAL_TRANSLATIONS_PATTERN;
|
|
7871
|
+
exports.HELP_CENTER_SELECTORS = HELP_CENTER_SELECTORS;
|
|
7605
7872
|
exports.IS_STAGING_ENV = IS_STAGING_ENV;
|
|
7606
7873
|
exports.LOGIN_SELECTORS = LOGIN_SELECTORS;
|
|
7874
|
+
exports.MEMBER_FORM_SELECTORS = MEMBER_FORM_SELECTORS;
|
|
7875
|
+
exports.MEMBER_SELECTORS = MEMBER_SELECTORS;
|
|
7876
|
+
exports.MERGE_TAGS_SELECTORS = MERGE_TAGS_SELECTORS;
|
|
7877
|
+
exports.NEETO_EDITOR_SELECTORS = NEETO_EDITOR_SELECTORS;
|
|
7878
|
+
exports.NEETO_FILTERS_SELECTORS = NEETO_FILTERS_SELECTORS;
|
|
7607
7879
|
exports.OrganizationPage = OrganizationPage;
|
|
7608
7880
|
exports.PROJECT_TRANSLATIONS_PATH = PROJECT_TRANSLATIONS_PATH;
|
|
7881
|
+
exports.ROLES_SELECTORS = ROLES_SELECTORS;
|
|
7609
7882
|
exports.ROUTES = ROUTES;
|
|
7610
7883
|
exports.SIGNUP_SELECTORS = SIGNUP_SELECTORS;
|
|
7611
7884
|
exports.STORAGE_STATE = STORAGE_STATE;
|
|
7885
|
+
exports.TAGS_SELECTORS = TAGS_SELECTORS;
|
|
7612
7886
|
exports.clearCredentials = clearCredentials;
|
|
7613
7887
|
exports.commands = commands;
|
|
7614
7888
|
exports.definePlaywrightConfig = definePlaywrightConfig;
|
|
7615
7889
|
exports.generateStagingData = generateStagingData;
|
|
7616
|
-
exports.
|
|
7890
|
+
exports.hyphenize = hyphenize;
|
|
7891
|
+
exports.i18nFixture = i18nFixture;
|
|
7617
7892
|
exports.initializeCredentials = initializeCredentials;
|
|
7893
|
+
exports.joinHyphenCase = joinHyphenCase;
|
|
7618
7894
|
exports.joinString = joinString;
|
|
7619
7895
|
exports.login = login;
|
|
7620
7896
|
exports.loginWithoutSSO = loginWithoutSSO;
|