@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
|
@@ -3,7 +3,7 @@ const path = require("path");
|
|
|
3
3
|
const { mergeDeepLeft } = require("ramda");
|
|
4
4
|
|
|
5
5
|
const rootOfTheProject = path.join(__dirname, "../../../../../../");
|
|
6
|
-
const
|
|
6
|
+
const pathToTranslationsDir = "src/translations";
|
|
7
7
|
const pathToResolveFile = "resolve.js";
|
|
8
8
|
const pathToJsConfigFile = "jsconfig.json";
|
|
9
9
|
|
|
@@ -19,7 +19,6 @@ const commonResolve = loadJS(
|
|
|
19
19
|
"node_modules/@bigbinary/neeto-commons-frontend/configs/nanos/webpack/resolve.js"
|
|
20
20
|
);
|
|
21
21
|
const projectResolve = loadJS(pathToResolveFile);
|
|
22
|
-
const en = loadJS(pathToTranslationFile);
|
|
23
22
|
const resolve = mergeDeepLeft(projectResolve, commonResolve);
|
|
24
23
|
|
|
25
24
|
module.exports = {
|
|
@@ -77,7 +76,10 @@ module.exports = {
|
|
|
77
76
|
"@bigbinary/neeto/no-axios-import-outside-apis": ["error", resolve.alias],
|
|
78
77
|
"@bigbinary/neeto/no-missing-localization": [
|
|
79
78
|
"error",
|
|
80
|
-
{
|
|
79
|
+
{
|
|
80
|
+
translationsDir: path.join(rootOfTheProject, pathToTranslationsDir),
|
|
81
|
+
languages: ["en"],
|
|
82
|
+
},
|
|
81
83
|
],
|
|
82
84
|
"@bigbinary/neeto/prefix-neeto-ui-import-alias": ["error", resolve.alias],
|
|
83
85
|
"@bigbinary/neeto/use-webpack-alias": ["error", resolve.alias],
|
package/cypress-commands.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ declare namespace Cypress {
|
|
|
6
6
|
typeFast(selector: string, text: string): Void;
|
|
7
7
|
typeAndEnter(selector: string, text: string): Void;
|
|
8
8
|
verifyToastMessage(message: string): Void;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param closeToastr Default value is true
|
|
12
|
+
*/
|
|
13
|
+
verifyToastIcon(closeToastr: boolean): Void;
|
|
9
14
|
continueOnAlert(
|
|
10
15
|
alias:
|
|
11
16
|
| string
|
|
@@ -40,8 +45,19 @@ declare namespace Cypress {
|
|
|
40
45
|
clickDropdownOption(optionText: string, dropdownSelector: string): Void;
|
|
41
46
|
getText(selector: string): Chainable<JQuery<HTMLElement>>;
|
|
42
47
|
getValue(selector: string): Chainable<JQuery<HTMLElement>>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use `withinIframe` instead.
|
|
51
|
+
*/
|
|
43
52
|
getIframe(iframeSelector: string): Chainable<JQuery<HTMLElement>>;
|
|
44
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Selects and performs commands within an iframe element based on the given selector.
|
|
56
|
+
* @param iframeSelector The selector to locate the iframe element.
|
|
57
|
+
* @param callbackFn The callback function containing the commands to execute within the iframe.
|
|
58
|
+
*/
|
|
59
|
+
withinIframe(iframeSelector: string, callbackFn: void): Void;
|
|
60
|
+
|
|
45
61
|
/**
|
|
46
62
|
* Command to open the url in the same window after clicking on a button that opens the url in a new tab
|
|
47
63
|
*/
|
|
@@ -76,9 +92,9 @@ declare namespace Cypress {
|
|
|
76
92
|
navigateToPreviewPage(selector: string, requestCount: number): Void;
|
|
77
93
|
saveChanges(aliasName: string, requestCount: number): Void;
|
|
78
94
|
verifyAttribute(props: {
|
|
79
|
-
selector: string
|
|
80
|
-
attr: string
|
|
81
|
-
value: string
|
|
95
|
+
selector: string;
|
|
96
|
+
attr: string;
|
|
97
|
+
value: string;
|
|
82
98
|
}): Void;
|
|
83
99
|
verifyUnsavedAlertModal(cancelButton: string): Void;
|
|
84
100
|
verifyTooltip(selector: string, text: string): Void;
|
package/cypress-utils.cjs.js
CHANGED
|
@@ -143,7 +143,7 @@ var allPath = function allPath() {
|
|
|
143
143
|
var requestApis = {
|
|
144
144
|
countries: getUrl("countries"),
|
|
145
145
|
signUp: getUrl("signups/**"),
|
|
146
|
-
|
|
146
|
+
subdomainAvailability: getUrl("subdomain_availability/**"),
|
|
147
147
|
teamMembers: {
|
|
148
148
|
all: "/team_members*/**",
|
|
149
149
|
bulkUpdate: "/team_members/teams/bulk_update",
|
|
@@ -151,6 +151,13 @@ var requestApis = {
|
|
|
151
151
|
show: function show(id) {
|
|
152
152
|
return "/team_members/teams/".concat(id);
|
|
153
153
|
}
|
|
154
|
+
},
|
|
155
|
+
allChatPath: "https://neetokbhelp.neetochat.net".concat(getUrl("**")),
|
|
156
|
+
myProfilePath: function myProfilePath(subdomain) {
|
|
157
|
+
return "https://".concat(subdomain, ".neetoauth.net/my/profile");
|
|
158
|
+
},
|
|
159
|
+
settingsPath: function settingsPath(subdomain) {
|
|
160
|
+
return "https://".concat(subdomain, ".neetoauth.net/settings");
|
|
154
161
|
}
|
|
155
162
|
};
|
|
156
163
|
var urlPaths = {
|
|
@@ -201,7 +208,8 @@ var commonSelectors = {
|
|
|
201
208
|
return dataCy("nui-select-container-wrapper", ":eq(".concat(index, ")"));
|
|
202
209
|
},
|
|
203
210
|
toggleButton: dataCy("menubar-toggle-button"),
|
|
204
|
-
tooltip: ".tippy-box"
|
|
211
|
+
tooltip: ".tippy-box",
|
|
212
|
+
articlePageTitle: ".serene-article__title"
|
|
205
213
|
};
|
|
206
214
|
var tableSelectors = {
|
|
207
215
|
nthColumn: function nthColumn(n) {
|
|
@@ -218,7 +226,9 @@ var tableSelectors = {
|
|
|
218
226
|
var profileSelectors = {
|
|
219
227
|
tab: dataCy("profile-section"),
|
|
220
228
|
logoutLink: dataCy("profile-logout-button"),
|
|
221
|
-
profileOptionsContainer: '[class="tippy-box sidebar-featured-tooltip__content"]'
|
|
229
|
+
profileOptionsContainer: '[class="tippy-box sidebar-featured-tooltip__content"]',
|
|
230
|
+
myProfileButton: dataCy("my-profile-button"),
|
|
231
|
+
organizationSettingsButton: dataCy("profile-organization-settings-button")
|
|
222
232
|
};
|
|
223
233
|
|
|
224
234
|
var commonTexts = {
|
|
@@ -243,7 +253,9 @@ var commonTexts = {
|
|
|
243
253
|
proceed: "Proceed",
|
|
244
254
|
settings: "Settings",
|
|
245
255
|
unsavedChangesAlertTitle: "You have unsaved changes!",
|
|
246
|
-
unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost."
|
|
256
|
+
unsavedChangesAlertMessage: "Are you sure you want to continue? All of your unsaved changes will be lost.",
|
|
257
|
+
clearFilters: "Clear filters",
|
|
258
|
+
filters: "Filters"
|
|
247
259
|
};
|
|
248
260
|
|
|
249
261
|
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; }
|
|
@@ -278,9 +290,10 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
278
290
|
cy.get(commonSelectors.toastMessage).should("not.exist");
|
|
279
291
|
});
|
|
280
292
|
Cypress.Commands.add("verifyToastIcon", function () {
|
|
281
|
-
|
|
282
|
-
cy.
|
|
283
|
-
cy.
|
|
293
|
+
var closeToastr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
294
|
+
cy.document().its("body").find(commonSelectors.toastIcon).should("have.text", "👍");
|
|
295
|
+
closeToastr && cy.document().its("body").find(commonSelectors.toastCloseButton).click();
|
|
296
|
+
cy.document().its("body").find(commonSelectors.toastIcon).should("not.exist");
|
|
284
297
|
});
|
|
285
298
|
Cypress.Commands.add("continueOnAlert", function (args) {
|
|
286
299
|
var props = _typeof(args) === "object" ? args : {
|
|
@@ -346,9 +359,19 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
346
359
|
Cypress.Commands.add("getValue", function (selector) {
|
|
347
360
|
return cy.get(selector).invoke("val");
|
|
348
361
|
});
|
|
362
|
+
|
|
363
|
+
// Deprecated. Use withinIframe.
|
|
349
364
|
Cypress.Commands.add("getIframe", function (iframeSelector) {
|
|
350
365
|
return cy.get(iframeSelector).its("0.contentDocument.body").should("not.be.empty");
|
|
351
366
|
});
|
|
367
|
+
Cypress.Commands.add("withinIframe", function (selector, callback) {
|
|
368
|
+
cy.get(selector, {
|
|
369
|
+
timeout: 10000
|
|
370
|
+
}).its("0.contentDocument.body").should("be.visible").and("not.be.empty");
|
|
371
|
+
cy.get(selector, {
|
|
372
|
+
timeout: 10000
|
|
373
|
+
}).its("0.contentDocument.body").eq(0).within(callback);
|
|
374
|
+
});
|
|
352
375
|
Cypress.Commands.add("openInSameTabOnClick", function (_ref) {
|
|
353
376
|
var url = _ref.url,
|
|
354
377
|
alias = _ref.alias,
|
|
@@ -470,7 +493,7 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
470
493
|
cy.get(commonSelectors.saveChangesButton).click();
|
|
471
494
|
cy.wait("@".concat(aliasName));
|
|
472
495
|
cy.verifyToastIcon();
|
|
473
|
-
requestCount > 1 && cy.waitForMultipleRequest("@".concat(aliasName), requestCount);
|
|
496
|
+
requestCount > 1 && cy.waitForMultipleRequest("@".concat(aliasName), requestCount - 1);
|
|
474
497
|
});
|
|
475
498
|
Cypress.Commands.add("verifyAttribute", function (_ref5) {
|
|
476
499
|
var selector = _ref5.selector,
|
|
@@ -485,9 +508,11 @@ var initCustomCommands = function initCustomCommands() {
|
|
|
485
508
|
});
|
|
486
509
|
Cypress.Commands.add("verifyTooltip", function (selector, text) {
|
|
487
510
|
cy.get(selector).realHover();
|
|
488
|
-
cy.
|
|
489
|
-
cy.
|
|
490
|
-
|
|
511
|
+
cy.document().its("body").find(commonSelectors.tooltip).should("have.text", text);
|
|
512
|
+
cy.document().find("body").click("topRight", {
|
|
513
|
+
force: true
|
|
514
|
+
});
|
|
515
|
+
cy.document().its("body").find(commonSelectors.tooltip).should("not.exist");
|
|
491
516
|
});
|
|
492
517
|
};
|
|
493
518
|
|
|
@@ -522,7 +547,20 @@ var memberSelectors = {
|
|
|
522
547
|
dropDownIcon: dataCy("ntm-members-table-row-dropdown-button"),
|
|
523
548
|
editButton: dataCy("ntm-edit-member-button"),
|
|
524
549
|
menuBarHeading: dataCy("ntm-members-menubar-heading"),
|
|
525
|
-
activateOrDeactivateMember: dataCy("ntm-deactivate-member-button")
|
|
550
|
+
activateOrDeactivateMember: dataCy("ntm-deactivate-member-button"),
|
|
551
|
+
subHeader: "[data-testid='subheader']",
|
|
552
|
+
columnsButton: dataCy("columns-dropdown-button"),
|
|
553
|
+
columnsDropdownContainer: dataCy("columns-dropdown-container"),
|
|
554
|
+
emailDropdownItemLabel: dataCy("email-checkbox-label"),
|
|
555
|
+
roleDropdownItemLabel: dataCy("role-checkbox-label"),
|
|
556
|
+
inviteStatusDropdownItemLabel: dataCy("invite-status-checkbox-label"),
|
|
557
|
+
heading: dataCy("ntm-manage-members-pane-header"),
|
|
558
|
+
activateButton: dataCy("ntm-activate-members-button"),
|
|
559
|
+
deactivateButton: dataCy("ntm-deactivate-members-button"),
|
|
560
|
+
rolesButton: function rolesButton(index) {
|
|
561
|
+
return dataCy("ntm-manage-member-roles-button", ":eq(".concat(index, ")"));
|
|
562
|
+
},
|
|
563
|
+
statusTag: dataCy("ntm-member-status-tag")
|
|
526
564
|
};
|
|
527
565
|
var memberFormSelectors = {
|
|
528
566
|
emailTextField: "input.neeto-ui-react-select__input:eq(0)",
|
|
@@ -548,6 +586,25 @@ var signUpSelectors = {
|
|
|
548
586
|
tryFreeButton: dataCy("neeto-auth-signup-link")
|
|
549
587
|
};
|
|
550
588
|
|
|
589
|
+
var helpIconSelectors = {
|
|
590
|
+
helpButton: dataCy("help-button"),
|
|
591
|
+
documentationButton: dataCy("help-link-help-center-button"),
|
|
592
|
+
keyboardShortcutButton: dataCy("help-link-keyboard-shortcut-button"),
|
|
593
|
+
chatButton: dataCy("help-link-live-chat-button"),
|
|
594
|
+
whatsNewButton: dataCy("help-link-changelog-button"),
|
|
595
|
+
whatsNewWidgetInfo: "h1",
|
|
596
|
+
whatsNewWidgetCloseButton: ".nc-widget-header__btn",
|
|
597
|
+
keyboardShortcutPaneHeading: ".h-full > .neeto-ui-border-gray-300",
|
|
598
|
+
keyboardShortcutPaneCrossIcon: ".neeto-ui-border-gray-300 > .neeto-ui-btn"
|
|
599
|
+
};
|
|
600
|
+
var chatWidgetSelectors = {
|
|
601
|
+
chatWidgetHomeCard: ".neeto-chat-widget-home__card-content",
|
|
602
|
+
widgetSubmitButton: ".neeto-chat-widget-button",
|
|
603
|
+
chatBubbleMessage: ".neeto-chat-widget-chat-bubble__message",
|
|
604
|
+
chatCloseButton: ".neeto-chat-widget-icon--close",
|
|
605
|
+
widgetIframe: "#neetochat-iframe"
|
|
606
|
+
};
|
|
607
|
+
|
|
551
608
|
var memberTexts = {
|
|
552
609
|
addMember: "Add new member",
|
|
553
610
|
admin: "Admin",
|
|
@@ -583,14 +640,23 @@ var memberTexts = {
|
|
|
583
640
|
newHeading: "Add new member",
|
|
584
641
|
updatedMemberRole: function updatedMemberRole(email, role) {
|
|
585
642
|
return "Updated ".concat(email, "'s role to ").concat(role, ".");
|
|
586
|
-
}
|
|
643
|
+
},
|
|
644
|
+
searchMembers: "Search members",
|
|
645
|
+
noDataTitle: "There are no members to show",
|
|
646
|
+
editor: "Editor",
|
|
647
|
+
changeRole: "Change role",
|
|
648
|
+
changeRoleAlertMsg: function changeRoleAlertMsg(member, role) {
|
|
649
|
+
return "You are changing role of ".concat(member, " to ").concat(role, ". Are you sure you want to proceed?");
|
|
650
|
+
},
|
|
651
|
+
collaborator: "Collaborator"
|
|
587
652
|
};
|
|
588
653
|
var memberTableTexts = {
|
|
589
654
|
created: "Created",
|
|
590
655
|
email: "Email",
|
|
591
656
|
name: "Name",
|
|
592
657
|
role: "Role",
|
|
593
|
-
teams: "Teams"
|
|
658
|
+
teams: "Teams",
|
|
659
|
+
inviteStatus: "Invite status"
|
|
594
660
|
};
|
|
595
661
|
var memberFormErrorTexts = {
|
|
596
662
|
emailRequired: "Please enter at least one email address.",
|
|
@@ -601,7 +667,26 @@ var memberFormErrorTexts = {
|
|
|
601
667
|
var signUpTexts = {
|
|
602
668
|
email: "Email",
|
|
603
669
|
profile: "profile",
|
|
604
|
-
tryItFree: "Try it FREE"
|
|
670
|
+
tryItFree: "Try it FREE",
|
|
671
|
+
loginCode: "login code"
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
var helpIconTexts = {
|
|
675
|
+
documentation: "Documentation",
|
|
676
|
+
welcome: "Welcome",
|
|
677
|
+
keyboardShortcuts: "Keyboard shortcuts",
|
|
678
|
+
chatWithUs: "Chat with us",
|
|
679
|
+
newConversation: "New Conversation",
|
|
680
|
+
chatMessage: "Hello. Go ahead and ask us anything.",
|
|
681
|
+
whatsNew: "What's new"
|
|
682
|
+
};
|
|
683
|
+
var profileTexts = {
|
|
684
|
+
logout: "Log out",
|
|
685
|
+
productSwitcher: "Product switcher",
|
|
686
|
+
chooseYourNeetoProduct: "Choose your neeto product",
|
|
687
|
+
myProfile: "My profile",
|
|
688
|
+
profileSettings: "Profile settings",
|
|
689
|
+
myOrganization: "My organization"
|
|
605
690
|
};
|
|
606
691
|
|
|
607
692
|
var verifySSOLoginPage = function verifySSOLoginPage() {
|
|
@@ -759,6 +844,7 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
|
|
|
759
844
|
var email = _ref3.email,
|
|
760
845
|
role = _ref3.role,
|
|
761
846
|
name = _ref3.name,
|
|
847
|
+
statusTag = _ref3.statusTag,
|
|
762
848
|
_ref3$skipSearchReque = _ref3.skipSearchRequest,
|
|
763
849
|
skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
|
|
764
850
|
!skipSearchRequest && interceptMemberApi("searchMember");
|
|
@@ -769,8 +855,11 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
|
|
|
769
855
|
!skipSearchRequest && cy.wait("@searchMember");
|
|
770
856
|
return cy.contains(tableSelectors.tableRow, email).within(function () {
|
|
771
857
|
cy.get(memberSelectors.email).should("have.text", email);
|
|
772
|
-
|
|
858
|
+
cy.get(memberSelectors.name).within(function () {
|
|
859
|
+
name && cy.get("p").should("have.text", name);
|
|
860
|
+
});
|
|
773
861
|
role && cy.get(memberSelectors.role).should("have.text", role);
|
|
862
|
+
statusTag && cy.get(memberSelectors.statusTag).should("have.text", statusTag);
|
|
774
863
|
});
|
|
775
864
|
};
|
|
776
865
|
var updateMemberRole = function updateMemberRole(_ref4) {
|
|
@@ -875,15 +964,23 @@ var deactivateMember = function deactivateMember(_ref8) {
|
|
|
875
964
|
email: email
|
|
876
965
|
});
|
|
877
966
|
};
|
|
878
|
-
var
|
|
879
|
-
|
|
967
|
+
var unCheckColumnAndVerifyTableHeader = function unCheckColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
968
|
+
clickOnColumnIcon();
|
|
969
|
+
cy.get(fieldSelector).parent().within(function () {
|
|
880
970
|
cy.get(memberSelectors.columnCheckBox).should("be.checked").uncheck().should("not.be.checked");
|
|
881
971
|
});
|
|
972
|
+
memberUtils.clickOnColumnIcon();
|
|
973
|
+
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
974
|
+
cy.contains(tableSelectors.tableHeader, columnText).should("not.exist");
|
|
882
975
|
};
|
|
883
|
-
var
|
|
884
|
-
|
|
976
|
+
var checkColumnAndVerifyTableHeader = function checkColumnAndVerifyTableHeader(fieldSelector, columnText) {
|
|
977
|
+
clickOnColumnIcon();
|
|
978
|
+
cy.get(fieldSelector).parent().within(function () {
|
|
885
979
|
cy.get(memberSelectors.columnCheckBox).should("not.be.checked").check().should("be.checked");
|
|
886
980
|
});
|
|
981
|
+
memberUtils.clickOnColumnIcon();
|
|
982
|
+
cy.get(memberSelectors.columnsDropdownContainer).should("not.exist");
|
|
983
|
+
cy.contains(tableSelectors.tableHeader, columnText).should("be.visible");
|
|
887
984
|
};
|
|
888
985
|
var addMemberViaRequest = function addMemberViaRequest(_ref9) {
|
|
889
986
|
var email = _ref9.email,
|
|
@@ -955,11 +1052,16 @@ var deactivateMemberViaRequest = function deactivateMemberViaRequest(email) {
|
|
|
955
1052
|
});
|
|
956
1053
|
cy.reloadAndWait(requestCount);
|
|
957
1054
|
};
|
|
1055
|
+
var clickOnColumnIcon = function clickOnColumnIcon() {
|
|
1056
|
+
cy.get(memberSelectors.subHeader).should("exist").within(function () {
|
|
1057
|
+
cy.get(memberSelectors.columnsButton).click();
|
|
1058
|
+
});
|
|
1059
|
+
};
|
|
958
1060
|
var memberUtils = {
|
|
959
1061
|
addMemberViaRequest: addMemberViaRequest,
|
|
960
1062
|
addMemberViaUI: addMemberViaUI,
|
|
961
1063
|
activateMember: activateMember,
|
|
962
|
-
|
|
1064
|
+
checkColumnAndVerifyTableHeader: checkColumnAndVerifyTableHeader,
|
|
963
1065
|
deactivateMember: deactivateMember,
|
|
964
1066
|
deactivateMemberViaRequest: deactivateMemberViaRequest,
|
|
965
1067
|
editMemberViaUI: editMemberViaUI,
|
|
@@ -967,8 +1069,9 @@ var memberUtils = {
|
|
|
967
1069
|
updateMemberRole: updateMemberRole,
|
|
968
1070
|
interceptMemberApi: interceptMemberApi,
|
|
969
1071
|
navigateToMembersPage: navigateToMembersPage,
|
|
970
|
-
|
|
971
|
-
verifyMemberDetails: verifyMemberDetails
|
|
1072
|
+
unCheckColumnAndVerifyTableHeader: unCheckColumnAndVerifyTableHeader,
|
|
1073
|
+
verifyMemberDetails: verifyMemberDetails,
|
|
1074
|
+
clickOnColumnIcon: clickOnColumnIcon
|
|
972
1075
|
};
|
|
973
1076
|
|
|
974
1077
|
var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName) {
|
|
@@ -976,7 +1079,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
|
|
|
976
1079
|
var lastDigit = Number(subdomainName.charAt(subdomainName.length - 1));
|
|
977
1080
|
var newOrganizationName = subdomainName.slice(0, -1) + (lastDigit + 1);
|
|
978
1081
|
cy.intercept({
|
|
979
|
-
url: requestApis.
|
|
1082
|
+
url: requestApis.subdomainAvailability,
|
|
980
1083
|
times: 1
|
|
981
1084
|
}).as("subdomainRequest");
|
|
982
1085
|
cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
|
|
@@ -995,7 +1098,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
|
|
|
995
1098
|
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
996
1099
|
});
|
|
997
1100
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
998
|
-
return updateSubdmainIfExit(newOrganizationName);
|
|
1101
|
+
return updateSubdmainIfExit(appName, newOrganizationName);
|
|
999
1102
|
});
|
|
1000
1103
|
});
|
|
1001
1104
|
};
|
|
@@ -1006,7 +1109,8 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1006
1109
|
firstName = _ref.firstName,
|
|
1007
1110
|
lastName = _ref.lastName,
|
|
1008
1111
|
appName = _ref.appName;
|
|
1009
|
-
var
|
|
1112
|
+
var isMailosaurEmail = email.includes("mailosaur");
|
|
1113
|
+
var defaultOtp = "123456";
|
|
1010
1114
|
var appNameInLowerCase = appName.toLowerCase();
|
|
1011
1115
|
var isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
1012
1116
|
if (isNeetoAuth) cy.visit("https://app.neetoauth.net/signups/new");else {
|
|
@@ -1022,10 +1126,18 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1022
1126
|
}).as("signupRequest");
|
|
1023
1127
|
cy.get(signUpSelectors.submitButton).click();
|
|
1024
1128
|
cy.wait("@signupRequest");
|
|
1025
|
-
|
|
1129
|
+
if (isMailosaurEmail) {
|
|
1130
|
+
cy.mailosaurGetMessage(Cypress.env("serverId"), {
|
|
1131
|
+
sentTo: email,
|
|
1132
|
+
subject: signUpTexts.loginCode
|
|
1133
|
+
}).then(function (emailBody) {
|
|
1134
|
+
var otp = emailBody.html.codes[0].value;
|
|
1135
|
+
cy.get(signUpSelectors.otpTextBox).type(otp);
|
|
1136
|
+
});
|
|
1137
|
+
} else cy.get(signUpSelectors.otpTextBox).type(defaultOtp);
|
|
1026
1138
|
cy.wait("@signupRequest");
|
|
1027
1139
|
cy.intercept({
|
|
1028
|
-
url: requestApis.
|
|
1140
|
+
url: requestApis.subdomainAvailability,
|
|
1029
1141
|
times: 1
|
|
1030
1142
|
}).as("subdomainRequest");
|
|
1031
1143
|
cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
|
|
@@ -1064,7 +1176,132 @@ var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submit
|
|
|
1064
1176
|
cy.get(commonSelectors.windowAlert).should("not.exist");
|
|
1065
1177
|
};
|
|
1066
1178
|
|
|
1179
|
+
var verifyTabMenu = function verifyTabMenu(_ref) {
|
|
1180
|
+
var tabSelector = _ref.tabSelector,
|
|
1181
|
+
toolTiptext = _ref.toolTiptext,
|
|
1182
|
+
_ref$alias = _ref.alias,
|
|
1183
|
+
alias = _ref$alias === void 0 ? "fetchData" : _ref$alias,
|
|
1184
|
+
_ref$requestCount = _ref.requestCount,
|
|
1185
|
+
requestCount = _ref$requestCount === void 0 ? 1 : _ref$requestCount;
|
|
1186
|
+
cy.verifyTooltip(tabSelector, toolTiptext);
|
|
1187
|
+
requestCount && cy.interceptApi(alias, requestCount);
|
|
1188
|
+
cy.get(tabSelector).click();
|
|
1189
|
+
requestCount && cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1190
|
+
cy.verifyAttribute({
|
|
1191
|
+
selector: tabSelector,
|
|
1192
|
+
attr: "class",
|
|
1193
|
+
value: "active"
|
|
1194
|
+
});
|
|
1195
|
+
};
|
|
1196
|
+
var clickOnHelpSubTab = function clickOnHelpSubTab(tabSelector, tabText) {
|
|
1197
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1198
|
+
cy.get(tabSelector).should("have.text", tabText).click();
|
|
1199
|
+
};
|
|
1200
|
+
var verifyHelpDocumentationLink = function verifyHelpDocumentationLink(_ref2) {
|
|
1201
|
+
var url = _ref2.url,
|
|
1202
|
+
articleTitle = _ref2.articleTitle,
|
|
1203
|
+
alias = _ref2.alias,
|
|
1204
|
+
_ref2$requestCount = _ref2.requestCount,
|
|
1205
|
+
requestCount = _ref2$requestCount === void 0 ? 3 : _ref2$requestCount;
|
|
1206
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1207
|
+
cy.openInSameTabOnClick({
|
|
1208
|
+
selector: helpIconSelectors.documentationButton,
|
|
1209
|
+
url: url,
|
|
1210
|
+
alias: "navigateToHelpDocumentation"
|
|
1211
|
+
});
|
|
1212
|
+
cy.get(commonSelectors.articlePageTitle).should("have.text", articleTitle);
|
|
1213
|
+
cy.interceptApi(alias, requestCount);
|
|
1214
|
+
cy.go("back");
|
|
1215
|
+
cy.waitForMultipleRequest("@".concat(alias), requestCount);
|
|
1216
|
+
};
|
|
1217
|
+
var verifyKeyboardShortcutsPane = function verifyKeyboardShortcutsPane() {
|
|
1218
|
+
clickOnHelpSubTab(helpIconSelectors.keyboardShortcutButton, helpIconTexts.keyboardShortcuts);
|
|
1219
|
+
cy.get(helpIconSelectors.keyboardShortcutPaneHeading).should("have.text", helpIconTexts.keyboardShortcuts);
|
|
1220
|
+
cy.get(helpIconSelectors.keyboardShortcutPaneCrossIcon).click();
|
|
1221
|
+
};
|
|
1222
|
+
var verifyWhatsNewTab = function verifyWhatsNewTab(whatsNewHeading) {
|
|
1223
|
+
cy.get(helpIconSelectors.helpButton).click();
|
|
1224
|
+
cy.get(helpIconSelectors.whatsNewButton).should("contain.text", helpIconTexts.whatsNew).click();
|
|
1225
|
+
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("have.text", whatsNewHeading);
|
|
1226
|
+
cy.get(helpIconSelectors.whatsNewWidgetCloseButton).last().click();
|
|
1227
|
+
cy.get(helpIconSelectors.whatsNewWidgetInfo).should("not.exist");
|
|
1228
|
+
};
|
|
1229
|
+
var verifyChatWithUsTab = function verifyChatWithUsTab() {
|
|
1230
|
+
cy.interceptNonVersionedApi({
|
|
1231
|
+
url: requestApis.allChatPath,
|
|
1232
|
+
alias: "fetchChatWidget",
|
|
1233
|
+
times: 4
|
|
1234
|
+
});
|
|
1235
|
+
clickOnHelpSubTab(helpIconSelectors.chatButton, helpIconTexts.chatWithUs);
|
|
1236
|
+
cy.waitForMultipleRequest("@fetchChatWidget", 4);
|
|
1237
|
+
cy.get(helpIconSelectors.chatButton).click();
|
|
1238
|
+
cy.withinIframe(chatWidgetSelectors.widgetIframe, function () {
|
|
1239
|
+
cy.interceptNonVersionedApi({
|
|
1240
|
+
url: requestApis.allChatPath,
|
|
1241
|
+
alias: "fetchPreChatQuestions"
|
|
1242
|
+
});
|
|
1243
|
+
cy.get(chatWidgetSelectors.chatWidgetHomeCard, {
|
|
1244
|
+
timeout: 10000
|
|
1245
|
+
}).should("have.text", helpIconTexts.newConversation).click();
|
|
1246
|
+
cy.wait("@fetchPreChatQuestions");
|
|
1247
|
+
cy.interceptNonVersionedApi({
|
|
1248
|
+
url: requestApis.allChatPath,
|
|
1249
|
+
alias: "fetchConversationsRequest",
|
|
1250
|
+
times: 2
|
|
1251
|
+
});
|
|
1252
|
+
cy.get(chatWidgetSelectors.widgetSubmitButton).click();
|
|
1253
|
+
cy.waitForMultipleRequest("@fetchConversationsRequest", 2);
|
|
1254
|
+
cy.get(chatWidgetSelectors.chatBubbleMessage).should("have.text", helpIconTexts.chatMessage);
|
|
1255
|
+
});
|
|
1256
|
+
cy.get(chatWidgetSelectors.chatCloseButton).click();
|
|
1257
|
+
cy.get(chatWidgetSelectors.widgetIframe).should("not.exist");
|
|
1258
|
+
};
|
|
1259
|
+
var verifyMyProfileTab = function verifyMyProfileTab() {
|
|
1260
|
+
cy.get(profileSelectors.tab).click();
|
|
1261
|
+
cy.get(profileSelectors.myProfileButton).should("have.text", profileTexts.myProfile);
|
|
1262
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1263
|
+
return cy.openInSameTabOnClick({
|
|
1264
|
+
url: requestApis.myProfilePath(subdomainName),
|
|
1265
|
+
selector: profileSelectors.myProfileButton,
|
|
1266
|
+
alias: "navigateToMyProfile"
|
|
1267
|
+
});
|
|
1268
|
+
});
|
|
1269
|
+
cy.get(commonSelectors.menuBarHeading).should("have.text", profileTexts.profileSettings);
|
|
1270
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1271
|
+
return cy.url().should("include", requestApis.myProfilePath(subdomainName));
|
|
1272
|
+
});
|
|
1273
|
+
cy.interceptApi("fetchProfileRequests", 2);
|
|
1274
|
+
cy.go("back");
|
|
1275
|
+
cy.waitForMultipleRequest("@fetchProfileRequests", 2);
|
|
1276
|
+
};
|
|
1277
|
+
var verifyOrganizationTab = function verifyOrganizationTab() {
|
|
1278
|
+
cy.get(profileSelectors.tab).click();
|
|
1279
|
+
cy.get(profileSelectors.organizationSettingsButton).should("have.text", profileTexts.myOrganization);
|
|
1280
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1281
|
+
return cy.openInSameTabOnClick({
|
|
1282
|
+
url: requestApis.settingsPath(subdomainName),
|
|
1283
|
+
selector: profileSelectors.organizationSettingsButton,
|
|
1284
|
+
alias: "navigateToSettings"
|
|
1285
|
+
});
|
|
1286
|
+
});
|
|
1287
|
+
cy.get(commonSelectors.heading).should("have.text", commonTexts.settings);
|
|
1288
|
+
cy.globalState("subdomainName").then(function (subdomainName) {
|
|
1289
|
+
return cy.url().should("include", requestApis.settingsPath(subdomainName));
|
|
1290
|
+
});
|
|
1291
|
+
};
|
|
1292
|
+
var navigationUtils = {
|
|
1293
|
+
verifyTabMenu: verifyTabMenu,
|
|
1294
|
+
clickOnHelpSubTab: clickOnHelpSubTab,
|
|
1295
|
+
verifyHelpDocumentationLink: verifyHelpDocumentationLink,
|
|
1296
|
+
verifyKeyboardShortcutsPane: verifyKeyboardShortcutsPane,
|
|
1297
|
+
verifyWhatsNewTab: verifyWhatsNewTab,
|
|
1298
|
+
verifyChatWithUsTab: verifyChatWithUsTab,
|
|
1299
|
+
verifyMyProfileTab: verifyMyProfileTab,
|
|
1300
|
+
verifyOrganizationTab: verifyOrganizationTab
|
|
1301
|
+
};
|
|
1302
|
+
|
|
1067
1303
|
exports.authUtils = authUtils;
|
|
1304
|
+
exports.chatWidgetSelectors = chatWidgetSelectors;
|
|
1068
1305
|
exports.commonSelectors = commonSelectors;
|
|
1069
1306
|
exports.commonTexts = commonTexts;
|
|
1070
1307
|
exports.createOrganization = createOrganization;
|
|
@@ -1073,6 +1310,8 @@ exports.dateUtils = dateUtils;
|
|
|
1073
1310
|
exports.environment = environment;
|
|
1074
1311
|
exports.getTestTitle = getTestTitle;
|
|
1075
1312
|
exports.getUrl = getUrl;
|
|
1313
|
+
exports.helpIconSelectors = helpIconSelectors;
|
|
1314
|
+
exports.helpIconTexts = helpIconTexts;
|
|
1076
1315
|
exports.initCustomCommands = initCustomCommands;
|
|
1077
1316
|
exports.initializeCredentials = initializeCredentials;
|
|
1078
1317
|
exports.isStagingEnv = isStagingEnv;
|
|
@@ -1084,7 +1323,9 @@ exports.memberSelectors = memberSelectors;
|
|
|
1084
1323
|
exports.memberTableTexts = memberTableTexts;
|
|
1085
1324
|
exports.memberTexts = memberTexts;
|
|
1086
1325
|
exports.memberUtils = memberUtils;
|
|
1326
|
+
exports.navigationUtils = navigationUtils;
|
|
1087
1327
|
exports.profileSelectors = profileSelectors;
|
|
1328
|
+
exports.profileTexts = profileTexts;
|
|
1088
1329
|
exports.setListCount = setListCount;
|
|
1089
1330
|
exports.signUpSelectors = signUpSelectors;
|
|
1090
1331
|
exports.signUpTexts = signUpTexts;
|