@bigbinary/neeto-commons-frontend 2.0.106 → 2.0.108

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.
@@ -11,6 +11,7 @@ const webpack = require("@cypress/webpack-preprocessor");
11
11
  const {
12
12
  cypressBrowserPermissionsPlugin,
13
13
  } = require("cypress-browser-permissions");
14
+ const { cloudPlugin } = require("cypress-cloud/plugin");
14
15
  const fs = require("fs-extra");
15
16
 
16
17
  const getConfigurationByFile = file => {
@@ -47,6 +48,7 @@ module.exports = (on, config) => {
47
48
  const newEnvironment = merge(config, configForEnvironment);
48
49
  require("@cypress/grep/src/plugin")(newEnvironment);
49
50
  require("@cypress/code-coverage/task")(on, newEnvironment);
51
+ cloudPlugin(on, newEnvironment);
50
52
 
51
53
  on("before:browser:launch", (browser, launchOptions) => {
52
54
  if (["chrome", "edge"].includes(browser.name) && browser.isHeadless) {
@@ -82,15 +82,25 @@ function _toConsumableArray(arr) {
82
82
 
83
83
  var environment = {
84
84
  development: "development",
85
- staging: "staging"
85
+ staging: "staging",
86
+ review: "review",
87
+ production: "production"
86
88
  };
87
- var isStagingEnv = Cypress.env("configFile") === environment.staging;
88
89
 
89
90
  function ownKeys$2(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; }
90
91
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
91
92
  var getCountFromText = function getCountFromText(countText) {
92
93
  return Number(countText.text().trim().split(" ")[0]);
93
94
  };
95
+ var env = {
96
+ isDevelopment: Cypress.env("configFile") === environment.development,
97
+ isReview: Cypress.env("configFile") === environment.review,
98
+ isStaging: Cypress.env("configFile") === environment.staging,
99
+ isProduction: Cypress.env("configFile") === environment.production
100
+ };
101
+ env.isNightlyRun = env.isProduction || env.isStaging;
102
+ env.tld = env.isProduction ? "com" : "net";
103
+ var isStagingEnv = Cypress.env("configFile") === environment.staging;
94
104
  var dataCy = function dataCy(value) {
95
105
  var suffix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
96
106
  return "[data-cy='".concat(value, "']").concat(suffix);
@@ -140,6 +150,7 @@ var initializeCredentials = function initializeCredentials(stagingData) {
140
150
  var allPath = function allPath() {
141
151
  return "".concat(Cypress.config("baseUrl"), "/**");
142
152
  };
153
+ var tld = env.isProduction ? "com" : "net";
143
154
  var requestApis = {
144
155
  countries: getUrl("countries"),
145
156
  signUp: getUrl("signups/**"),
@@ -152,12 +163,12 @@ var requestApis = {
152
163
  return "/team_members/teams/".concat(id);
153
164
  }
154
165
  },
155
- allChatPath: "https://*.neetochat.net".concat(getUrl("**")),
166
+ allChatPath: "https://*.neetochat.".concat(tld).concat(getUrl("**")),
156
167
  myProfilePath: function myProfilePath(subdomain) {
157
- return "https://".concat(subdomain, ".neetoauth.net/my/profile");
168
+ return "https://".concat(subdomain, ".neetoauth.").concat(tld, "/my/profile");
158
169
  },
159
170
  settingsPath: function settingsPath(subdomain) {
160
- return "https://".concat(subdomain, ".neetoauth.net/settings");
171
+ return "https://".concat(subdomain, ".neetoauth.").concat(tld, "/settings");
161
172
  }
162
173
  };
163
174
  var urlPaths = {
@@ -1078,7 +1089,7 @@ var memberUtils = {
1078
1089
  clickOnColumnIcon: clickOnColumnIcon
1079
1090
  };
1080
1091
 
1081
- var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName) {
1092
+ var updateSubdomainIfExists = function updateSubdomainIfExists(appName, subdomainName) {
1082
1093
  cy.ifExist(signUpSelectors.subdomainError, function () {
1083
1094
  var lastDigit = Number(subdomainName.charAt(subdomainName.length - 1));
1084
1095
  var newOrganizationName = subdomainName.slice(0, -1) + (lastDigit + 1);
@@ -1097,12 +1108,12 @@ var updateSubdmainIfExit = function updateSubdmainIfExit(appName, subdomainName)
1097
1108
  key: "businessName",
1098
1109
  value: newOrganizationName
1099
1110
  });
1100
- var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".net");
1111
+ var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
1101
1112
  Cypress.config("baseUrl", newBaseUrl);
1102
1113
  cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
1103
1114
  });
1104
1115
  cy.ifExist(signUpSelectors.subdomainError, function () {
1105
- return updateSubdmainIfExit(appName, newOrganizationName);
1116
+ return updateSubdomainIfExists(appName, newOrganizationName);
1106
1117
  });
1107
1118
  });
1108
1119
  };
@@ -1117,8 +1128,8 @@ var createOrganization = function createOrganization(_ref) {
1117
1128
  var defaultOtp = "123456";
1118
1129
  var appNameInLowerCase = appName.toLowerCase();
1119
1130
  var isNeetoAuth = appNameInLowerCase === "neetoauth";
1120
- if (isNeetoAuth) cy.visit("https://app.neetoauth.net/signups/new");else {
1121
- var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase, "?env=staging");
1131
+ if (isNeetoAuth) cy.visit("https://app.neetoauth.".concat(env.tld, "/signups/new"));else {
1132
+ var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase).concat(env.isProduction ? "?env=staging" : "");
1122
1133
  cy.visit(startingUrl);
1123
1134
  cy.get(signUpSelectors.tryFreeButton).invoke("removeAttr", "target").click();
1124
1135
  }
@@ -1147,7 +1158,7 @@ var createOrganization = function createOrganization(_ref) {
1147
1158
  cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
1148
1159
  cy.clearAndType(signUpSelectors.subdomainNameTextField, subdomainName);
1149
1160
  cy.wait("@subdomainRequest");
1150
- updateSubdmainIfExit(appNameInLowerCase, subdomainName);
1161
+ updateSubdomainIfExists(appNameInLowerCase, subdomainName);
1151
1162
  cy.intercept({
1152
1163
  url: requestApis.signUp,
1153
1164
  times: 1
@@ -1329,6 +1340,7 @@ exports.commonTexts = commonTexts;
1329
1340
  exports.createOrganization = createOrganization;
1330
1341
  exports.dataCy = dataCy;
1331
1342
  exports.dateUtils = dateUtils;
1343
+ exports.env = env;
1332
1344
  exports.environment = environment;
1333
1345
  exports.getTestTitle = getTestTitle;
1334
1346
  exports.getUrl = getUrl;