@bigbinary/neeto-commons-frontend 2.0.74 → 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.
@@ -143,7 +143,7 @@ var allPath = function allPath() {
143
143
  var requestApis = {
144
144
  countries: getUrl("countries"),
145
145
  signUp: getUrl("signups/**"),
146
- subdomainAvailablity: getUrl("subdomain_availability/**"),
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 = {
@@ -549,7 +559,8 @@ var memberSelectors = {
549
559
  deactivateButton: dataCy("ntm-deactivate-members-button"),
550
560
  rolesButton: function rolesButton(index) {
551
561
  return dataCy("ntm-manage-member-roles-button", ":eq(".concat(index, ")"));
552
- }
562
+ },
563
+ statusTag: dataCy("ntm-member-status-tag")
553
564
  };
554
565
  var memberFormSelectors = {
555
566
  emailTextField: "input.neeto-ui-react-select__input:eq(0)",
@@ -575,6 +586,25 @@ var signUpSelectors = {
575
586
  tryFreeButton: dataCy("neeto-auth-signup-link")
576
587
  };
577
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
+
578
608
  var memberTexts = {
579
609
  addMember: "Add new member",
580
610
  admin: "Admin",
@@ -637,7 +667,26 @@ var memberFormErrorTexts = {
637
667
  var signUpTexts = {
638
668
  email: "Email",
639
669
  profile: "profile",
640
- 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"
641
690
  };
642
691
 
643
692
  var verifySSOLoginPage = function verifySSOLoginPage() {
@@ -795,6 +844,7 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
795
844
  var email = _ref3.email,
796
845
  role = _ref3.role,
797
846
  name = _ref3.name,
847
+ statusTag = _ref3.statusTag,
798
848
  _ref3$skipSearchReque = _ref3.skipSearchRequest,
799
849
  skipSearchRequest = _ref3$skipSearchReque === void 0 ? true : _ref3$skipSearchReque;
800
850
  !skipSearchRequest && interceptMemberApi("searchMember");
@@ -805,8 +855,11 @@ var verifyMemberDetails = function verifyMemberDetails(_ref3) {
805
855
  !skipSearchRequest && cy.wait("@searchMember");
806
856
  return cy.contains(tableSelectors.tableRow, email).within(function () {
807
857
  cy.get(memberSelectors.email).should("have.text", email);
808
- name && cy.get(memberSelectors.name).should("have.text", name);
858
+ cy.get(memberSelectors.name).within(function () {
859
+ name && cy.get("p").should("have.text", name);
860
+ });
809
861
  role && cy.get(memberSelectors.role).should("have.text", role);
862
+ statusTag && cy.get(memberSelectors.statusTag).should("have.text", statusTag);
810
863
  });
811
864
  };
812
865
  var updateMemberRole = function updateMemberRole(_ref4) {
@@ -1026,7 +1079,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
1026
1079
  var lastDigit = Number(subdomainName.charAt(subdomainName.length - 1));
1027
1080
  var newOrganizationName = subdomainName.slice(0, -1) + (lastDigit + 1);
1028
1081
  cy.intercept({
1029
- url: requestApis.subdomainAvailablity,
1082
+ url: requestApis.subdomainAvailability,
1030
1083
  times: 1
1031
1084
  }).as("subdomainRequest");
1032
1085
  cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
@@ -1045,7 +1098,7 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
1045
1098
  cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
1046
1099
  });
1047
1100
  cy.ifExist(signUpSelectors.subdomainError, function () {
1048
- return updateSubdmainIfExit(newOrganizationName);
1101
+ return updateSubdmainIfExit(appName, newOrganizationName);
1049
1102
  });
1050
1103
  });
1051
1104
  };
@@ -1056,7 +1109,8 @@ var createOrganization = function createOrganization(_ref) {
1056
1109
  firstName = _ref.firstName,
1057
1110
  lastName = _ref.lastName,
1058
1111
  appName = _ref.appName;
1059
- var otp = "123456";
1112
+ var isMailosaurEmail = email.includes("mailosaur");
1113
+ var defaultOtp = "123456";
1060
1114
  var appNameInLowerCase = appName.toLowerCase();
1061
1115
  var isNeetoAuth = appNameInLowerCase === "neetoauth";
1062
1116
  if (isNeetoAuth) cy.visit("https://app.neetoauth.net/signups/new");else {
@@ -1072,10 +1126,18 @@ var createOrganization = function createOrganization(_ref) {
1072
1126
  }).as("signupRequest");
1073
1127
  cy.get(signUpSelectors.submitButton).click();
1074
1128
  cy.wait("@signupRequest");
1075
- cy.get(signUpSelectors.otpTextBox).type(otp);
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);
1076
1138
  cy.wait("@signupRequest");
1077
1139
  cy.intercept({
1078
- url: requestApis.subdomainAvailablity,
1140
+ url: requestApis.subdomainAvailability,
1079
1141
  times: 1
1080
1142
  }).as("subdomainRequest");
1081
1143
  cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
@@ -1114,7 +1176,132 @@ var verifyCrossSiteScript = function verifyCrossSiteScript(inputSelector, submit
1114
1176
  cy.get(commonSelectors.windowAlert).should("not.exist");
1115
1177
  };
1116
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
+
1117
1303
  exports.authUtils = authUtils;
1304
+ exports.chatWidgetSelectors = chatWidgetSelectors;
1118
1305
  exports.commonSelectors = commonSelectors;
1119
1306
  exports.commonTexts = commonTexts;
1120
1307
  exports.createOrganization = createOrganization;
@@ -1123,6 +1310,8 @@ exports.dateUtils = dateUtils;
1123
1310
  exports.environment = environment;
1124
1311
  exports.getTestTitle = getTestTitle;
1125
1312
  exports.getUrl = getUrl;
1313
+ exports.helpIconSelectors = helpIconSelectors;
1314
+ exports.helpIconTexts = helpIconTexts;
1126
1315
  exports.initCustomCommands = initCustomCommands;
1127
1316
  exports.initializeCredentials = initializeCredentials;
1128
1317
  exports.isStagingEnv = isStagingEnv;
@@ -1134,7 +1323,9 @@ exports.memberSelectors = memberSelectors;
1134
1323
  exports.memberTableTexts = memberTableTexts;
1135
1324
  exports.memberTexts = memberTexts;
1136
1325
  exports.memberUtils = memberUtils;
1326
+ exports.navigationUtils = navigationUtils;
1137
1327
  exports.profileSelectors = profileSelectors;
1328
+ exports.profileTexts = profileTexts;
1138
1329
  exports.setListCount = setListCount;
1139
1330
  exports.signUpSelectors = signUpSelectors;
1140
1331
  exports.signUpTexts = signUpTexts;