@bigbinary/neeto-commons-frontend 2.0.109 → 2.0.110
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/cypress-utils.cjs.js +29 -23
- package/cypress-utils.cjs.js.map +1 -1
- package/cypress-utils.js +29 -23
- package/cypress-utils.js.map +1 -1
- package/package.json +1 -1
package/cypress-utils.cjs.js
CHANGED
|
@@ -1089,31 +1089,37 @@ var memberUtils = {
|
|
|
1089
1089
|
clickOnColumnIcon: clickOnColumnIcon
|
|
1090
1090
|
};
|
|
1091
1091
|
|
|
1092
|
-
var
|
|
1092
|
+
var extractSubdomainFromError = function extractSubdomainFromError(inputString) {
|
|
1093
|
+
var regex = /cypresstest[a-zA-Z0-9-]+/g;
|
|
1094
|
+
var matches = inputString.match(regex);
|
|
1095
|
+
return matches[1];
|
|
1096
|
+
};
|
|
1097
|
+
var updateSubdomainIfExists = function updateSubdomainIfExists(appName) {
|
|
1093
1098
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1099
|
+
cy.get(signUpSelectors.subdomainError).invoke("text").then(function (text) {
|
|
1100
|
+
cy.intercept({
|
|
1101
|
+
url: requestApis.subdomainAvailability,
|
|
1102
|
+
times: 1
|
|
1103
|
+
}).as("subdomainRequest");
|
|
1104
|
+
var newOrganizationName = extractSubdomainFromError(text);
|
|
1105
|
+
cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
|
|
1106
|
+
cy.wait("@subdomainRequest");
|
|
1107
|
+
cy.ifNotExist(signUpSelectors.subdomainError, function () {
|
|
1108
|
+
cy.task("updateGlobalState", {
|
|
1109
|
+
key: "subdomainName",
|
|
1110
|
+
value: newOrganizationName
|
|
1111
|
+
});
|
|
1112
|
+
cy.task("updateGlobalState", {
|
|
1113
|
+
key: "businessName",
|
|
1114
|
+
value: newOrganizationName
|
|
1115
|
+
});
|
|
1116
|
+
var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
|
|
1117
|
+
Cypress.config("baseUrl", newBaseUrl);
|
|
1118
|
+
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
1110
1119
|
});
|
|
1111
|
-
var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
|
|
1112
|
-
Cypress.config("baseUrl", newBaseUrl);
|
|
1113
|
-
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
1114
1120
|
});
|
|
1115
1121
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1116
|
-
return updateSubdomainIfExists(appName
|
|
1122
|
+
return updateSubdomainIfExists(appName);
|
|
1117
1123
|
});
|
|
1118
1124
|
});
|
|
1119
1125
|
};
|
|
@@ -1129,7 +1135,7 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1129
1135
|
var appNameInLowerCase = appName.toLowerCase();
|
|
1130
1136
|
var isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
1131
1137
|
if (isNeetoAuth) cy.visit("https://app.neetoauth.".concat(env.tld, "/signups/new"));else {
|
|
1132
|
-
var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase).concat(env.
|
|
1138
|
+
var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase).concat(env.isStaging ? "?env=staging" : "");
|
|
1133
1139
|
cy.visit(startingUrl);
|
|
1134
1140
|
cy.get(signUpSelectors.tryFreeButton).invoke("removeAttr", "target").click();
|
|
1135
1141
|
}
|
|
@@ -1158,7 +1164,7 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1158
1164
|
cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
|
|
1159
1165
|
cy.clearAndType(signUpSelectors.subdomainNameTextField, subdomainName);
|
|
1160
1166
|
cy.wait("@subdomainRequest");
|
|
1161
|
-
updateSubdomainIfExists(appNameInLowerCase
|
|
1167
|
+
updateSubdomainIfExists(appNameInLowerCase);
|
|
1162
1168
|
cy.intercept({
|
|
1163
1169
|
url: requestApis.signUp,
|
|
1164
1170
|
times: 1
|