-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(cli): Allow frameworks to specify extra command line flags #3994
Conversation
runTestPreparer(extraFlags?: string[]): q.Promise<any> { | ||
let unknownFlags = this.config_.unknownFlags_ || []; | ||
if (extraFlags) { | ||
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) != 0); |
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.
!== -1
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.
Done
721a38e
to
ee237b8
Compare
runTestPreparer(extraFlags?: string[]): q.Promise<any> { | ||
let unknownFlags = this.config_.unknownFlags_ || []; | ||
if (extraFlags) { | ||
unknownFlags = unknownFlags.filter((f) => extraFlags.indexOf(f) === -1); |
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.
Yup I stand corrected. This should be ===
. Filter flags that do not exist in extra flags. LGTM.
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.
Update the commit message to link to issue
Hi guys! |
Unknown flags will log a warning message in 5.1 instead of quitting with an error. We're hoping to get 5.1 out this Monday. |
Thanks for the prompt turnaround! Warning is a good response to unknown flags. |
This change adds support for using Serenity/JS with Protractor 5.0.0, 5.1.0 and 5.1.1: - `ProtractorNotifier` deals with Protractor 5.1.0 requirement for test frameworks to invoke `runner.afterEach` after every test, so that the browser is correctly restarted between the tests. See angular/protractor#4087 - `TestFrameworkDetector` registers `mochaOpts` and `cucumberOpts` as valid command line options, benefiting from angular/protractor#3994 and dealing with a bug introduced in Protractor 5.0.0, which prevents command line arguments from being passed on to custom test frameworks. See angular/protractor#3978 - Updated the examples and documentation to work with Protractor 5.1.x - Enables #18 Related issues: angular/protractor#3978 angular/protractor#3994 angular/protractor#4087 #18
…3994) Fix for angular#3978. Our initial plan to allow setting --disableChecks with an environment variable is insufficient, since the custom framework isn't even require()'d until after the config is parsed. This moves the unknown flag check into the runner, and gives frameworks a way to specify extra flags they accept.
Can you please provide an example of using the
But I still receive the warning:
Did I miss something? 🤔 |
Fix for #3978.
Our initial plan to allow setting --disableChecks with an environment variable is insufficient, since the custom framework isn't even require()'d until after the config is parsed. This moves the unknown flag check into the runner, and gives frameworks a way to specify extra flags they accept.