@bigbinary/neeto-commons-frontend 2.0.74 → 2.0.76

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.
@@ -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;
@@ -61,6 +62,7 @@ type MemberSelectors = {
61
62
  activateButton: string;
62
63
  deactivateButton: string;
63
64
  rolesButton: string;
65
+ statusTag: string;
64
66
  };
65
67
  type MemberFormSelectors = {
66
68
  emailTextField: string;
@@ -86,6 +88,8 @@ type ProfileSelectors = {
86
88
  tab: string;
87
89
  logoutLink: string;
88
90
  profileOptionsContainer: string;
91
+ myProfileButton: string;
92
+ organizationSettingsButton: string;
89
93
  };
90
94
  type SignUpSelectors = {
91
95
  emailTextField: string;
@@ -100,6 +104,24 @@ type SignUpSelectors = {
100
104
  subdomainNameTextField: string;
101
105
  subdomainError: string;
102
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
+ };
103
125
 
104
126
  // texts ------------------------------------------------
105
127
  type CommonTexts = {
@@ -175,6 +197,24 @@ type Environment = {
175
197
  development: string;
176
198
  staging: string;
177
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
+ };
178
218
 
179
219
  // utils ------------------------------------------------
180
220
 
@@ -310,6 +350,18 @@ type EditMemberViaRequestPropsType = {
310
350
  lastName: string;
311
351
  requestCount: number;
312
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
+ };
313
365
  export const memberUtils: {
314
366
  addMemberViaRequest: (props: AddMemberViaRequestPropsType) => void;
315
367
  addMemberViaUI: (props: AddMemberViaUIPropsType) => void;
@@ -326,6 +378,16 @@ export const memberUtils: {
326
378
  verifyMemberDetails: (props: VerifyMembersPropsType) => void;
327
379
  clickOnColumnIcon: (props: clickOnColumnIcon) => void;
328
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;
390
+ };
329
391
 
330
392
  // exporting all selectors
331
393
 
@@ -335,6 +397,8 @@ export const loginSelectors: LoginSelectors;
335
397
  export const profileSelectors: ProfileSelectors;
336
398
  export const signUpSelectors: SignUpSelectors;
337
399
  export const memberFormSelectors: MemberFormSelectors;
400
+ export const helpIconSelectors: HelpIconSelectors;
401
+ export const chatWidgetSelectors: ChatWidgetSelectors;
338
402
 
339
403
  // exporting all texts
340
404
 
@@ -344,4 +408,6 @@ export const memberTableTexts: MemberTableTexts;
344
408
  export const memberFormErrorTexts: MemberFormErrorTexts;
345
409
  export const signUpTexts: SignUpTexts;
346
410
  export const environment: Environment;
347
- 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
- subdomainAvailablity: getUrl("subdomain_availability/**"),
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 = {
@@ -541,7 +551,8 @@ var memberSelectors = {
541
551
  deactivateButton: dataCy("ntm-deactivate-members-button"),
542
552
  rolesButton: function rolesButton(index) {
543
553
  return dataCy("ntm-manage-member-roles-button", ":eq(".concat(index, ")"));
544
- }
554
+ },
555
+ statusTag: dataCy("ntm-member-status-tag")
545
556
  };
546
557
  var memberFormSelectors = {
547
558
  emailTextField: "input.neeto-ui-react-select__input:eq(0)",
@@ -567,6 +578,25 @@ var signUpSelectors = {
567
578
  tryFreeButton: dataCy("neeto-auth-signup-link")
568
579
  };
569
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
+
570
600
  var memberTexts = {
571
601
  addMember: "Add new member",
572
602
  admin: "Admin",
@@ -629,7 +659,26 @@ var memberFormErrorTexts = {
629
659
  var signUpTexts = {
630
660
  email: "Email",
631
661
  profile: "profile",
632
- 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"
633
682
  };
634
683
 
635
684
  var verifySSOLoginPage = function verifySSOLoginPage() {
@@ -787,6 +836,7 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
787
836
  var email = _ref3.email,
788
837
  role = _ref3.role,
789
838
  name = _ref3.name,
839
+ statusTag = _ref3.statusTag,
790
840
  _ref3$skipSearchReque = _ref3.skipSearchRequest,
791
841
  skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
792
842
  !skipSearchRequest && interceptMemberApi("searchMember");
@@ -797,8 +847,11 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
797
847
  !skipSearchRequest && cy.wait("@searchMember");
798
848
  return cy.contains(tableSelectors.tableRow, email).within(function () {
799
849
  cy.get(memberSelectors.email).should("have.text", email);
800
- name && cy.get(memberSelectors.name).should("have.text", name);
850
+ cy.get(memberSelectors.name).within(function () {
851
+ name && cy.get("p").should("have.text", name);
852
+ });
801
853
  role && cy.get(memberSelectors.role).should("have.text", role);
854
+ statusTag && cy.get(memberSelectors.statusTag).should("have.text", statusTag);
802
855
  });
803
856
  };
804
857
  var updateMemberRole = function updateMemberRole(_ref4) {
@@ -1018,7 +1071,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
1018
1071
  var lastDigit = Number(subdomainName.charAt(subdomainName.length - 1));
1019
1072
  var newOrganizationName = subdomainName.slice(0, -1) + (lastDigit + 1);
1020
1073
  cy.intercept({
1021
- url: requestApis.subdomainAvailablity,
1074
+ url: requestApis.subdomainAvailability,
1022
1075
  times: 1
1023
1076
  }).as("subdomainRequest");
1024
1077
  cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
@@ -1037,7 +1090,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
1037
1090
  cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
1038
1091
  });
1039
1092
  cy.ifExist(signUpSelectors.subdomainError, function () {
1040
- return updateSubdmainIfExit(newOrganizationName);
1093
+ return updateSubdmainIfExit(appName, newOrganizationName);
1041
1094
  });
1042
1095
  });
1043
1096
  };
@@ -1048,7 +1101,8 @@ var createOrganization = function createOrganization(_ref) {
1048
1101
  firstName = _ref.firstName,
1049
1102
  lastName = _ref.lastName,
1050
1103
  appName = _ref.appName;
1051
- var otp = "123456";
1104
+ var isMailosaurEmail = email.includes("mailosaur");
1105
+ var defaultOtp = "123456";
1052
1106
  var appNameInLowerCase = appName.toLowerCase();
1053
1107
  var isNeetoAuth = appNameInLowerCase === "neetoauth";
1054
1108
  if (isNeetoAuth) cy.visit("https://app.neetoauth.net/signups/new");else {
@@ -1064,10 +1118,18 @@ var createOrganization = function createOrganization(_ref) {
1064
1118
  }).as("signupRequest");
1065
1119
  cy.get(signUpSelectors.submitButton).click();
1066
1120
  cy.wait("@signupRequest");
1067
- cy.get(signUpSelectors.otpTextBox).type(otp);
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);
1068
1130
  cy.wait("@signupRequest");
1069
1131
  cy.intercept({
1070
- url: requestApis.subdomainAvailablity,
1132
+ url: requestApis.subdomainAvailability,
1071
1133
  times: 1
1072
1134
  }).as("subdomainRequest");
1073
1135
  cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
@@ -1106,5 +1168,129 @@ var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submit
1106
1168
  cy.get(commonSelectors.windowAlert).should("not.exist");
1107
1169
  };
1108
1170
 
1109
- export { authUtils, commonSelectors, commonTexts, createOrganization, dataCy, dateUtils, environment, getTestTitle, getUrl, initCustomCommands, initializeCredentials, isStagingEnv, joinHyphenCase, loginSelectors, memberFormErrorTexts, memberFormSelectors, memberSelectors, memberTableTexts, memberTexts, memberUtils, profileSelectors, setListCount, signUpSelectors, signUpTexts, tableSelectors, verifyCrossSiteScript, verifyListCount };
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 };
1110
1296
  //# sourceMappingURL=cypress-utils.js.map