@bigbinary/neeto-commons-frontend 2.0.73 → 2.0.75
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/configs/nanos/eslint/neeto.js +5 -3
- package/cypress-commands.d.ts +19 -3
- package/cypress-utils.cjs.js +269 -28
- package/cypress-utils.cjs.js.map +1 -1
- package/cypress-utils.d.ts +88 -4
- package/cypress-utils.js +265 -29
- package/cypress-utils.js.map +1 -1
- package/package.json +1 -1
- package/react-utils.cjs.js +3 -1
- package/react-utils.cjs.js.map +1 -1
- package/react-utils.js +3 -1
- package/react-utils.js.map +1 -1
package/cypress-utils.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ type CommonSelectors = {
|
|
|
33
33
|
dropdownWrapper: (index: string) => string;
|
|
34
34
|
toggleButton: string;
|
|
35
35
|
tooltip: string;
|
|
36
|
+
articlePageTitle: string;
|
|
36
37
|
};
|
|
37
38
|
type MemberSelectors = {
|
|
38
39
|
activatedMembersButton: string;
|
|
@@ -51,6 +52,17 @@ type MemberSelectors = {
|
|
|
51
52
|
roleLabel: (role: string) => string;
|
|
52
53
|
searchTextField: string;
|
|
53
54
|
submitButton: string;
|
|
55
|
+
subHeader: string;
|
|
56
|
+
columnsButton: string;
|
|
57
|
+
columnsDropdownContainer: string;
|
|
58
|
+
emailDropdownItemLabel: string;
|
|
59
|
+
roleDropdownItemLabel: string;
|
|
60
|
+
inviteStatusDropdownItemLabel: string;
|
|
61
|
+
heading: string;
|
|
62
|
+
activateButton: string;
|
|
63
|
+
deactivateButton: string;
|
|
64
|
+
rolesButton: string;
|
|
65
|
+
statusTag: string;
|
|
54
66
|
};
|
|
55
67
|
type MemberFormSelectors = {
|
|
56
68
|
emailTextField: string;
|
|
@@ -76,6 +88,8 @@ type ProfileSelectors = {
|
|
|
76
88
|
tab: string;
|
|
77
89
|
logoutLink: string;
|
|
78
90
|
profileOptionsContainer: string;
|
|
91
|
+
myProfileButton: string;
|
|
92
|
+
organizationSettingsButton: string;
|
|
79
93
|
};
|
|
80
94
|
type SignUpSelectors = {
|
|
81
95
|
emailTextField: string;
|
|
@@ -90,6 +104,24 @@ type SignUpSelectors = {
|
|
|
90
104
|
subdomainNameTextField: string;
|
|
91
105
|
subdomainError: string;
|
|
92
106
|
};
|
|
107
|
+
type HelpIconSelectors = {
|
|
108
|
+
helpButton: string;
|
|
109
|
+
documentationButton: string;
|
|
110
|
+
keyboardShortcutButton: string;
|
|
111
|
+
chatButton: string;
|
|
112
|
+
whatsNewButton: string;
|
|
113
|
+
whatsNewWidgetInfo: string;
|
|
114
|
+
whatsNewWidgetCloseButton: string;
|
|
115
|
+
keyboardShortcutPaneHeading: string;
|
|
116
|
+
keyboardShortcutPaneCrossIcon: string;
|
|
117
|
+
};
|
|
118
|
+
type ChatWidgetSelectors = {
|
|
119
|
+
chatWidgetHomeCard: string;
|
|
120
|
+
widgetSubmitButton: string;
|
|
121
|
+
chatBubbleMessage: string;
|
|
122
|
+
chatCloseButton: string;
|
|
123
|
+
widgetIframe: string;
|
|
124
|
+
};
|
|
93
125
|
|
|
94
126
|
// texts ------------------------------------------------
|
|
95
127
|
type CommonTexts = {
|
|
@@ -115,7 +147,8 @@ type CommonTexts = {
|
|
|
115
147
|
settings: string;
|
|
116
148
|
unsavedChangesAlertTitle: string;
|
|
117
149
|
unsavedChangesAlertMessage: string;
|
|
118
|
-
|
|
150
|
+
clearFilters: string;
|
|
151
|
+
filters: string;
|
|
119
152
|
};
|
|
120
153
|
type MemberText = {
|
|
121
154
|
addMember: string;
|
|
@@ -136,6 +169,12 @@ type MemberText = {
|
|
|
136
169
|
members: string;
|
|
137
170
|
newHeading: string;
|
|
138
171
|
updatedMemberRole: string;
|
|
172
|
+
searchMembers: string;
|
|
173
|
+
noDataTitle: string;
|
|
174
|
+
editor: string;
|
|
175
|
+
changeRole: string;
|
|
176
|
+
changeRoleAlertMsg: string;
|
|
177
|
+
collaborator: string;
|
|
139
178
|
};
|
|
140
179
|
type MemberTableTexts = {
|
|
141
180
|
created: string;
|
|
@@ -158,6 +197,24 @@ type Environment = {
|
|
|
158
197
|
development: string;
|
|
159
198
|
staging: string;
|
|
160
199
|
};
|
|
200
|
+
type HelpIconTexts = {
|
|
201
|
+
documentation: string;
|
|
202
|
+
welcome: string;
|
|
203
|
+
keyboardShortcuts: string;
|
|
204
|
+
chatWithUs: string;
|
|
205
|
+
newConversation: string;
|
|
206
|
+
chatMessage: string;
|
|
207
|
+
whatsNew: string;
|
|
208
|
+
whatsNewHeading: string;
|
|
209
|
+
};
|
|
210
|
+
type ProfileTexts = {
|
|
211
|
+
logout: string;
|
|
212
|
+
productSwitcher: string;
|
|
213
|
+
chooseYourNeetoProduct: string;
|
|
214
|
+
myProfile: string;
|
|
215
|
+
profileSettings: string;
|
|
216
|
+
myOrganization: string;
|
|
217
|
+
};
|
|
161
218
|
|
|
162
219
|
// utils ------------------------------------------------
|
|
163
220
|
|
|
@@ -293,6 +350,18 @@ type EditMemberViaRequestPropsType = {
|
|
|
293
350
|
lastName: string;
|
|
294
351
|
requestCount: number;
|
|
295
352
|
};
|
|
353
|
+
type VerifyTabMenuPropsType = {
|
|
354
|
+
tabSelector: string;
|
|
355
|
+
toolTiptext: string;
|
|
356
|
+
alias: string;
|
|
357
|
+
requestCount: number;
|
|
358
|
+
};
|
|
359
|
+
type VerifyHelpDocumentationLinkPropsType = {
|
|
360
|
+
url: string;
|
|
361
|
+
articleTitle: string;
|
|
362
|
+
alias: string;
|
|
363
|
+
requestCount: number;
|
|
364
|
+
};
|
|
296
365
|
export const memberUtils: {
|
|
297
366
|
addMemberViaRequest: (props: AddMemberViaRequestPropsType) => void;
|
|
298
367
|
addMemberViaUI: (props: AddMemberViaUIPropsType) => void;
|
|
@@ -300,13 +369,24 @@ export const memberUtils: {
|
|
|
300
369
|
editMemberViaUI: (props: EditMemberPropsType) => void;
|
|
301
370
|
editMemberViaRequest: (props: EditMemberViaRequestPropsType) => void;
|
|
302
371
|
deactivateMember: (props: DeactivateMembersPropsType) => void;
|
|
303
|
-
|
|
372
|
+
checkColumnAndVerifyTableHeader: (fieldSelector: string) => void;
|
|
304
373
|
deactivateMemberViaRequest: (email: string, requestCount: number) => void;
|
|
305
374
|
updateMemberRole: (props: UpdateMembersPropsType) => void;
|
|
306
375
|
interceptMemberApi: (alias: string, times: number) => void;
|
|
307
376
|
navigateToMembersPage: (waitForRequest: boolean) => void;
|
|
308
|
-
|
|
377
|
+
unCheckColumnAndVerifyTableHeader: (fieldSelector: string) => void;
|
|
309
378
|
verifyMemberDetails: (props: VerifyMembersPropsType) => void;
|
|
379
|
+
clickOnColumnIcon: (props: clickOnColumnIcon) => void;
|
|
380
|
+
};
|
|
381
|
+
export const navigationUtils: {
|
|
382
|
+
verifyTabMenu: (props: VerifyTabMenuPropsType) => void;
|
|
383
|
+
clickOnHelpSubTab: (tabSelector: string, tabText: string) => void;
|
|
384
|
+
verifyHelpDocumentationLink: (props: VerifyHelpDocumentationLinkPropsType) => void;
|
|
385
|
+
verifyKeyboardShortcutsPane: () => void;
|
|
386
|
+
verifyWhatsNewTab: (whatsNewHeading: string) => void;
|
|
387
|
+
verifyChatWithUsTab: () => void;
|
|
388
|
+
verifyMyProfileTab: () => void;
|
|
389
|
+
verifyOrganizationTab: () => void;
|
|
310
390
|
};
|
|
311
391
|
|
|
312
392
|
// exporting all selectors
|
|
@@ -317,6 +397,8 @@ export const loginSelectors: LoginSelectors;
|
|
|
317
397
|
export const profileSelectors: ProfileSelectors;
|
|
318
398
|
export const signUpSelectors: SignUpSelectors;
|
|
319
399
|
export const memberFormSelectors: MemberFormSelectors;
|
|
400
|
+
export const helpIconSelectors: HelpIconSelectors;
|
|
401
|
+
export const chatWidgetSelectors: ChatWidgetSelectors;
|
|
320
402
|
|
|
321
403
|
// exporting all texts
|
|
322
404
|
|
|
@@ -326,4 +408,6 @@ export const memberTableTexts: MemberTableTexts;
|
|
|
326
408
|
export const memberFormErrorTexts: MemberFormErrorTexts;
|
|
327
409
|
export const signUpTexts: SignUpTexts;
|
|
328
410
|
export const environment: Environment;
|
|
329
|
-
export const isStagingEnv: boolean;
|
|
411
|
+
export const isStagingEnv: boolean;
|
|
412
|
+
export const helpIconTexts: HelpIconTexts;
|
|
413
|
+
export const profileTexts: ProfileTexts;
|
package/cypress-utils.js
CHANGED
|
@@ -135,7 +135,7 @@ var allPath = function allPath() {
|
|
|
135
135
|
var requestApis = {
|
|
136
136
|
countries: getUrl("countries"),
|
|
137
137
|
signUp: getUrl("signups/**"),
|
|
138
|
-
|
|
138
|
+
subdomainAvailability: getUrl("subdomain_availability/**"),
|
|
139
139
|
teamMembers: {
|
|
140
140
|
all: "/team_members*/**",
|
|
141
141
|
bulkUpdate: "/team_members/teams/bulk_update",
|
|
@@ -143,6 +143,13 @@ var requestApis = {
|
|
|
143
143
|
show: function show(id) {
|
|
144
144
|
return "/team_members/teams/".concat(id);
|
|
145
145
|
}
|
|
146
|
+
},
|
|
147
|
+
allChatPath: "https://neetokbhelp.neetochat.net".concat(getUrl("**")),
|
|
148
|
+
myProfilePath: function myProfilePath(subdomain) {
|
|
149
|
+
return "https://".concat(subdomain, ".neetoauth.net/my/profile");
|
|
150
|
+
},
|
|
151
|
+
settingsPath: function settingsPath(subdomain) {
|
|
152
|
+
return "https://".concat(subdomain, ".neetoauth.net/settings");
|
|
146
153
|
}
|
|
147
154
|
};
|
|
148
155
|
var urlPaths = {
|
|
@@ -193,7 +200,8 @@ var commonSelectors = {
|
|
|
193
200
|
return dataCy("nui-select-container-wrapper", ":eq(".concat(index, ")"));
|
|
194
201
|
},
|
|
195
202
|
toggleButton: dataCy("menubar-toggle-button"),
|
|
196
|
-
tooltip: ".tippy-box"
|
|
203
|
+
tooltip: ".tippy-box",
|
|
204
|
+
articlePageTitle: ".serene-article__title"
|
|
197
205
|
};
|
|
198
206
|
var tableSelectors = {
|
|
199
207
|
nthColumn: function nthColumn(n) {
|
|
@@ -210,7 +218,9 @@ var tableSelectors = {
|
|
|
210
218
|
var profileSelectors = {
|
|
211
219
|
tab: dataCy("profile-section"),
|
|
212
220
|
logoutLink: dataCy("profile-logout-button"),
|
|
213
|
-
profileOptionsContainer: '[class="tippy-box sidebar-featured-tooltip__content"]'
|
|
221
|
+
profileOptionsContainer: '[class="tippy-box sidebar-featured-tooltip__content"]',
|
|
222
|
+
myProfileButton: dataCy("my-profile-button"),
|
|
223
|
+
organizationSettingsButton: dataCy("profile-organization-settings-button")
|
|
214
224
|
};
|
|
215
225
|
|
|
216
226
|
var commonTexts = {
|
|
@@ -235,7 +245,9 @@ var commonTexts = {
|
|
|
235
245
|
proceed: "Proceed",
|
|
236
246
|
settings: "Settings",
|
|
237
247
|
unsavedChangesAlertTitle: "You have unsaved changes!",
|
|
238
|
-
unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost."
|
|
248
|
+
unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost.",
|
|
249
|
+
clearFilters: "Clear filters",
|
|
250
|
+
filters: "Filters"
|
|
239
251
|
};
|
|
240
252
|
|
|
241
253
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -270,9 +282,10 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
270
282
|
cy.get(commonSelectors.toastMessage).should("not.exist");
|
|
271
283
|
});
|
|
272
284
|
Cypress.Commands.add("verifyToastIcon", function () {
|
|
273
|
-
|
|
274
|
-
cy.
|
|
275
|
-
cy.
|
|
285
|
+
var closeToastr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
286
|
+
cy.document().its("body").find(commonSelectors.toastIcon).should("have.text", "👍");
|
|
287
|
+
closeToastr && cy.document().its("body").find(commonSelectors.toastCloseButton).click();
|
|
288
|
+
cy.document().its("body").find(commonSelectors.toastIcon).should("not.exist");
|
|
276
289
|
});
|
|
277
290
|
Cypress.Commands.add("continueOnAlert", function (args) {
|
|
278
291
|
var props = _typeof(args) === "object" ? args : {
|
|
@@ -338,9 +351,19 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
338
351
|
Cypress.Commands.add("getValue", function (selector) {
|
|
339
352
|
return cy.get(selector).invoke("val");
|
|
340
353
|
});
|
|
354
|
+
|
|
355
|
+
// Deprecated. Use withinIframe.
|
|
341
356
|
Cypress.Commands.add("getIframe", function (iframeSelector) {
|
|
342
357
|
return cy.get(iframeSelector).its("0.contentDocument.body").should("not.be.empty");
|
|
343
358
|
});
|
|
359
|
+
Cypress.Commands.add("withinIframe", function (selector, callback) {
|
|
360
|
+
cy.get(selector, {
|
|
361
|
+
timeout: 10000
|
|
362
|
+
}).its("0.contentDocument.body").should("be.visible").and("not.be.empty");
|
|
363
|
+
cy.get(selector, {
|
|
364
|
+
timeout: 10000
|
|
365
|
+
}).its("0.contentDocument.body").eq(0).within(callback);
|
|
366
|
+
});
|
|
344
367
|
Cypress.Commands.add("openInSameTabOnClick", function (_ref) {
|
|
345
368
|
var url = _ref.url,
|
|
346
369
|
alias = _ref.alias,
|
|
@@ -462,7 +485,7 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
462
485
|
cy.get(commonSelectors.saveChangesButton).click();
|
|
463
486
|
cy.wait("@".concat(aliasName));
|
|
464
487
|
cy.verifyToastIcon();
|
|
465
|
-
requestCount > 1 && cy.waitForMultipleRequest("@".concat(aliasName), requestCount);
|
|
488
|
+
requestCount > 1 && cy.waitForMultipleRequest("@".concat(aliasName), requestCount - 1);
|
|
466
489
|
});
|
|
467
490
|
Cypress.Commands.add("verifyAttribute", function (_ref5) {
|
|
468
491
|
var selector = _ref5.selector,
|
|
@@ -477,9 +500,11 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
477
500
|
});
|
|
478
501
|
Cypress.Commands.add("verifyTooltip", function (selector, text) {
|
|
479
502
|
cy.get(selector).realHover();
|
|
480
|
-
cy.
|
|
481
|
-
cy.
|
|
482
|
-
|
|
503
|
+
cy.document().its("body").find(commonSelectors.tooltip).should("have.text", text);
|
|
504
|
+
cy.document().find("body").click("topRight", {
|
|
505
|
+
force: true
|
|
506
|
+
});
|
|
507
|
+
cy.document().its("body").find(commonSelectors.tooltip).should("not.exist");
|
|
483
508
|
});
|
|
484
509
|
};
|
|
485
510
|
|
|
@@ -514,7 +539,20 @@ var memberSelectors = {
|
|
|
514
539
|
dropDownIcon: dataCy("ntm-members-table-row-dropdown-button"),
|
|
515
540
|
editButton: dataCy("ntm-edit-member-button"),
|
|
516
541
|
menuBarHeading: dataCy("ntm-members-menubar-heading"),
|
|
517
|
-
activateOrDeactivateMember: dataCy("ntm-deactivate-member-button")
|
|
542
|
+
activateOrDeactivateMember: dataCy("ntm-deactivate-member-button"),
|
|
543
|
+
subHeader: "[data-testid='subheader']",
|
|
544
|
+
columnsButton: dataCy("columns-dropdown-button"),
|
|
545
|
+
columnsDropdownContainer: dataCy("columns-dropdown-container"),
|
|
546
|
+
emailDropdownItemLabel: dataCy("email-checkbox-label"),
|
|
547
|
+
roleDropdownItemLabel: dataCy("role-checkbox-label"),
|
|
548
|
+
inviteStatusDropdownItemLabel: dataCy("invite-status-checkbox-label"),
|
|
549
|
+
heading: dataCy("ntm-manage-members-pane-header"),
|
|
550
|
+
activateButton: dataCy("ntm-activate-members-button"),
|
|
551
|
+
deactivateButton: dataCy("ntm-deactivate-members-button"),
|
|
552
|
+
rolesButton: function rolesButton(index) {
|
|
553
|
+
return dataCy("ntm-manage-member-roles-button", ":eq(".concat(index, ")"));
|
|
554
|
+
},
|
|
555
|
+
statusTag: dataCy("ntm-member-status-tag")
|
|
518
556
|
};
|
|
519
557
|
var memberFormSelectors = {
|
|
520
558
|
emailTextField: "input.neeto-ui-react-select__input:eq(0)",
|
|
@@ -540,6 +578,25 @@ var signUpSelectors = {
|
|
|
540
578
|
tryFreeButton: dataCy("neeto-auth-signup-link")
|
|
541
579
|
};
|
|
542
580
|
|
|
581
|
+
var helpIconSelectors = {
|
|
582
|
+
helpButton: dataCy("help-button"),
|
|
583
|
+
documentationButton: dataCy("help-link-help-center-button"),
|
|
584
|
+
keyboardShortcutButton: dataCy("help-link-keyboard-shortcut-button"),
|
|
585
|
+
chatButton: dataCy("help-link-live-chat-button"),
|
|
586
|
+
whatsNewButton: dataCy("help-link-changelog-button"),
|
|
587
|
+
whatsNewWidgetInfo: "h1",
|
|
588
|
+
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
589
|
+
keyboardShortcutPaneHeading: ".h-full > .neeto-ui-border-gray-300",
|
|
590
|
+
keyboardShortcutPaneCrossIcon: ".neeto-ui-border-gray-300 > .neeto-ui-btn"
|
|
591
|
+
};
|
|
592
|
+
var chatWidgetSelectors = {
|
|
593
|
+
chatWidgetHomeCard: ".neeto-chat-widget-home__card-content",
|
|
594
|
+
widgetSubmitButton: ".neeto-chat-widget-button",
|
|
595
|
+
chatBubbleMessage: ".neeto-chat-widget-chat-bubble__message",
|
|
596
|
+
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
597
|
+
widgetIframe: "#neetochat-iframe"
|
|
598
|
+
};
|
|
599
|
+
|
|
543
600
|
var memberTexts = {
|
|
544
601
|
addMember: "Add new member",
|
|
545
602
|
admin: "Admin",
|
|
@@ -575,14 +632,23 @@ var memberTexts = {
|
|
|
575
632
|
newHeading: "Add new member",
|
|
576
633
|
updatedMemberRole: function updatedMemberRole(email, role) {
|
|
577
634
|
return "Updated ".concat(email, "'s role to ").concat(role, ".");
|
|
578
|
-
}
|
|
635
|
+
},
|
|
636
|
+
searchMembers: "Search members",
|
|
637
|
+
noDataTitle: "There are no members to show",
|
|
638
|
+
editor: "Editor",
|
|
639
|
+
changeRole: "Change role",
|
|
640
|
+
changeRoleAlertMsg: function changeRoleAlertMsg(member, role) {
|
|
641
|
+
return "You are changing role of ".concat(member, " to ").concat(role, ". Are you sure you want to proceed?");
|
|
642
|
+
},
|
|
643
|
+
collaborator: "Collaborator"
|
|
579
644
|
};
|
|
580
645
|
var memberTableTexts = {
|
|
581
646
|
created: "Created",
|
|
582
647
|
email: "Email",
|
|
583
648
|
name: "Name",
|
|
584
649
|
role: "Role",
|
|
585
|
-
teams: "Teams"
|
|
650
|
+
teams: "Teams",
|
|
651
|
+
inviteStatus: "Invite status"
|
|
586
652
|
};
|
|
587
653
|
var memberFormErrorTexts = {
|
|
588
654
|
emailRequired: "Please enter at least one email address.",
|
|
@@ -593,7 +659,26 @@ var memberFormErrorTexts = {
|
|
|
593
659
|
var signUpTexts = {
|
|
594
660
|
email: "Email",
|
|
595
661
|
profile: "profile",
|
|
596
|
-
tryItFree: "Try it FREE"
|
|
662
|
+
tryItFree: "Try it FREE",
|
|
663
|
+
loginCode: "login code"
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
var helpIconTexts = {
|
|
667
|
+
documentation: "Documentation",
|
|
668
|
+
welcome: "Welcome",
|
|
669
|
+
keyboardShortcuts: "Keyboard shortcuts",
|
|
670
|
+
chatWithUs: "Chat with us",
|
|
671
|
+
newConversation: "New Conversation",
|
|
672
|
+
chatMessage: "Hello. Go ahead and ask us anything.",
|
|
673
|
+
whatsNew: "What's new"
|
|
674
|
+
};
|
|
675
|
+
var profileTexts = {
|
|
676
|
+
logout: "Log out",
|
|
677
|
+
productSwitcher: "Product switcher",
|
|
678
|
+
chooseYourNeetoProduct: "Choose your neeto product",
|
|
679
|
+
myProfile: "My profile",
|
|
680
|
+
profileSettings: "Profile settings",
|
|
681
|
+
myOrganization: "My organization"
|
|
597
682
|
};
|
|
598
683
|
|
|
599
684
|
var verifySSOLoginPage = function verifySSOLoginPage() {
|
|
@@ -751,6 +836,7 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
|
|
|
751
836
|
var email = _ref3.email,
|
|
752
837
|
role = _ref3.role,
|
|
753
838
|
name = _ref3.name,
|
|
839
|
+
statusTag = _ref3.statusTag,
|
|
754
840
|
_ref3$skipSearchReque = _ref3.skipSearchRequest,
|
|
755
841
|
skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
|
|
756
842
|
!skipSearchRequest && interceptMemberApi("searchMember");
|
|
@@ -761,8 +847,11 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
|
|
|
761
847
|
!skipSearchRequest && cy.wait("@searchMember");
|
|
762
848
|
return cy.contains(tableSelectors.tableRow, email).within(function () {
|
|
763
849
|
cy.get(memberSelectors.email).should("have.text", email);
|
|
764
|
-
|
|
850
|
+
cy.get(memberSelectors.name).within(function () {
|
|
851
|
+
name && cy.get("p").should("have.text", name);
|
|
852
|
+
});
|
|
765
853
|
role && cy.get(memberSelectors.role).should("have.text", role);
|
|
854
|
+
statusTag && cy.get(memberSelectors.statusTag).should("have.text", statusTag);
|
|
766
855
|
});
|
|
767
856
|
};
|
|
768
857
|
var updateMemberRole = function updateMemberRole(_ref4) {
|
|
@@ -867,15 +956,23 @@ var deactivateMember = function deactivateMember(_ref8) {
|
|
|
867
956
|
email: email
|
|
868
957
|
});
|
|
869
958
|
};
|
|
870
|
-
var
|
|
871
|
-
|
|
959
|
+
var unCheckColumnAndVerifyTableHeader = function unCheckColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
960
|
+
clickOnColumnIcon();
|
|
961
|
+
cy.get(fieldSelector).parent().within(function () {
|
|
872
962
|
cy.get(memberSelectors.columnCheckBox).should("be.checked").uncheck().should("not.be.checked");
|
|
873
963
|
});
|
|
964
|
+
memberUtils.clickOnColumnIcon();
|
|
965
|
+
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
966
|
+
cy.contains(tableSelectors.tableHeader, columnText).should("not.exist");
|
|
874
967
|
};
|
|
875
|
-
var
|
|
876
|
-
|
|
968
|
+
var checkColumnAndVerifyTableHeader = function checkColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
969
|
+
clickOnColumnIcon();
|
|
970
|
+
cy.get(fieldSelector).parent().within(function () {
|
|
877
971
|
cy.get(memberSelectors.columnCheckBox).should("not.be.checked").check().should("be.checked");
|
|
878
972
|
});
|
|
973
|
+
memberUtils.clickOnColumnIcon();
|
|
974
|
+
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
975
|
+
cy.contains(tableSelectors.tableHeader, columnText).should("be.visible");
|
|
879
976
|
};
|
|
880
977
|
var addMemberViaRequest = function addMemberViaRequest(_ref9) {
|
|
881
978
|
var email = _ref9.email,
|
|
@@ -947,11 +1044,16 @@ var deactivateMemberViaRequest = function deactivateMemberViaRequest(email) {
|
|
|
947
1044
|
});
|
|
948
1045
|
cy.reloadAndWait(requestCount);
|
|
949
1046
|
};
|
|
1047
|
+
var clickOnColumnIcon = function clickOnColumnIcon() {
|
|
1048
|
+
cy.get(memberSelectors.subHeader).should("exist").within(function () {
|
|
1049
|
+
cy.get(memberSelectors.columnsButton).click();
|
|
1050
|
+
});
|
|
1051
|
+
};
|
|
950
1052
|
var memberUtils = {
|
|
951
1053
|
addMemberViaRequest: addMemberViaRequest,
|
|
952
1054
|
addMemberViaUI: addMemberViaUI,
|
|
953
1055
|
activateMember: activateMember,
|
|
954
|
-
|
|
1056
|
+
checkColumnAndVerifyTableHeader: checkColumnAndVerifyTableHeader,
|
|
955
1057
|
deactivateMember: deactivateMember,
|
|
956
1058
|
deactivateMemberViaRequest: deactivateMemberViaRequest,
|
|
957
1059
|
editMemberViaUI: editMemberViaUI,
|
|
@@ -959,8 +1061,9 @@ var memberUtils = {
|
|
|
959
1061
|
updateMemberRole: updateMemberRole,
|
|
960
1062
|
interceptMemberApi: interceptMemberApi,
|
|
961
1063
|
navigateToMembersPage: navigateToMembersPage,
|
|
962
|
-
|
|
963
|
-
verifyMemberDetails: verifyMemberDetails
|
|
1064
|
+
unCheckColumnAndVerifyTableHeader: unCheckColumnAndVerifyTableHeader,
|
|
1065
|
+
verifyMemberDetails: verifyMemberDetails,
|
|
1066
|
+
clickOnColumnIcon: clickOnColumnIcon
|
|
964
1067
|
};
|
|
965
1068
|
|
|
966
1069
|
var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName) {
|
|
@@ -968,7 +1071,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
|
|
|
968
1071
|
var lastDigit = Number(subdomainName.charAt(subdomainName.length - 1));
|
|
969
1072
|
var newOrganizationName = subdomainName.slice(0, -1) + (lastDigit + 1);
|
|
970
1073
|
cy.intercept({
|
|
971
|
-
url: requestApis.
|
|
1074
|
+
url: requestApis.subdomainAvailability,
|
|
972
1075
|
times: 1
|
|
973
1076
|
}).as("subdomainRequest");
|
|
974
1077
|
cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
|
|
@@ -987,7 +1090,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
|
|
|
987
1090
|
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
988
1091
|
});
|
|
989
1092
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
990
|
-
return updateSubdmainIfExit(newOrganizationName);
|
|
1093
|
+
return updateSubdmainIfExit(appName, newOrganizationName);
|
|
991
1094
|
});
|
|
992
1095
|
});
|
|
993
1096
|
};
|
|
@@ -998,7 +1101,8 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
998
1101
|
firstName = _ref.firstName,
|
|
999
1102
|
lastName = _ref.lastName,
|
|
1000
1103
|
appName = _ref.appName;
|
|
1001
|
-
var
|
|
1104
|
+
var isMailosaurEmail = email.includes("mailosaur");
|
|
1105
|
+
var defaultOtp = "123456";
|
|
1002
1106
|
var appNameInLowerCase = appName.toLowerCase();
|
|
1003
1107
|
var isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
1004
1108
|
if (isNeetoAuth) cy.visit("https://app.neetoauth.net/signups/new");else {
|
|
@@ -1014,10 +1118,18 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1014
1118
|
}).as("signupRequest");
|
|
1015
1119
|
cy.get(signUpSelectors.submitButton).click();
|
|
1016
1120
|
cy.wait("@signupRequest");
|
|
1017
|
-
|
|
1121
|
+
if (isMailosaurEmail) {
|
|
1122
|
+
cy.mailosaurGetMessage(Cypress.env("serverId"), {
|
|
1123
|
+
sentTo: email,
|
|
1124
|
+
subject: signUpTexts.loginCode
|
|
1125
|
+
}).then(function (emailBody) {
|
|
1126
|
+
var otp = emailBody.html.codes[0].value;
|
|
1127
|
+
cy.get(signUpSelectors.otpTextBox).type(otp);
|
|
1128
|
+
});
|
|
1129
|
+
} else cy.get(signUpSelectors.otpTextBox).type(defaultOtp);
|
|
1018
1130
|
cy.wait("@signupRequest");
|
|
1019
1131
|
cy.intercept({
|
|
1020
|
-
url: requestApis.
|
|
1132
|
+
url: requestApis.subdomainAvailability,
|
|
1021
1133
|
times: 1
|
|
1022
1134
|
}).as("subdomainRequest");
|
|
1023
1135
|
cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
|
|
@@ -1056,5 +1168,129 @@ var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submit
|
|
|
1056
1168
|
cy.get(commonSelectors.windowAlert).should("not.exist");
|
|
1057
1169
|
};
|
|
1058
1170
|
|
|
1059
|
-
|
|
1171
|
+
var verifyTabMenu = function verifyTabMenu(_ref) {
|
|
1172
|
+
var tabSelector = _ref.tabSelector,
|
|
1173
|
+
toolTiptext = _ref.toolTiptext,
|
|
1174
|
+
_ref$alias = _ref.alias,
|
|
1175
|
+
alias = _ref$alias === void 0 ? "fetchData" : _ref$alias,
|
|
1176
|
+
_ref$requestCount = _ref.requestCount,
|
|
1177
|
+
requestCount = _ref$requestCount === void 0 ? 1 : _ref$requestCount;
|
|
1178
|
+
cy.verifyTooltip(tabSelector, toolTiptext);
|
|
1179
|
+
requestCount && cy.interceptApi(alias, requestCount);
|
|
1180
|
+
cy.get(tabSelector).click();
|
|
1181
|
+
requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1182
|
+
cy.verifyAttribute({
|
|
1183
|
+
selector: tabSelector,
|
|
1184
|
+
attr: "class",
|
|
1185
|
+
value: "active"
|
|
1186
|
+
});
|
|
1187
|
+
};
|
|
1188
|
+
var clickOnHelpSubTab = function clickOnHelpSubTab(tabSelector, tabText) {
|
|
1189
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1190
|
+
cy.get(tabSelector).should("have.text", tabText).click();
|
|
1191
|
+
};
|
|
1192
|
+
var verifyHelpDocumentationLink = function verifyHelpDocumentationLink(_ref2) {
|
|
1193
|
+
var url = _ref2.url,
|
|
1194
|
+
articleTitle = _ref2.articleTitle,
|
|
1195
|
+
alias = _ref2.alias,
|
|
1196
|
+
_ref2$requestCount = _ref2.requestCount,
|
|
1197
|
+
requestCount = _ref2$requestCount === void 0 ? 3 : _ref2$requestCount;
|
|
1198
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1199
|
+
cy.openInSameTabOnClick({
|
|
1200
|
+
selector: helpIconSelectors.documentationButton,
|
|
1201
|
+
url: url,
|
|
1202
|
+
alias: "navigateToHelpDocumentation"
|
|
1203
|
+
});
|
|
1204
|
+
cy.get(commonSelectors.articlePageTitle).should("have.text", articleTitle);
|
|
1205
|
+
cy.interceptApi(alias, requestCount);
|
|
1206
|
+
cy.go("back");
|
|
1207
|
+
cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1208
|
+
};
|
|
1209
|
+
var verifyKeyboardShortcutsPane = function verifyKeyboardShortcutsPane() {
|
|
1210
|
+
clickOnHelpSubTab(helpIconSelectors.keyboardShortcutButton, helpIconTexts.keyboardShortcuts);
|
|
1211
|
+
cy.get(helpIconSelectors.keyboardShortcutPaneHeading).should("have.text", helpIconTexts.keyboardShortcuts);
|
|
1212
|
+
cy.get(helpIconSelectors.keyboardShortcutPaneCrossIcon).click();
|
|
1213
|
+
};
|
|
1214
|
+
var verifyWhatsNewTab = function verifyWhatsNewTab(whatsNewHeading) {
|
|
1215
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1216
|
+
cy.get(helpIconSelectors.whatsNewButton).should("contain.text", helpIconTexts.whatsNew).click();
|
|
1217
|
+
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("have.text", whatsNewHeading);
|
|
1218
|
+
cy.get(helpIconSelectors.whatsNewWidgetCloseButton).last().click();
|
|
1219
|
+
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("not.exist");
|
|
1220
|
+
};
|
|
1221
|
+
var verifyChatWithUsTab = function verifyChatWithUsTab() {
|
|
1222
|
+
cy.interceptNonVersionedApi({
|
|
1223
|
+
url: requestApis.allChatPath,
|
|
1224
|
+
alias: "fetchChatWidget",
|
|
1225
|
+
times: 4
|
|
1226
|
+
});
|
|
1227
|
+
clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.chatWithUs);
|
|
1228
|
+
cy.waitForMultipleRequest("@fetchChatWidget", 4);
|
|
1229
|
+
cy.get(helpIconSelectors.chatButton).click();
|
|
1230
|
+
cy.withinIframe(chatWidgetSelectors.widgetIframe, function () {
|
|
1231
|
+
cy.interceptNonVersionedApi({
|
|
1232
|
+
url: requestApis.allChatPath,
|
|
1233
|
+
alias: "fetchPreChatQuestions"
|
|
1234
|
+
});
|
|
1235
|
+
cy.get(chatWidgetSelectors.chatWidgetHomeCard, {
|
|
1236
|
+
timeout: 10000
|
|
1237
|
+
}).should("have.text", helpIconTexts.newConversation).click();
|
|
1238
|
+
cy.wait("@fetchPreChatQuestions");
|
|
1239
|
+
cy.interceptNonVersionedApi({
|
|
1240
|
+
url: requestApis.allChatPath,
|
|
1241
|
+
alias: "fetchConversationsRequest",
|
|
1242
|
+
times: 2
|
|
1243
|
+
});
|
|
1244
|
+
cy.get(chatWidgetSelectors.widgetSubmitButton).click();
|
|
1245
|
+
cy.waitForMultipleRequest("@fetchConversationsRequest", 2);
|
|
1246
|
+
cy.get(chatWidgetSelectors.chatBubbleMessage).should("have.text", helpIconTexts.chatMessage);
|
|
1247
|
+
});
|
|
1248
|
+
cy.get(chatWidgetSelectors.chatCloseButton).click();
|
|
1249
|
+
cy.get(chatWidgetSelectors.widgetIframe).should("not.exist");
|
|
1250
|
+
};
|
|
1251
|
+
var verifyMyProfileTab = function verifyMyProfileTab() {
|
|
1252
|
+
cy.get(profileSelectors.tab).click();
|
|
1253
|
+
cy.get(profileSelectors.myProfileButton).should("have.text", profileTexts.myProfile);
|
|
1254
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1255
|
+
return cy.openInSameTabOnClick({
|
|
1256
|
+
url: requestApis.myProfilePath(subdomainName),
|
|
1257
|
+
selector: profileSelectors.myProfileButton,
|
|
1258
|
+
alias: "navigateToMyProfile"
|
|
1259
|
+
});
|
|
1260
|
+
});
|
|
1261
|
+
cy.get(commonSelectors.menuBarHeading).should("have.text", profileTexts.profileSettings);
|
|
1262
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1263
|
+
return cy.url().should("include", requestApis.myProfilePath(subdomainName));
|
|
1264
|
+
});
|
|
1265
|
+
cy.interceptApi("fetchProfileRequests", 2);
|
|
1266
|
+
cy.go("back");
|
|
1267
|
+
cy.waitForMultipleRequest("@fetchProfileRequests", 2);
|
|
1268
|
+
};
|
|
1269
|
+
var verifyOrganizationTab = function verifyOrganizationTab() {
|
|
1270
|
+
cy.get(profileSelectors.tab).click();
|
|
1271
|
+
cy.get(profileSelectors.organizationSettingsButton).should("have.text", profileTexts.myOrganization);
|
|
1272
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1273
|
+
return cy.openInSameTabOnClick({
|
|
1274
|
+
url: requestApis.settingsPath(subdomainName),
|
|
1275
|
+
selector: profileSelectors.organizationSettingsButton,
|
|
1276
|
+
alias: "navigateToSettings"
|
|
1277
|
+
});
|
|
1278
|
+
});
|
|
1279
|
+
cy.get(commonSelectors.heading).should("have.text", commonTexts.settings);
|
|
1280
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1281
|
+
return cy.url().should("include", requestApis.settingsPath(subdomainName));
|
|
1282
|
+
});
|
|
1283
|
+
};
|
|
1284
|
+
var navigationUtils = {
|
|
1285
|
+
verifyTabMenu: verifyTabMenu,
|
|
1286
|
+
clickOnHelpSubTab: clickOnHelpSubTab,
|
|
1287
|
+
verifyHelpDocumentationLink: verifyHelpDocumentationLink,
|
|
1288
|
+
verifyKeyboardShortcutsPane: verifyKeyboardShortcutsPane,
|
|
1289
|
+
verifyWhatsNewTab: verifyWhatsNewTab,
|
|
1290
|
+
verifyChatWithUsTab: verifyChatWithUsTab,
|
|
1291
|
+
verifyMyProfileTab: verifyMyProfileTab,
|
|
1292
|
+
verifyOrganizationTab: verifyOrganizationTab
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
export { authUtils, chatWidgetSelectors, commonSelectors, commonTexts, createOrganization, dataCy, dateUtils, environment, getTestTitle, getUrl, helpIconSelectors, helpIconTexts, initCustomCommands, initializeCredentials, isStagingEnv, joinHyphenCase, loginSelectors, memberFormErrorTexts, memberFormSelectors, memberSelectors, memberTableTexts, memberTexts, memberUtils, navigationUtils, profileSelectors, profileTexts, setListCount, signUpSelectors, signUpTexts, tableSelectors, verifyCrossSiteScript, verifyListCount };
|
|
1060
1296
|
//# sourceMappingURL=cypress-utils.js.map
|