@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.js
CHANGED
|
@@ -6,23 +6,10 @@ import require$$0$1 from 'path';
|
|
|
6
6
|
import require$$0$2 from 'util';
|
|
7
7
|
import require$$0$3 from 'stream';
|
|
8
8
|
import require$$0$4 from 'events';
|
|
9
|
-
import { mergeDeepLeft } from 'ramda';
|
|
9
|
+
import { mergeDeepLeft, mergeAll } from 'ramda';
|
|
10
10
|
import dayjs from 'dayjs';
|
|
11
11
|
import require$$3 from 'crypto';
|
|
12
12
|
|
|
13
|
-
const COMMON_SELECTORS = {
|
|
14
|
-
toastMessage: "toastr-message-container",
|
|
15
|
-
toastIcon: ".Toastify__toast-icon",
|
|
16
|
-
toastCloseButton: "toastr-close-button",
|
|
17
|
-
dropdownIcon: "nui-dropdown-icon",
|
|
18
|
-
checkbox: "nui-checkbox-input",
|
|
19
|
-
spinner: ".neeto-ui-spinner",
|
|
20
|
-
input: "nui-input-field",
|
|
21
|
-
alertModalSubmitButton: "alert-submit-button",
|
|
22
|
-
selectContainer: "nui-select-container",
|
|
23
|
-
subheaderText: "subheader-left",
|
|
24
|
-
};
|
|
25
|
-
|
|
26
13
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
27
14
|
|
|
28
15
|
var tasks = {};
|
|
@@ -6730,7 +6717,11 @@ const IS_STAGING_ENV = process.env.TEST_ENV === "staging";
|
|
|
6730
6717
|
const STORAGE_STATE = "./e2e/auth/user.json";
|
|
6731
6718
|
const GLOBAL_TRANSLATIONS_PATTERN = "../node_modules/@bigbinary/**/translations/en.json";
|
|
6732
6719
|
const PROJECT_TRANSLATIONS_PATH = "../app/javascript/src/translations/en.json";
|
|
6733
|
-
const CREDENTIALS = {
|
|
6720
|
+
const CREDENTIALS = {
|
|
6721
|
+
name: "Oliver Smith",
|
|
6722
|
+
email: "oliver@example.com",
|
|
6723
|
+
password: "welcome",
|
|
6724
|
+
};
|
|
6734
6725
|
|
|
6735
6726
|
const joinString = (string1, string2, string3 = "", separator = " ") => {
|
|
6736
6727
|
if (string3 === "") {
|
|
@@ -6776,10 +6767,76 @@ const readTranslations = () => {
|
|
|
6776
6767
|
});
|
|
6777
6768
|
return translations;
|
|
6778
6769
|
};
|
|
6770
|
+
const hyphenize = input => {
|
|
6771
|
+
const fallbackString = "";
|
|
6772
|
+
if (typeof input === "number")
|
|
6773
|
+
return String(input);
|
|
6774
|
+
if (input && typeof input === "string" && input.replace) {
|
|
6775
|
+
return input
|
|
6776
|
+
.replace(/[\s_]/g, "-")
|
|
6777
|
+
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
6778
|
+
.replace(/-+/g, "-")
|
|
6779
|
+
.toLowerCase();
|
|
6780
|
+
}
|
|
6781
|
+
return fallbackString;
|
|
6782
|
+
};
|
|
6783
|
+
const joinHyphenCase = (...args) => args.join(" ").replace(/\s+/g, "-").toLowerCase();
|
|
6784
|
+
|
|
6785
|
+
const COMMON_SELECTORS = {
|
|
6786
|
+
spinner: ".neeto-ui-spinner",
|
|
6787
|
+
subheaderText: "subheader-left",
|
|
6788
|
+
alertTitle: "alert-title",
|
|
6789
|
+
alertModalMessage: "alert-message",
|
|
6790
|
+
alertModalSubmitButton: "alert-submit-button",
|
|
6791
|
+
checkbox: "nui-checkbox-input",
|
|
6792
|
+
checkboxLabel: "nui-checkbox-label",
|
|
6793
|
+
dropdownContainer: "nui-dropdown-container",
|
|
6794
|
+
dropdownIcon: "nui-dropdown-icon",
|
|
6795
|
+
heading: "main-header",
|
|
6796
|
+
paneBody: "pane-body",
|
|
6797
|
+
paneHeader: "pane-header",
|
|
6798
|
+
profileSidebar: "profile-section",
|
|
6799
|
+
selectOption: (label) => `${hyphenize(label)}-select-option`,
|
|
6800
|
+
toastMessage: "toastr-message-container",
|
|
6801
|
+
toastCloseButton: "toastr-close-button",
|
|
6802
|
+
windowAlert: "#alert-box",
|
|
6803
|
+
body: "body",
|
|
6804
|
+
toastIcon: ".Toastify__toast-icon",
|
|
6805
|
+
paneModalCrossIcon: "pane-close-button",
|
|
6806
|
+
inputField: "nui-input-field",
|
|
6807
|
+
alertConfirmationText: "alert-confirmation-text",
|
|
6808
|
+
alertCancelButton: "alert-cancel-button",
|
|
6809
|
+
alertModalCrossIcon: "modal-close-button",
|
|
6810
|
+
saveChangesButton: "save-changes-button",
|
|
6811
|
+
cancelButton: "cancel-button",
|
|
6812
|
+
inputFieldError: "nui-input-error",
|
|
6813
|
+
selectDropDownError: "nui-select-error",
|
|
6814
|
+
subTitleHeading: "menubar-subtitle-heading",
|
|
6815
|
+
noDataTitle: "no-data-title",
|
|
6816
|
+
noDataDescription: "no-data-description",
|
|
6817
|
+
backdrop: "neeto-backdrop",
|
|
6818
|
+
menuBarHeading: "menubar-heading",
|
|
6819
|
+
dropdownWrapper: "nui-select-container-wrapper",
|
|
6820
|
+
toggleButton: "menubar-toggle-button",
|
|
6821
|
+
tooltip: "tooltip-box",
|
|
6822
|
+
articlePageTitle: ".serene-article__title",
|
|
6823
|
+
tabItem: "tab-item",
|
|
6824
|
+
labelInputError: "label-input-error",
|
|
6825
|
+
urlInputError: "url-input-error",
|
|
6826
|
+
noDataPrimaryButton: "no-data-primary-button",
|
|
6827
|
+
modalHeader: "modal-header",
|
|
6828
|
+
nameInputError: "name-input-error",
|
|
6829
|
+
selectContainer: "nui-select-container",
|
|
6830
|
+
dropdownMenu: "nui-select-menu",
|
|
6831
|
+
sidebarToggle: "neeto-molecules-sidebar-toggler",
|
|
6832
|
+
subheader: "subheader",
|
|
6833
|
+
settingsLink: "Settings",
|
|
6834
|
+
ticketFieldTextInput: (label) => `${hyphenize(label)}-text-input`,
|
|
6835
|
+
};
|
|
6779
6836
|
|
|
6780
6837
|
class CustomCommands {
|
|
6781
6838
|
constructor(page, request) {
|
|
6782
|
-
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse(response => {
|
|
6839
|
+
this.interceptMultipleResponses = ({ responseUrl = "", times = 1, baseUrl, }) => Promise.all([...new Array(times)].map(() => this.page.waitForResponse((response) => {
|
|
6783
6840
|
var _a, _b, _c;
|
|
6784
6841
|
if (response.request().resourceType() === "xhr" &&
|
|
6785
6842
|
response.status() === 200 &&
|
|
@@ -6826,9 +6883,15 @@ class CustomCommands {
|
|
|
6826
6883
|
await reloadRequests;
|
|
6827
6884
|
};
|
|
6828
6885
|
this.apiRequest = async ({ url, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
6829
|
-
const
|
|
6886
|
+
const csrfToken = await this.page
|
|
6887
|
+
.locator("[name='csrf-token']")
|
|
6888
|
+
.getAttribute("content");
|
|
6830
6889
|
const requestOptions = {
|
|
6831
|
-
headers: {
|
|
6890
|
+
headers: {
|
|
6891
|
+
...additionalHeaders,
|
|
6892
|
+
"accept-encoding": "gzip",
|
|
6893
|
+
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
6894
|
+
},
|
|
6832
6895
|
data,
|
|
6833
6896
|
params,
|
|
6834
6897
|
...otherOptions,
|
|
@@ -6839,7 +6902,7 @@ class CustomCommands {
|
|
|
6839
6902
|
put: () => this.request.put(url, requestOptions),
|
|
6840
6903
|
delete: () => this.request.delete(url, requestOptions),
|
|
6841
6904
|
};
|
|
6842
|
-
return await httpMethodsHandlers[method
|
|
6905
|
+
return await httpMethodsHandlers[method]();
|
|
6843
6906
|
};
|
|
6844
6907
|
this.verifyFieldValue = values => {
|
|
6845
6908
|
const verifyEachFieldValue = ({ field, value, }) => expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
@@ -6865,24 +6928,26 @@ const commands = {
|
|
|
6865
6928
|
},
|
|
6866
6929
|
};
|
|
6867
6930
|
|
|
6868
|
-
const
|
|
6869
|
-
const
|
|
6870
|
-
const
|
|
6871
|
-
const
|
|
6872
|
-
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6873
|
-
const
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6931
|
+
const generateStagingData = (product = "invoice") => {
|
|
6932
|
+
const timestamp = dayjs().format("YYYYMMDDHH");
|
|
6933
|
+
const firstName = "André";
|
|
6934
|
+
const lastName = "O'Reilly";
|
|
6935
|
+
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
6936
|
+
const stagingOrganization = `cypresstest-${product}-${timestamp}`;
|
|
6937
|
+
return {
|
|
6938
|
+
firstName,
|
|
6939
|
+
lastName,
|
|
6940
|
+
otp: 111111,
|
|
6941
|
+
domain: `neeto${product}.net`,
|
|
6942
|
+
currentUserName: IS_STAGING_ENV
|
|
6943
|
+
? joinString(firstName, lastName)
|
|
6944
|
+
: CREDENTIALS.name,
|
|
6945
|
+
businessName: stagingOrganization,
|
|
6946
|
+
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
6947
|
+
email: IS_STAGING_ENV
|
|
6948
|
+
? `cypresstest${otpBypassKey}+${product}+${timestamp}-playwright@bigbinary.com`
|
|
6949
|
+
: "oliver@example.com",
|
|
6950
|
+
};
|
|
6886
6951
|
};
|
|
6887
6952
|
|
|
6888
6953
|
const i18n = {
|
|
@@ -6903,12 +6968,19 @@ const i18n = {
|
|
|
6903
6968
|
const BASE_URL = "/api/v1";
|
|
6904
6969
|
const ROUTES = {
|
|
6905
6970
|
neetoAuth: "https://app.neetoauth.net",
|
|
6971
|
+
neetoAuthSignup: "https://app.neetoauth.net/signups/new",
|
|
6906
6972
|
profile: "/profile",
|
|
6907
6973
|
login: `${BASE_URL}/login`,
|
|
6908
6974
|
signup: `${BASE_URL}/signups`,
|
|
6909
6975
|
subdomainAvailability: `${BASE_URL}/subdomain_availability`,
|
|
6910
6976
|
countries: `${BASE_URL}/countries`,
|
|
6911
6977
|
neetoApps: `${BASE_URL}/neeto_apps`,
|
|
6978
|
+
teamMembers: {
|
|
6979
|
+
all: "/team_members*/**",
|
|
6980
|
+
bulkUpdate: "/team_members/teams/bulk_update",
|
|
6981
|
+
index: "/team_members/teams",
|
|
6982
|
+
show: (id) => `/team_members/teams/${id}`,
|
|
6983
|
+
},
|
|
6912
6984
|
};
|
|
6913
6985
|
|
|
6914
6986
|
const SIGNUP_SELECTORS = {
|
|
@@ -6940,10 +7012,9 @@ class OrganizationPage {
|
|
|
6940
7012
|
const defaultOtp = "123456";
|
|
6941
7013
|
const appNameInLowerCase = appName.toLowerCase();
|
|
6942
7014
|
const isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
6943
|
-
const authUrl = "https://app.neetoauth.net/signups/new";
|
|
6944
7015
|
isNeetoAuth
|
|
6945
|
-
? await this.page.goto(
|
|
6946
|
-
: await this.page.goto(`${
|
|
7016
|
+
? await this.page.goto(ROUTES.neetoAuthSignup)
|
|
7017
|
+
: await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net`);
|
|
6947
7018
|
await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
|
|
6948
7019
|
const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
|
|
6949
7020
|
responseUrl: ROUTES.signup,
|
|
@@ -6987,10 +7058,9 @@ class OrganizationPage {
|
|
|
6987
7058
|
await this.page.getByTestId(SIGNUP_SELECTORS.profileSubmitButton).click();
|
|
6988
7059
|
await submitProfile;
|
|
6989
7060
|
};
|
|
6990
|
-
this.setupOrganization = async () => {
|
|
7061
|
+
this.setupOrganization = async (product) => {
|
|
6991
7062
|
if (!IS_STAGING_ENV)
|
|
6992
7063
|
return;
|
|
6993
|
-
let headers = {};
|
|
6994
7064
|
const { user } = readFileSyncIfExists();
|
|
6995
7065
|
await this.createOrganization({
|
|
6996
7066
|
businessName: user.businessName,
|
|
@@ -6998,20 +7068,15 @@ class OrganizationPage {
|
|
|
6998
7068
|
firstName: user.firstName,
|
|
6999
7069
|
lastName: user.lastName,
|
|
7000
7070
|
subdomainName: user.subdomainName,
|
|
7001
|
-
appName:
|
|
7002
|
-
});
|
|
7003
|
-
await this.page.route(`**${ROUTES.neetoApps}`, async (route) => {
|
|
7004
|
-
headers = await route.request().allHeaders();
|
|
7005
|
-
await route.continue();
|
|
7071
|
+
appName: `neeto${product}`,
|
|
7006
7072
|
});
|
|
7007
7073
|
await expect(this.page.locator(COMMON_SELECTORS.spinner)).toBeHidden();
|
|
7008
7074
|
const userCredentials = readFileSyncIfExists();
|
|
7009
7075
|
await this.page.context().storageState({ path: STORAGE_STATE });
|
|
7010
|
-
const mergedCredentials =
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
};
|
|
7076
|
+
const mergedCredentials = mergeAll([
|
|
7077
|
+
readFileSyncIfExists(),
|
|
7078
|
+
userCredentials,
|
|
7079
|
+
]);
|
|
7015
7080
|
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7016
7081
|
};
|
|
7017
7082
|
this.updateSubdomainIfExists = async (appName) => {
|
|
@@ -7051,6 +7116,62 @@ class OrganizationPage {
|
|
|
7051
7116
|
}
|
|
7052
7117
|
}
|
|
7053
7118
|
|
|
7119
|
+
const NEETO_EDITOR_SELECTORS = {
|
|
7120
|
+
boldOption: "neeto-editor-fixed-menu-bold-option",
|
|
7121
|
+
italicOption: "neeto-editor-fixed-menu-italic-option",
|
|
7122
|
+
underlineOption: "neeto-editor-fixed-menu-underline-option",
|
|
7123
|
+
strikeOption: "neeto-editor-fixed-menu-strike-option",
|
|
7124
|
+
codeBlockOption: "neeto-editor-fixed-menu-code-option",
|
|
7125
|
+
highlightOption: "neeto-editor-fixed-menu-highlight-option",
|
|
7126
|
+
linkInput: "neeto-editor-fixed-menu-link-option-input",
|
|
7127
|
+
linkSubmitButton: "neeto-editor-fixed-menu-link-option-link-button",
|
|
7128
|
+
commandList: (index) => `neeto-editor-command-list-item-${index}`,
|
|
7129
|
+
imageUploadUrlSubmitButton: "neeto-editor-media-upload-url-submit",
|
|
7130
|
+
imageUploadUrlInputTextField: "neeto-editor-media-upload-url-input",
|
|
7131
|
+
uploadInput: "neeto-editor-media-uploader-input",
|
|
7132
|
+
editorMenuBarWrapper: "neeto-editor-fixed-menu-wrapper",
|
|
7133
|
+
undoOption: "neeto-editor-fixed-menu-undo-option",
|
|
7134
|
+
redoOption: "neeto-editor-fixed-menu-redo-option",
|
|
7135
|
+
imageWrapper: "neeto-editor-image-wrapper",
|
|
7136
|
+
};
|
|
7137
|
+
|
|
7138
|
+
const NEETO_FILTERS_SELECTORS = {
|
|
7139
|
+
emailSelectContainer: "email-select-container-wrapper",
|
|
7140
|
+
filterPaneHeading: "neeto-filters-pane-header",
|
|
7141
|
+
neetoFiltersEmailBlock: "neeto-filters-email-block",
|
|
7142
|
+
neetoFiltersRoleBlock: "neeto-filters-role-block",
|
|
7143
|
+
neetoFiltersBarClearButton: "neeto-filters-bar-clear-btn",
|
|
7144
|
+
neetoFiltersNameFilterField: "neeto-filters-name-filter",
|
|
7145
|
+
neetoFilterNameBlock: "neeto-filters-name-block",
|
|
7146
|
+
roleSelectContainer: "role-select-container-wrapper",
|
|
7147
|
+
filterButton: "neeto-filters-toggle-btn",
|
|
7148
|
+
filtersClearButton: "neeto-filters-clear-btn",
|
|
7149
|
+
filterDoneButton: "neeto-filters-done-btn",
|
|
7150
|
+
filteredMembersCount: "ntm-filtered-members-count",
|
|
7151
|
+
allMenubarBlock: "ntm-members-menubar-all-block",
|
|
7152
|
+
filtersEmailFilter: "neeto-filters-email-filter",
|
|
7153
|
+
paneModalCrossIcon: "neeto-filters-close-button",
|
|
7154
|
+
};
|
|
7155
|
+
|
|
7156
|
+
const HELP_CENTER_SELECTORS = {
|
|
7157
|
+
helpButton: "help-button",
|
|
7158
|
+
documentationButton: "help-link-help-center-button",
|
|
7159
|
+
keyboardShortcutButton: "help-link-keyboard-shortcut-button",
|
|
7160
|
+
chatButton: "help-link-live-chat-button",
|
|
7161
|
+
whatsNewButton: "help-link-changelog-button",
|
|
7162
|
+
whatsNewWidgetInfo: "h1",
|
|
7163
|
+
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
7164
|
+
keyboardShortcutPaneHeading: "keyboard-shortcuts-pane-title",
|
|
7165
|
+
keyboardShortcutPaneCrossIcon: "keyboard-shortcuts-pane-close-button",
|
|
7166
|
+
};
|
|
7167
|
+
const CHAT_WIDGET_SELECTORS = {
|
|
7168
|
+
chatWidgetHomeCard: "neeto-chat-widget-cta-title",
|
|
7169
|
+
widgetSubmitButton: "neeto-chat-widget-pre-chat-submit-btn",
|
|
7170
|
+
chatBubbleMessage: "neeto-chat-widget-chat-message-bubble",
|
|
7171
|
+
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
7172
|
+
widgetIframe: "#neetochat-iframe",
|
|
7173
|
+
};
|
|
7174
|
+
|
|
7054
7175
|
const LOGIN_SELECTORS = {
|
|
7055
7176
|
appleAuthenticationButton: "apple-authentication-button",
|
|
7056
7177
|
emailTextField: "login-email-text-field",
|
|
@@ -7063,10 +7184,81 @@ const LOGIN_SELECTORS = {
|
|
|
7063
7184
|
twitterAuthenticationButton: "twitter-authentication-button",
|
|
7064
7185
|
};
|
|
7065
7186
|
|
|
7066
|
-
const
|
|
7187
|
+
const MEMBER_SELECTORS = {
|
|
7188
|
+
membersTab: "members-nav-tab",
|
|
7189
|
+
newButton: "ntm-add-member-button",
|
|
7190
|
+
continueButton: "ntm-manage-member-continue-button",
|
|
7191
|
+
submitButton: "ntm-manage-member-submit-button",
|
|
7192
|
+
searchTextField: "ntm-search-members-input",
|
|
7193
|
+
deactivatedAgentsButton: "ntm-members-menubar-deactivated-block",
|
|
7194
|
+
activatedMembersButton: "ntm-members-menubar-active-block",
|
|
7195
|
+
columnCheckBox: "neeto-ui-columns-checkbox",
|
|
7196
|
+
roleLabel: (role) => `${joinHyphenCase(role)}-radio-label`,
|
|
7197
|
+
dropDownIcon: "ntm-members-table-row-dropdown-button",
|
|
7198
|
+
editButton: "ntm-edit-member-button",
|
|
7199
|
+
menuBarHeading: "ntm-members-menubar-heading",
|
|
7200
|
+
activateOrDeactivateMember: "ntm-deactivate-member-button",
|
|
7201
|
+
columnsButton: "columns-dropdown-button",
|
|
7202
|
+
columnsDropdownContainer: "columns-dropdown-container",
|
|
7203
|
+
emailDropdownItemLabel: "email-checkbox-label",
|
|
7204
|
+
roleDropdownItemLabel: "role-checkbox-label",
|
|
7205
|
+
inviteStatusDropdownItemLabel: "invite-status-checkbox-label",
|
|
7206
|
+
heading: "ntm-manage-members-pane-header",
|
|
7207
|
+
activateButton: "ntm-activate-members-button",
|
|
7208
|
+
deactivateButton: "ntm-deactivate-members-button",
|
|
7209
|
+
rolesButton: "ntm-manage-member-roles-button",
|
|
7210
|
+
statusTag: "ntm-member-status-tag",
|
|
7211
|
+
};
|
|
7212
|
+
const MEMBER_FORM_SELECTORS = {
|
|
7213
|
+
emailTextField: "email-select-input-field",
|
|
7214
|
+
firstNameTextField: "ntm-edit-member-first-name-text-field",
|
|
7215
|
+
lastNameTextField: "ntm-edit-member-last-name-text-field",
|
|
7216
|
+
emailInput: "ntm-manage-member-email-input",
|
|
7217
|
+
emailErrorField: "emails-input-error",
|
|
7218
|
+
cancelButton: "ntm-manage-member-cancel-button",
|
|
7219
|
+
};
|
|
7220
|
+
|
|
7221
|
+
const ROLES_SELECTORS = {
|
|
7222
|
+
newButton: "ntm-add-role-button",
|
|
7223
|
+
proceedButton: "ntm-add-role-submit-button",
|
|
7224
|
+
cancelButton: "ntm-add-role-cancel-button",
|
|
7225
|
+
tableHeaderRoleName: "ntm-roles-table-role-header",
|
|
7226
|
+
nameTextField: "ntm-add-role-name-text-field",
|
|
7227
|
+
searchTextField: "ntm-search-roles-input",
|
|
7228
|
+
updateRolePaneHeading: "ntm-add-role-title",
|
|
7229
|
+
updateRoleCancelButton: "ntm-add-role-cancel-button",
|
|
7230
|
+
descriptionTextField: "ntm-add-role-description-text-field",
|
|
7231
|
+
permissionCategoryTitle: "ntm-roles-permission-category-title",
|
|
7232
|
+
headerColumn: "ntm-roles-table-header",
|
|
7233
|
+
dropDownIcon: "ntm-roles-table-header-role-dropdown-button",
|
|
7234
|
+
tableHeaderRoleTitle: "ntm-roles-table-header-role-title",
|
|
7235
|
+
};
|
|
7236
|
+
|
|
7237
|
+
const TAGS_SELECTORS = {
|
|
7238
|
+
newTagButton: "add-new-tag-button",
|
|
7239
|
+
tagNameTextField: "tag-name-text-field",
|
|
7240
|
+
editButton: "tags-edit-button",
|
|
7241
|
+
deleteButton: "tags-delete-button",
|
|
7242
|
+
cancelButton: "neeto-tags-manage-tag-cancel-button",
|
|
7243
|
+
submitButton: "neeto-tags-manage-tag-submit-button",
|
|
7244
|
+
searchTextField: "neeto-tags-search-text-input-field",
|
|
7245
|
+
descriptionTextArea: "tag-description-text-area",
|
|
7246
|
+
};
|
|
7247
|
+
const MERGE_TAGS_SELECTORS = {
|
|
7248
|
+
mergeTagsButton: "neeto-tags-merge-tags-button",
|
|
7249
|
+
mergeButton: "neeto-tags-merge-button",
|
|
7250
|
+
sourceSearchTextField: "neeto-tags-merge-source-search-text-input-field",
|
|
7251
|
+
sourceTagsList: "neeto-tags-merge-source-tags-list",
|
|
7252
|
+
destinationTagsList: "neeto-tags-merge-destination-tags-list",
|
|
7253
|
+
destinationSearchTextField: "neeto-tags-merge-destination-search-text-input-field",
|
|
7254
|
+
cancelButton: "neeto-tags-merge-cancel-button",
|
|
7255
|
+
proceedButton: "neeto-tags-merge-proceed-button",
|
|
7256
|
+
disabledTag: ".neeto-ui-cursor-not-allowed",
|
|
7257
|
+
};
|
|
7067
7258
|
|
|
7068
|
-
const initializeCredentials = () => {
|
|
7259
|
+
const initializeCredentials = (product) => {
|
|
7069
7260
|
const { user } = readFileSyncIfExists();
|
|
7261
|
+
const stagingData = generateStagingData(product);
|
|
7070
7262
|
const newState = {
|
|
7071
7263
|
...user,
|
|
7072
7264
|
businessName: (user === null || user === void 0 ? void 0 : user.businessName) || stagingData.businessName,
|
|
@@ -7084,10 +7276,9 @@ const initializeCredentials = () => {
|
|
|
7084
7276
|
}
|
|
7085
7277
|
};
|
|
7086
7278
|
|
|
7087
|
-
const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, }) => {
|
|
7279
|
+
const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, loginPath = "/", }) => {
|
|
7088
7280
|
var _a;
|
|
7089
|
-
await page.goto((_a = process.env.BASE_URL) !== null && _a !== void 0 ? _a : "");
|
|
7090
|
-
let headers = {};
|
|
7281
|
+
await page.goto((_a = `${process.env.BASE_URL}${loginPath}`) !== null && _a !== void 0 ? _a : "");
|
|
7091
7282
|
await page.getByTestId("login-email-text-field").fill(CREDENTIALS.email);
|
|
7092
7283
|
await page
|
|
7093
7284
|
.getByTestId("login-password-text-field")
|
|
@@ -7097,23 +7288,16 @@ const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, }) => {
|
|
|
7097
7288
|
});
|
|
7098
7289
|
await page.getByTestId(LOGIN_SELECTORS.submitButton).click();
|
|
7099
7290
|
await login;
|
|
7100
|
-
await page.route(`**${BASE_URL}/**`, async (route) => {
|
|
7101
|
-
headers = await route.request().allHeaders();
|
|
7102
|
-
await route.continue();
|
|
7103
|
-
});
|
|
7104
7291
|
const userCredentials = readFileSyncIfExists();
|
|
7105
7292
|
await page.context().storageState({ path: STORAGE_STATE });
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
...userCredentials,
|
|
7111
|
-
headers,
|
|
7112
|
-
};
|
|
7293
|
+
const mergedCredentials = mergeAll([
|
|
7294
|
+
readFileSyncIfExists(),
|
|
7295
|
+
userCredentials,
|
|
7296
|
+
]);
|
|
7113
7297
|
writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
|
|
7114
7298
|
};
|
|
7115
|
-
const login = async ({ page, neetoPlaywrightUtilities }) => !IS_STAGING_ENV &&
|
|
7116
|
-
(await loginWithoutSSO({ page, neetoPlaywrightUtilities }));
|
|
7299
|
+
const login = async ({ page, neetoPlaywrightUtilities, loginPath, }) => !IS_STAGING_ENV &&
|
|
7300
|
+
(await loginWithoutSSO({ page, neetoPlaywrightUtilities, loginPath }));
|
|
7117
7301
|
|
|
7118
7302
|
var main$1 = {exports: {}};
|
|
7119
7303
|
|
|
@@ -7563,5 +7747,5 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
7563
7747
|
});
|
|
7564
7748
|
};
|
|
7565
7749
|
|
|
7566
|
-
export { BASE_URL,
|
|
7750
|
+
export { BASE_URL, CHAT_WIDGET_SELECTORS, COMMON_SELECTORS, CREDENTIALS, CustomCommands, ENVIRONMENT, GLOBAL_TRANSLATIONS_PATTERN, HELP_CENTER_SELECTORS, IS_STAGING_ENV, LOGIN_SELECTORS, MEMBER_FORM_SELECTORS, MEMBER_SELECTORS, MERGE_TAGS_SELECTORS, NEETO_EDITOR_SELECTORS, NEETO_FILTERS_SELECTORS, OrganizationPage, PROJECT_TRANSLATIONS_PATH, ROLES_SELECTORS, ROUTES, SIGNUP_SELECTORS, STORAGE_STATE, TAGS_SELECTORS, clearCredentials, commands, definePlaywrightConfig, generateStagingData, hyphenize, i18n, initializeCredentials, joinHyphenCase, joinString, login, loginWithoutSSO, readFileSyncIfExists, readTranslations, updateCredentials, writeDataToFile };
|
|
7567
7751
|
//# sourceMappingURL=index.js.map
|