@bigbinary/neeto-commons-frontend 2.0.109 → 2.0.111
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/utils.cjs.js +9 -0
- package/utils.cjs.js.map +1 -1
- package/utils.d.ts +3 -0
- package/utils.js +9 -0
- package/utils.js.map +1 -1
package/cypress-utils.js
CHANGED
|
@@ -1081,31 +1081,37 @@ var memberUtils = {
|
|
|
1081
1081
|
clickOnColumnIcon: clickOnColumnIcon
|
|
1082
1082
|
};
|
|
1083
1083
|
|
|
1084
|
-
var
|
|
1084
|
+
var extractSubdomainFromError = function extractSubdomainFromError(inputString) {
|
|
1085
|
+
var regex = /cypresstest[a-zA-Z0-9-]+/g;
|
|
1086
|
+
var matches = inputString.match(regex);
|
|
1087
|
+
return matches[1];
|
|
1088
|
+
};
|
|
1089
|
+
var updateSubdomainIfExists = function updateSubdomainIfExists(appName) {
|
|
1085
1090
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1091
|
+
cy.get(signUpSelectors.subdomainError).invoke("text").then(function (text) {
|
|
1092
|
+
cy.intercept({
|
|
1093
|
+
url: requestApis.subdomainAvailability,
|
|
1094
|
+
times: 1
|
|
1095
|
+
}).as("subdomainRequest");
|
|
1096
|
+
var newOrganizationName = extractSubdomainFromError(text);
|
|
1097
|
+
cy.clearAndType(signUpSelectors.subdomainNameTextField, newOrganizationName);
|
|
1098
|
+
cy.wait("@subdomainRequest");
|
|
1099
|
+
cy.ifNotExist(signUpSelectors.subdomainError, function () {
|
|
1100
|
+
cy.task("updateGlobalState", {
|
|
1101
|
+
key: "subdomainName",
|
|
1102
|
+
value: newOrganizationName
|
|
1103
|
+
});
|
|
1104
|
+
cy.task("updateGlobalState", {
|
|
1105
|
+
key: "businessName",
|
|
1106
|
+
value: newOrganizationName
|
|
1107
|
+
});
|
|
1108
|
+
var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
|
|
1109
|
+
Cypress.config("baseUrl", newBaseUrl);
|
|
1110
|
+
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
1102
1111
|
});
|
|
1103
|
-
var newBaseUrl = "https://".concat(newOrganizationName, ".").concat(appName, ".").concat(env.tld);
|
|
1104
|
-
Cypress.config("baseUrl", newBaseUrl);
|
|
1105
|
-
cy.clearAndType(signUpSelectors.organizationNameTextField, newOrganizationName);
|
|
1106
1112
|
});
|
|
1107
1113
|
cy.ifExist(signUpSelectors.subdomainError, function () {
|
|
1108
|
-
return updateSubdomainIfExists(appName
|
|
1114
|
+
return updateSubdomainIfExists(appName);
|
|
1109
1115
|
});
|
|
1110
1116
|
});
|
|
1111
1117
|
};
|
|
@@ -1121,7 +1127,7 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1121
1127
|
var appNameInLowerCase = appName.toLowerCase();
|
|
1122
1128
|
var isNeetoAuth = appNameInLowerCase === "neetoauth";
|
|
1123
1129
|
if (isNeetoAuth) cy.visit("https://app.neetoauth.".concat(env.tld, "/signups/new"));else {
|
|
1124
|
-
var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase).concat(env.
|
|
1130
|
+
var startingUrl = "https://www.neeto.com/".concat(appNameInLowerCase).concat(env.isStaging ? "?env=staging" : "");
|
|
1125
1131
|
cy.visit(startingUrl);
|
|
1126
1132
|
cy.get(signUpSelectors.tryFreeButton).invoke("removeAttr", "target").click();
|
|
1127
1133
|
}
|
|
@@ -1150,7 +1156,7 @@ var createOrganization = function createOrganization(_ref) {
|
|
|
1150
1156
|
cy.clearAndType(signUpSelectors.organizationNameTextField, businessName);
|
|
1151
1157
|
cy.clearAndType(signUpSelectors.subdomainNameTextField, subdomainName);
|
|
1152
1158
|
cy.wait("@subdomainRequest");
|
|
1153
|
-
updateSubdomainIfExists(appNameInLowerCase
|
|
1159
|
+
updateSubdomainIfExists(appNameInLowerCase);
|
|
1154
1160
|
cy.intercept({
|
|
1155
1161
|
url: requestApis.signUp,
|
|
1156
1162
|
times: 1
|