-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support for record flag #284
Conversation
bin/helpers/capabilityHelper.js
Outdated
@@ -241,6 +241,14 @@ const validate = (bsConfig, args) => { | |||
logger.warn(Constants.validationMessages.SPEC_TIMEOUT_NOT_PASSED_ERROR); | |||
} | |||
|
|||
if(!Utils.isUndefined(bsConfig.run_settings["record"])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if bsConfig.run_settings["record"]
is false then I believe, it will go inside this code block and give warnings to users if the project Id or record key is missing which it ideally shouldn't
bin/helpers/capabilityHelper.js
Outdated
if(!Utils.isUndefined(bsConfig.run_settings["record"])) { | ||
if(Utils.isUndefined(bsConfig.run_settings.projectId)) { | ||
logger.warn(Constants.validationMessages.PROJECT_ID_MISSING); | ||
} else if (Utils.isUndefined(bsConfig.run_settings["record-key"])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this a separate if
condition and not else if
. The reason for this is to let users know on the first try only they are missing both projectId and record-key if they are missing.
exports.setProjectId = (bsConfig, args) => { | ||
if(!this.isUndefined(args["projectId"])) { | ||
return args["projectId"]; | ||
} else if(!this.isUndefined(bsConfig.run_settings["projectId"])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just like env var CYPRESS_RECORD_KEY
, we have an env var for project id i.e. CYPRESS_PROJECT_ID
. More info is available here.
bin/helpers/capabilityHelper.js
Outdated
@@ -241,6 +241,15 @@ const validate = (bsConfig, args) => { | |||
logger.warn(Constants.validationMessages.SPEC_TIMEOUT_NOT_PASSED_ERROR); | |||
} | |||
|
|||
if(!Utils.isUndefined(bsConfig.run_settings["record"]) && String(bsConfig.run_settings["record"]) == 'true') { | |||
if(Utils.isUndefined(bsConfig.run_settings.projectId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add check for projectId
or record-key
being empty strings as well and show the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recent changes LGTM
No description provided.