@bigbinary/neeto-playwright-commons 1.1.3 → 1.3.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.cjs.js +280 -86
- package/index.cjs.js.map +1 -1
- package/index.d.ts +203 -27
- package/index.js +255 -71
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -16,21 +16,21 @@ var require$$3 = require('crypto');
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
18
18
|
function _interopNamespace(e) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
if (e && e.__esModule) return e;
|
|
20
|
+
var n = Object.create(null);
|
|
21
|
+
if (e) {
|
|
22
|
+
Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default') {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
n["default"] = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
|
|
@@ -43,19 +43,6 @@ var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
|
|
|
43
43
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
44
44
|
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);
|
|
45
45
|
|
|
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
46
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
60
47
|
|
|
61
48
|
var tasks = {};
|
|
@@ -6763,7 +6750,11 @@ const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
|
6763
6750
|
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
6764
6751
|
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
6765
6752
|
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
6766
|
-
const CREDENTIALS = {
|
|
6753
|
+
const CREDENTIALS = {
|
|
6754
|
+
name: "Oliver Smith",
|
|
6755
|
+
email: "oliver@example.com",
|
|
6756
|
+
password: "welcome",
|
|
6757
|
+
};
|
|
6767
6758
|
|
|
6768
6759
|
const joinString = (string1, string2, string3 = "", separator = " ") => {
|
|
6769
6760
|
if (string3 === "") {
|
|
@@ -6809,10 +6800,76 @@ const readTranslations = () => {
|
|
|
6809
6800
|
});
|
|
6810
6801
|
return translations;
|
|
6811
6802
|
};
|
|
6803
|
+
const hyphenize = input => {
|
|
6804
|
+
const fallbackString = "";
|
|
6805
|
+
if (typeof input === "number")
|
|
6806
|
+
return String(input);
|
|
6807
|
+
if (input && typeof input === "string" && input.replace) {
|
|
6808
|
+
return input
|
|
6809
|
+
.replace(/[\s_]/g, "-")
|
|
6810
|
+
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
6811
|
+
.replace(/-+/g, "-")
|
|
6812
|
+
.toLowerCase();
|
|
6813
|
+
}
|
|
6814
|
+
return fallbackString;
|
|
6815
|
+
};
|
|
6816
|
+
const joinHyphenCase = (...args) => args.join(" ").replace(/\s+/g, "-").toLowerCase();
|
|
6817
|
+
|
|
6818
|
+
const COMMON_SELECTORS = {
|
|
6819
|
+
spinner: ".neeto-ui-spinner",
|
|
6820
|
+
subheaderText: "subheader-left",
|
|
6821
|
+
alertTitle: "alert-title",
|
|
6822
|
+
alertModalMessage: "alert-message",
|
|
6823
|
+
alertModalSubmitButton: "alert-submit-button",
|
|
6824
|
+
checkbox: "nui-checkbox-input",
|
|
6825
|
+
checkboxLabel: "nui-checkbox-label",
|
|
6826
|
+
dropdownContainer: "nui-dropdown-container",
|
|
6827
|
+
dropdownIcon: "nui-dropdown-icon",
|
|
6828
|
+
heading: "main-header",
|
|
6829
|
+
paneBody: "pane-body",
|
|
6830
|
+
paneHeader: "pane-header",
|
|
6831
|
+
profileSidebar: "profile-section",
|
|
6832
|
+
selectOption: (label) => `${hyphenize(label)}-select-option`,
|
|
6833
|
+
toastMessage: "toastr-message-container",
|
|
6834
|
+
toastCloseButton: "toastr-close-button",
|
|
6835
|
+
windowAlert: "#alert-box",
|
|
6836
|
+
body: "body",
|
|
6837
|
+
toastIcon: ".Toastify__toast-icon",
|
|
6838
|
+
paneModalCrossIcon: "pane-close-button",
|
|
6839
|
+
inputField: "nui-input-field",
|
|
6840
|
+
alertConfirmationText: "alert-confirmation-text",
|
|
6841
|
+
alertCancelButton: "alert-cancel-button",
|
|
6842
|
+
alertModalCrossIcon: "modal-close-button",
|
|
6843
|
+
saveChangesButton: "save-changes-button",
|
|
6844
|
+
cancelButton: "cancel-button",
|
|
6845
|
+
inputFieldError: "nui-input-error",
|
|
6846
|
+
selectDropDownError: "nui-select-error",
|
|
6847
|
+
subTitleHeading: "menubar-subtitle-heading",
|
|
6848
|
+
noDataTitle: "no-data-title",
|
|
6849
|
+
noDataDescription: "no-data-description",
|
|
6850
|
+
backdrop: "neeto-backdrop",
|
|
6851
|
+
menuBarHeading: "menubar-heading",
|
|
6852
|
+
dropdownWrapper: "nui-select-container-wrapper",
|
|
6853
|
+
toggleButton: "menubar-toggle-button",
|
|
6854
|
+
tooltip: "tooltip-box",
|
|
6855
|
+
articlePageTitle: ".serene-article__title",
|
|
6856
|
+
tabItem: "tab-item",
|
|
6857
|
+
labelInputError: "label-input-error",
|
|
6858
|
+
urlInputError: "url-input-error",
|
|
6859
|
+
noDataPrimaryButton: "no-data-primary-button",
|
|
6860
|
+
modalHeader: "modal-header",
|
|
6861
|
+
nameInputError: "name-input-error",
|
|
6862
|
+
selectContainer: "nui-select-container",
|
|
6863
|
+
dropdownMenu: "nui-select-menu",
|
|
6864
|
+
sidebarToggle: "neeto-molecules-sidebar-toggler",
|
|
6865
|
+
subheader: "subheader",
|
|
6866
|
+
settingsLink: "Settings",
|
|
6867
|
+
ticketFieldTextInput: (label) => `${hyphenize(label)}-text-input`,
|
|
6868
|
+
};
|
|
6812
6869
|
|
|
6813
6870
|
class CustomCommands {
|
|
6814
6871
|
constructor(page, request) {
|
|
6815
|
-
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse(response => {
|
|
6872
|
+
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse((response) => {
|
|
6816
6873
|
var _a, _b, _c;
|
|
6817
6874
|
if (response.request().resourceType() === "xhr" &&
|
|
6818
6875
|
response.status() === 200 &&
|
|
@@ -6859,9 +6916,15 @@ class CustomCommands {
|
|
|
6859
6916
|
await reloadRequests;
|
|
6860
6917
|
};
|
|
6861
6918
|
this.apiRequest = async ({ url, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
6862
|
-
const
|
|
6919
|
+
const csrfToken = await this.page
|
|
6920
|
+
.locator("[name='csrf-token']")
|
|
6921
|
+
.getAttribute("content");
|
|
6863
6922
|
const requestOptions = {
|
|
6864
|
-
headers: {
|
|
6923
|
+
headers: {
|
|
6924
|
+
...additionalHeaders,
|
|
6925
|
+
"accept-encoding": "gzip",
|
|
6926
|
+
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
6927
|
+
},
|
|
6865
6928
|
data,
|
|
6866
6929
|
params,
|
|
6867
6930
|
...otherOptions,
|
|
@@ -6872,7 +6935,7 @@ class CustomCommands {
|
|
|
6872
6935
|
put: () => this.request.put(url, requestOptions),
|
|
6873
6936
|
delete: () => this.request.delete(url, requestOptions),
|
|
6874
6937
|
};
|
|
6875
|
-
return await httpMethodsHandlers[method
|
|
6938
|
+
return await httpMethodsHandlers[method]();
|
|
6876
6939
|
};
|
|
6877
6940
|
this.verifyFieldValue = values => {
|
|
6878
6941
|
const verifyEachFieldValue = ({ field, value, }) => test.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
@@ -6898,24 +6961,26 @@ const commands = {
|
|
|
6898
6961
|
},
|
|
6899
6962
|
};
|
|
6900
6963
|
|
|
6901
|
-
const
|
|
6902
|
-
const
|
|
6903
|
-
const
|
|
6904
|
-
const
|
|
6905
|
-
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6906
|
-
const
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6964
|
+
const generateStagingData = (product = "invoice") => {
|
|
6965
|
+
const timestamp = dayjs__default["default"]().format("YYYYMMDDHH");
|
|
6966
|
+
const firstName = "André";
|
|
6967
|
+
const lastName = "O'Reilly";
|
|
6968
|
+
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6969
|
+
const stagingOrganization = `cypresstest-${product}-${timestamp}`;
|
|
6970
|
+
return {
|
|
6971
|
+
firstName,
|
|
6972
|
+
lastName,
|
|
6973
|
+
otp: 111111,
|
|
6974
|
+
domain: `neeto${product}.net`,
|
|
6975
|
+
currentUserName: IS_STAGING_ENV
|
|
6976
|
+
? joinString(firstName, lastName)
|
|
6977
|
+
: CREDENTIALS.name,
|
|
6978
|
+
businessName: stagingOrganization,
|
|
6979
|
+
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
6980
|
+
email: IS_STAGING_ENV
|
|
6981
|
+
? `cypresstest${otpBypassKey}+${product}+${timestamp}-playwright@bigbinary.com`
|
|
6982
|
+
: "oliver@example.com",
|
|
6983
|
+
};
|
|
6919
6984
|
};
|
|
6920
6985
|
|
|
6921
6986
|
const i18n = {
|
|
@@ -6936,12 +7001,19 @@ const i18n = {
|
|
|
6936
7001
|
const BASE_URL = "/api/v1";
|
|
6937
7002
|
const ROUTES = {
|
|
6938
7003
|
neetoAuth: "https://app.neetoauth.net",
|
|
7004
|
+
neetoAuthSignup: "https://app.neetoauth.net/signups/new",
|
|
6939
7005
|
profile: "/profile",
|
|
6940
7006
|
login: `${BASE_URL}/login`,
|
|
6941
7007
|
signup: `${BASE_URL}/signups`,
|
|
6942
7008
|
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
6943
7009
|
countries: `${BASE_URL}/countries`,
|
|
6944
7010
|
neetoApps: `${BASE_URL}/neeto_apps`,
|
|
7011
|
+
teamMembers: {
|
|
7012
|
+
all: "/team_members*/**",
|
|
7013
|
+
bulkUpdate: "/team_members/teams/bulk_update",
|
|
7014
|
+
index: "/team_members/teams",
|
|
7015
|
+
show: (id) => `/team_members/teams/${id}`,
|
|
7016
|
+
},
|
|
6945
7017
|
};
|
|
6946
7018
|
|
|
6947
7019
|
const SIGNUP_SELECTORS = {
|
|
@@ -6973,10 +7045,9 @@ class OrganizationPage {
|
|
|
6973
7045
|
const defaultOtp = "123456";
|
|
6974
7046
|
const appNameInLowerCase = appName.toLowerCase();
|
|
6975
7047
|
const isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
6976
|
-
const authUrl = "https://app.neetoauth.net/signups/new";
|
|
6977
7048
|
isNeetoAuth
|
|
6978
|
-
? await this.page.goto(
|
|
6979
|
-
: await this.page.goto(`${
|
|
7049
|
+
? await this.page.goto(ROUTES.neetoAuthSignup)
|
|
7050
|
+
: await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net`);
|
|
6980
7051
|
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
6981
7052
|
const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
6982
7053
|
responseUrl: ROUTES.signup,
|
|
@@ -7020,10 +7091,9 @@ class OrganizationPage {
|
|
|
7020
7091
|
await this.page.getByTestId(SIGNUP_SELECTORS.profileSubmitButton).click();
|
|
7021
7092
|
await submitProfile;
|
|
7022
7093
|
};
|
|
7023
|
-
this.setupOrganization = async () => {
|
|
7094
|
+
this.setupOrganization = async (product) => {
|
|
7024
7095
|
if (!IS_STAGING_ENV)
|
|
7025
7096
|
return;
|
|
7026
|
-
let headers = {};
|
|
7027
7097
|
const { user } = readFileSyncIfExists();
|
|
7028
7098
|
await this.createOrganization({
|
|
7029
7099
|
businessName: user.businessName,
|
|
@@ -7031,20 +7101,15 @@ class OrganizationPage {
|
|
|
7031
7101
|
firstName: user.firstName,
|
|
7032
7102
|
lastName: user.lastName,
|
|
7033
7103
|
subdomainName: user.subdomainName,
|
|
7034
|
-
appName:
|
|
7035
|
-
});
|
|
7036
|
-
await this.page.route(`**${ROUTES.neetoApps}`, async (route) => {
|
|
7037
|
-
headers = await route.request().allHeaders();
|
|
7038
|
-
await route.continue();
|
|
7104
|
+
appName: `neeto${product}`,
|
|
7039
7105
|
});
|
|
7040
7106
|
await test.expect(this.page.locator(COMMON_SELECTORS.spinner)).toBeHidden();
|
|
7041
7107
|
const userCredentials = readFileSyncIfExists();
|
|
7042
7108
|
await this.page.context().storageState({ path: STORAGE_STATE });
|
|
7043
|
-
const mergedCredentials =
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
};
|
|
7109
|
+
const mergedCredentials = ramda.mergeAll([
|
|
7110
|
+
readFileSyncIfExists(),
|
|
7111
|
+
userCredentials,
|
|
7112
|
+
]);
|
|
7048
7113
|
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7049
7114
|
};
|
|
7050
7115
|
this.updateSubdomainIfExists = async (appName) => {
|
|
@@ -7084,6 +7149,62 @@ class OrganizationPage {
|
|
|
7084
7149
|
}
|
|
7085
7150
|
}
|
|
7086
7151
|
|
|
7152
|
+
const NEETO_EDITOR_SELECTORS = {
|
|
7153
|
+
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
7154
|
+
italicOption: "neeto-editor-fixed-menu-italic-option",
|
|
7155
|
+
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
7156
|
+
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
7157
|
+
codeBlockOption: "neeto-editor-fixed-menu-code-option",
|
|
7158
|
+
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
7159
|
+
linkInput: "neeto-editor-fixed-menu-link-option-input",
|
|
7160
|
+
linkSubmitButton: "neeto-editor-fixed-menu-link-option-link-button",
|
|
7161
|
+
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
7162
|
+
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
7163
|
+
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
7164
|
+
uploadInput: "neeto-editor-media-uploader-input",
|
|
7165
|
+
editorMenuBarWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
7166
|
+
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
7167
|
+
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
7168
|
+
imageWrapper: "neeto-editor-image-wrapper",
|
|
7169
|
+
};
|
|
7170
|
+
|
|
7171
|
+
const NEETO_FILTERS_SELECTORS = {
|
|
7172
|
+
emailSelectContainer: "email-select-container-wrapper",
|
|
7173
|
+
filterPaneHeading: "neeto-filters-pane-header",
|
|
7174
|
+
neetoFiltersEmailBlock: "neeto-filters-email-block",
|
|
7175
|
+
neetoFiltersRoleBlock: "neeto-filters-role-block",
|
|
7176
|
+
neetoFiltersBarClearButton: "neeto-filters-bar-clear-btn",
|
|
7177
|
+
neetoFiltersNameFilterField: "neeto-filters-name-filter",
|
|
7178
|
+
neetoFilterNameBlock: "neeto-filters-name-block",
|
|
7179
|
+
roleSelectContainer: "role-select-container-wrapper",
|
|
7180
|
+
filterButton: "neeto-filters-toggle-btn",
|
|
7181
|
+
filtersClearButton: "neeto-filters-clear-btn",
|
|
7182
|
+
filterDoneButton: "neeto-filters-done-btn",
|
|
7183
|
+
filteredMembersCount: "ntm-filtered-members-count",
|
|
7184
|
+
allMenubarBlock: "ntm-members-menubar-all-block",
|
|
7185
|
+
filtersEmailFilter: "neeto-filters-email-filter",
|
|
7186
|
+
paneModalCrossIcon: "neeto-filters-close-button",
|
|
7187
|
+
};
|
|
7188
|
+
|
|
7189
|
+
const HELP_CENTER_SELECTORS = {
|
|
7190
|
+
helpButton: "help-button",
|
|
7191
|
+
documentationButton: "help-link-help-center-button",
|
|
7192
|
+
keyboardShortcutButton: "help-link-keyboard-shortcut-button",
|
|
7193
|
+
chatButton: "help-link-live-chat-button",
|
|
7194
|
+
whatsNewButton: "help-link-changelog-button",
|
|
7195
|
+
whatsNewWidgetInfo: "h1",
|
|
7196
|
+
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
7197
|
+
keyboardShortcutPaneHeading: "keyboard-shortcuts-pane-title",
|
|
7198
|
+
keyboardShortcutPaneCrossIcon: "keyboard-shortcuts-pane-close-button",
|
|
7199
|
+
};
|
|
7200
|
+
const CHAT_WIDGET_SELECTORS = {
|
|
7201
|
+
chatWidgetHomeCard: "neeto-chat-widget-cta-title",
|
|
7202
|
+
widgetSubmitButton: "neeto-chat-widget-pre-chat-submit-btn",
|
|
7203
|
+
chatBubbleMessage: "neeto-chat-widget-chat-message-bubble",
|
|
7204
|
+
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
7205
|
+
widgetIframe: "#neetochat-iframe",
|
|
7206
|
+
};
|
|
7207
|
+
|
|
7087
7208
|
const LOGIN_SELECTORS = {
|
|
7088
7209
|
appleAuthenticationButton: "apple-authentication-button",
|
|
7089
7210
|
emailTextField: "login-email-text-field",
|
|
@@ -7096,10 +7217,81 @@ const LOGIN_SELECTORS = {
|
|
|
7096
7217
|
twitterAuthenticationButton: "twitter-authentication-button",
|
|
7097
7218
|
};
|
|
7098
7219
|
|
|
7099
|
-
const
|
|
7220
|
+
const MEMBER_SELECTORS = {
|
|
7221
|
+
membersTab: "members-nav-tab",
|
|
7222
|
+
newButton: "ntm-add-member-button",
|
|
7223
|
+
continueButton: "ntm-manage-member-continue-button",
|
|
7224
|
+
submitButton: "ntm-manage-member-submit-button",
|
|
7225
|
+
searchTextField: "ntm-search-members-input",
|
|
7226
|
+
deactivatedAgentsButton: "ntm-members-menubar-deactivated-block",
|
|
7227
|
+
activatedMembersButton: "ntm-members-menubar-active-block",
|
|
7228
|
+
columnCheckBox: "neeto-ui-columns-checkbox",
|
|
7229
|
+
roleLabel: (role) => `${joinHyphenCase(role)}-radio-label`,
|
|
7230
|
+
dropDownIcon: "ntm-members-table-row-dropdown-button",
|
|
7231
|
+
editButton: "ntm-edit-member-button",
|
|
7232
|
+
menuBarHeading: "ntm-members-menubar-heading",
|
|
7233
|
+
activateOrDeactivateMember: "ntm-deactivate-member-button",
|
|
7234
|
+
columnsButton: "columns-dropdown-button",
|
|
7235
|
+
columnsDropdownContainer: "columns-dropdown-container",
|
|
7236
|
+
emailDropdownItemLabel: "email-checkbox-label",
|
|
7237
|
+
roleDropdownItemLabel: "role-checkbox-label",
|
|
7238
|
+
inviteStatusDropdownItemLabel: "invite-status-checkbox-label",
|
|
7239
|
+
heading: "ntm-manage-members-pane-header",
|
|
7240
|
+
activateButton: "ntm-activate-members-button",
|
|
7241
|
+
deactivateButton: "ntm-deactivate-members-button",
|
|
7242
|
+
rolesButton: "ntm-manage-member-roles-button",
|
|
7243
|
+
statusTag: "ntm-member-status-tag",
|
|
7244
|
+
};
|
|
7245
|
+
const MEMBER_FORM_SELECTORS = {
|
|
7246
|
+
emailTextField: "email-select-input-field",
|
|
7247
|
+
firstNameTextField: "ntm-edit-member-first-name-text-field",
|
|
7248
|
+
lastNameTextField: "ntm-edit-member-last-name-text-field",
|
|
7249
|
+
emailInput: "ntm-manage-member-email-input",
|
|
7250
|
+
emailErrorField: "emails-input-error",
|
|
7251
|
+
cancelButton: "ntm-manage-member-cancel-button",
|
|
7252
|
+
};
|
|
7100
7253
|
|
|
7101
|
-
const
|
|
7254
|
+
const ROLES_SELECTORS = {
|
|
7255
|
+
newButton: "ntm-add-role-button",
|
|
7256
|
+
proceedButton: "ntm-add-role-submit-button",
|
|
7257
|
+
cancelButton: "ntm-add-role-cancel-button",
|
|
7258
|
+
tableHeaderRoleName: "ntm-roles-table-role-header",
|
|
7259
|
+
nameTextField: "ntm-add-role-name-text-field",
|
|
7260
|
+
searchTextField: "ntm-search-roles-input",
|
|
7261
|
+
updateRolePaneHeading: "ntm-add-role-title",
|
|
7262
|
+
updateRoleCancelButton: "ntm-add-role-cancel-button",
|
|
7263
|
+
descriptionTextField: "ntm-add-role-description-text-field",
|
|
7264
|
+
permissionCategoryTitle: "ntm-roles-permission-category-title",
|
|
7265
|
+
headerColumn: "ntm-roles-table-header",
|
|
7266
|
+
dropDownIcon: "ntm-roles-table-header-role-dropdown-button",
|
|
7267
|
+
tableHeaderRoleTitle: "ntm-roles-table-header-role-title",
|
|
7268
|
+
};
|
|
7269
|
+
|
|
7270
|
+
const TAGS_SELECTORS = {
|
|
7271
|
+
newTagButton: "add-new-tag-button",
|
|
7272
|
+
tagNameTextField: "tag-name-text-field",
|
|
7273
|
+
editButton: "tags-edit-button",
|
|
7274
|
+
deleteButton: "tags-delete-button",
|
|
7275
|
+
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
7276
|
+
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
7277
|
+
searchTextField: "neeto-tags-search-text-input-field",
|
|
7278
|
+
descriptionTextArea: "tag-description-text-area",
|
|
7279
|
+
};
|
|
7280
|
+
const MERGE_TAGS_SELECTORS = {
|
|
7281
|
+
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
7282
|
+
mergeButton: "neeto-tags-merge-button",
|
|
7283
|
+
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
7284
|
+
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
7285
|
+
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
7286
|
+
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
7287
|
+
cancelButton: "neeto-tags-merge-cancel-button",
|
|
7288
|
+
proceedButton: "neeto-tags-merge-proceed-button",
|
|
7289
|
+
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
7290
|
+
};
|
|
7291
|
+
|
|
7292
|
+
const initializeCredentials = (product) => {
|
|
7102
7293
|
const { user } = readFileSyncIfExists();
|
|
7294
|
+
const stagingData = generateStagingData(product);
|
|
7103
7295
|
const newState = {
|
|
7104
7296
|
...user,
|
|
7105
7297
|
businessName: (user === null || user === void 0 ? void 0 : user.businessName) || stagingData.businessName,
|
|
@@ -7117,10 +7309,9 @@ const initializeCredentials = () => {
|
|
|
7117
7309
|
}
|
|
7118
7310
|
};
|
|
7119
7311
|
|
|
7120
|
-
const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, }) => {
|
|
7312
|
+
const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, loginPath = "/", }) => {
|
|
7121
7313
|
var _a;
|
|
7122
|
-
await page.goto((_a = process.env.BASE_URL) !== null && _a !== void 0 ? _a : "");
|
|
7123
|
-
let headers = {};
|
|
7314
|
+
await page.goto((_a = `${process.env.BASE_URL}${loginPath}`) !== null && _a !== void 0 ? _a : "");
|
|
7124
7315
|
await page.getByTestId("login-email-text-field").fill(CREDENTIALS.email);
|
|
7125
7316
|
await page
|
|
7126
7317
|
.getByTestId("login-password-text-field")
|
|
@@ -7130,23 +7321,16 @@ const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, }) => {
|
|
|
7130
7321
|
});
|
|
7131
7322
|
await page.getByTestId(LOGIN_SELECTORS.submitButton).click();
|
|
7132
7323
|
await login;
|
|
7133
|
-
await page.route(`**${BASE_URL}/**`, async (route) => {
|
|
7134
|
-
headers = await route.request().allHeaders();
|
|
7135
|
-
await route.continue();
|
|
7136
|
-
});
|
|
7137
7324
|
const userCredentials = readFileSyncIfExists();
|
|
7138
7325
|
await page.context().storageState({ path: STORAGE_STATE });
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
...userCredentials,
|
|
7144
|
-
headers,
|
|
7145
|
-
};
|
|
7326
|
+
const mergedCredentials = ramda.mergeAll([
|
|
7327
|
+
readFileSyncIfExists(),
|
|
7328
|
+
userCredentials,
|
|
7329
|
+
]);
|
|
7146
7330
|
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7147
7331
|
};
|
|
7148
|
-
const login = async ({ page, neetoPlaywrightUtilities }) => !IS_STAGING_ENV &&
|
|
7149
|
-
(await loginWithoutSSO({ page, neetoPlaywrightUtilities }));
|
|
7332
|
+
const login = async ({ page, neetoPlaywrightUtilities, loginPath, }) => !IS_STAGING_ENV &&
|
|
7333
|
+
(await loginWithoutSSO({ page, neetoPlaywrightUtilities, loginPath }));
|
|
7150
7334
|
|
|
7151
7335
|
var main$1 = {exports: {}};
|
|
7152
7336
|
|
|
@@ -7597,30 +7781,40 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7597
7781
|
};
|
|
7598
7782
|
|
|
7599
7783
|
exports.BASE_URL = BASE_URL;
|
|
7784
|
+
exports.CHAT_WIDGET_SELECTORS = CHAT_WIDGET_SELECTORS;
|
|
7600
7785
|
exports.COMMON_SELECTORS = COMMON_SELECTORS;
|
|
7601
|
-
exports.COMMON_TEXTS = COMMON_TEXTS;
|
|
7602
7786
|
exports.CREDENTIALS = CREDENTIALS;
|
|
7603
7787
|
exports.CustomCommands = CustomCommands;
|
|
7604
7788
|
exports.ENVIRONMENT = ENVIRONMENT;
|
|
7605
7789
|
exports.GLOBAL_TRANSLATIONS_PATTERN = GLOBAL_TRANSLATIONS_PATTERN;
|
|
7790
|
+
exports.HELP_CENTER_SELECTORS = HELP_CENTER_SELECTORS;
|
|
7606
7791
|
exports.IS_STAGING_ENV = IS_STAGING_ENV;
|
|
7607
7792
|
exports.LOGIN_SELECTORS = LOGIN_SELECTORS;
|
|
7793
|
+
exports.MEMBER_FORM_SELECTORS = MEMBER_FORM_SELECTORS;
|
|
7794
|
+
exports.MEMBER_SELECTORS = MEMBER_SELECTORS;
|
|
7795
|
+
exports.MERGE_TAGS_SELECTORS = MERGE_TAGS_SELECTORS;
|
|
7796
|
+
exports.NEETO_EDITOR_SELECTORS = NEETO_EDITOR_SELECTORS;
|
|
7797
|
+
exports.NEETO_FILTERS_SELECTORS = NEETO_FILTERS_SELECTORS;
|
|
7608
7798
|
exports.OrganizationPage = OrganizationPage;
|
|
7609
7799
|
exports.PROJECT_TRANSLATIONS_PATH = PROJECT_TRANSLATIONS_PATH;
|
|
7800
|
+
exports.ROLES_SELECTORS = ROLES_SELECTORS;
|
|
7610
7801
|
exports.ROUTES = ROUTES;
|
|
7611
7802
|
exports.SIGNUP_SELECTORS = SIGNUP_SELECTORS;
|
|
7612
7803
|
exports.STORAGE_STATE = STORAGE_STATE;
|
|
7804
|
+
exports.TAGS_SELECTORS = TAGS_SELECTORS;
|
|
7613
7805
|
exports.clearCredentials = clearCredentials;
|
|
7614
7806
|
exports.commands = commands;
|
|
7615
7807
|
exports.definePlaywrightConfig = definePlaywrightConfig;
|
|
7808
|
+
exports.generateStagingData = generateStagingData;
|
|
7809
|
+
exports.hyphenize = hyphenize;
|
|
7616
7810
|
exports.i18n = i18n;
|
|
7617
7811
|
exports.initializeCredentials = initializeCredentials;
|
|
7812
|
+
exports.joinHyphenCase = joinHyphenCase;
|
|
7618
7813
|
exports.joinString = joinString;
|
|
7619
7814
|
exports.login = login;
|
|
7620
7815
|
exports.loginWithoutSSO = loginWithoutSSO;
|
|
7621
7816
|
exports.readFileSyncIfExists = readFileSyncIfExists;
|
|
7622
7817
|
exports.readTranslations = readTranslations;
|
|
7623
|
-
exports.stagingData = stagingData;
|
|
7624
7818
|
exports.updateCredentials = updateCredentials;
|
|
7625
7819
|
exports.writeDataToFile = writeDataToFile;
|
|
7626
7820
|
//# sourceMappingURL=index.cjs.js.map
|