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

[selenium-webdriver] Fix missing/incorrect webdriver.Builder methods #37854

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Aug 23, 2019

I went through all the Builder methods on the implementation and corrected any differences I saw.

Some of these changes are breaking, but would only break cases that would already be broken at runtime.

Summary of changes:

  • Adds typings for the following webdriver.Builder methods that were missing: getChromeOptions, setChromeService, setEdgeService, getFirefoxOptions, setFirefoxService, setIeService, getSafariOptions, getHttpAgent
    • The getEdgeOptions and setSafariService methods are missing intentionally, since they are missing in the implementation
  • Adds missing ie.ServiceBuilder and ie.Level types
  • Widens the return type of Builder.getWebDriverProxy to allow for it to return null, per the implementation and docs
  • Makes Builder and Capabilities' setAlertBehavior parameter optional per the implementation.
  • (BREAKING) fixes the ie.Options.setLogLevel signature to match the implementation, which uses an IE-specific log level and not the general logging.Level type.
  • (BREAKING) replaces the incorrectly-named Builder.setSafari method with Builder.setSafariOptions to match the implementation
  • (BREAKING) updates the type signature on ie.Driver.createSession to match the implementation

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: selenium-webdriver/index.js, selenium-webdriver/ie.js
  • [n/a] If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • [n/a] If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

@typescript-bot typescript-bot added this to Waiting for Reviewers in Pull Request Status Board Aug 23, 2019
@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Awaiting reviewer feedback labels Aug 23, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 23, 2019

@dbjorge Thank you for submitting this PR!

🔔 @BillArmstrong @Kuniwak @cnishina @SupernaviX @bendxn @oddui @beta-vulgaris - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics.

Let’s review the numbers, shall we?

Comparison details 📊
master #37854 diff
Batch compilation
Memory usage (MiB) 39.2 40.6 +3.6%
Type count 3768 3827 +1.6%
Assignability cache size 556 559 +0.5%
Subtype cache size 14 14 0.0%
Identity cache size 11 11 0.0%
Language service
Samples taken 2157 2318 +7.5%
Identifiers in tests 2157 2318 +7.5%
getCompletionsAtPosition
    Mean duration (ms) 146.8 151.7 +3.3%
    Median duration (ms) 145.4 149.9 +3.1%
    Mean CV 16.3% 17.1% +5.0%
    Worst duration (ms) 223.6 216.7 -3.1%
    Worst identifier NUMPAD3 options
getQuickInfoAtPosition
    Mean duration (ms) 142.9 147.2 +3.0%
    Median duration (ms) 140.5 145.3 +3.4%
    Mean CV 14.7% 16.2% +10.0%
    Worst duration (ms) 199.3 218.4 +9.6%
    Worst identifier driver options

It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place.


If you have any questions or comments about me, you can ping @andrewbranch. Have a nice day!

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Review in Pull Request Status Board Aug 28, 2019
@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Aug 28, 2019
@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 28, 2019

A definition owner has approved this PR ⭐️. A maintainer will merge this PR shortly. If it shouldn't be merged yet, please leave a comment saying so and we'll wait. Thank you for your contribution to DefinitelyTyped!

@cnishina
Copy link
Contributor

I am on vacation and won't be able to review this

Copy link
Contributor

@beta-vulgaris beta-vulgaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@typescript-bot typescript-bot moved this from Review to Check and Merge in Pull Request Status Board Aug 29, 2019
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Merge:Express and removed Awaiting reviewer feedback Unmerged The author did not merge the PR when it was ready. labels Aug 29, 2019
@typescript-bot
Copy link
Contributor

Updated numbers for you here from 269a7d0:

Comparison details 📊
master #37854 diff
Batch compilation
Memory usage (MiB) 39.7 40.8 +2.7%
Type count 3768 3828 +1.6%
Assignability cache size 556 559 +0.5%
Subtype cache size 14 14 0.0%
Identity cache size 11 11 0.0%
Language service
Samples taken 2157 2322 +7.6%
Identifiers in tests 2157 2322 +7.6%
getCompletionsAtPosition
    Mean duration (ms) 161.7 161.0 -0.4%
    Median duration (ms) 160.0 159.3 -0.4%
    Mean CV 17.0% 16.1% -5.2%
    Worst duration (ms) 232.5 235.4 +1.3%
    Worst identifier elementPromise stringPromise
getQuickInfoAtPosition
    Mean duration (ms) 158.4 156.3 -1.3%
    Median duration (ms) 156.7 153.8 -1.8%
    Mean CV 16.4% 15.2% -7.7%
    Worst duration (ms) 235.8 225.0 -4.6%
    Worst identifier Key executeAsyncScript

It looks like nothing changed too much. I’m pretty lenient since I’m still an experiment, so take a look anyways and make sure nothing looks out of place.

@mrcrane mrcrane merged commit 32e7c93 into DefinitelyTyped:master Sep 24, 2019
Pull Request Status Board automation moved this from Check and Merge to Done Sep 24, 2019
@typescript-bot
Copy link
Contributor

I just published @types/selenium-webdriver@4.0.3 to npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants