Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Error Texts #102

Merged
merged 3 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/helpers/capabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const validate = (bsConfig, args) => {
cypressJson = JSON.parse(cypressJsonContent);

// Cypress Json Base Url & Local true check
if (!Utils.isUndefined(cypressJson.baseUrl) && cypressJson.baseUrl.includes("localhost") && !Utils.getLocalFlag(bsConfig.connection_settings)) reject(Constants.validationMessages.LOCAL_NOT_SET);
if (!Utils.isUndefined(cypressJson.baseUrl) && cypressJson.baseUrl.includes("localhost") && !Utils.getLocalFlag(bsConfig.connection_settings)) reject(Constants.validationMessages.LOCAL_NOT_SET.replace("<baseUrlValue>", cypressJson.baseUrl));

// Detect if the user is not using the right directory structure, and throw an error
if (!Utils.isUndefined(cypressJson.integrationFolder) && !Utils.isCypressProjDirValid(bsConfig.run_settings.cypressProjectDir,cypressJson.integrationFolder)) reject(Constants.validationMessages.INCORRECT_DIRECTORY_STRUCTURE);
Expand Down
4 changes: 2 additions & 2 deletions bin/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const userMessages = {
BUILD_INFO_FAILED: "Failed to get build info.",
BUILD_STOP_FAILED: "Failed to stop build.",
BUILD_REPORT_MESSAGE: "See the entire build report here:",
ZIP_UPLOADER_NOT_REACHABLE: "Could not reach to zip uploader.",
ZIP_UPLOADER_NOT_REACHABLE: "Could not reach BrowserStack APIs. Please check your network or see if you need to whitelist *.browserstack.com",
ZIP_UPLOAD_FAILED: "Zip Upload failed.",
CONFIG_FILE_CREATED: "BrowserStack Config File created, you can now run browserstack-cypress --config-file run",
CONFIG_FILE_EXISTS: "File already exists, delete the browserstack.json file manually. skipping...",
Expand Down Expand Up @@ -56,7 +56,7 @@ const validationMessages = {
CYPRESS_JSON_NOT_FOUND: "cypress.json file is not found at cypress_proj_dir path ",
INVALID_CYPRESS_JSON: "cypress.json is not a valid json",
INVALID_DEFAULT_AUTH_PARAMS: "Your username and access key are required to run your tests on BrowserStack. Learn more at https://www.browserstack.com/docs/automate/cypress/authentication",
LOCAL_NOT_SET: "To test <baseUrl value> on BrowserStack, you will have to set up Local testing. Read more here: https://www.browserstack.com/docs/automate/cypress/local-testing",
LOCAL_NOT_SET: "To test <baseUrlValue> on BrowserStack, you will have to set up Local testing. Read more here: https://www.browserstack.com/docs/automate/cypress/local-testing",
INCORRECT_DIRECTORY_STRUCTURE: "No tests to run. Note that your Cypress tests should be in the same directory where the cypress.json exists."
};

Expand Down
2 changes: 1 addition & 1 deletion test/unit/bin/helpers/capabilityHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ describe("capabilityHelper.js", () => {
.catch((error) => {
chai.assert.equal(
error,
Constants.validationMessages.LOCAL_NOT_SET
Constants.validationMessages.LOCAL_NOT_SET.replace("<baseUrlValue>", "http://localhost:3000")
);
fs.existsSync.restore();
fs.readFileSync.restore();
Expand Down