
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
blocking-proxy
Advanced tools
WebDriver Proxy for testing rich clients. It block certain calls until Angular is done updating the page under test.
Blocking Proxy is a tool for adding functionality to WebDriver-based tests. It sits between your tests and the Selenium Server. For each WebDriver command, it runs a set of 'barriers' that will block forwarding the command to the Selenium server until some condition is met.
Because it interacts with WebDriver at the network level, Blocking Proxy can be used regardless of which language your tests are written in. See the example for a demonstration of using Blocking Proxy with WebDriver tests written in Python.
Although Blocking Proxy can handle multiple WebDriver sessions, it can not yet handle multiple concurrent clients. Thus, it's recommended to start a separate instance for each test process.
Blocking Proxy can be installed globally with npm install -g blocking-proxy
.
You can also use it by cloning this repo and running these commands:
npm install
webdriver-manager update && webdriver-manager start (in another terminal)
node ./built/lib/bin.js --seleniumAddress http://localhost:4444/wd/hub
When testing an Angular application, Blocking Proxy can block webdriver commands until Angular's change detection is finished, and thus make your tests less flaky.
If --highlightDelay <delayMS>
is specified, Blocking Proxy will wait for
the specified delay (in milliseconds) before executing click commands or sending
keys. It will also highlight the element that is the target of the command.
Here's an example of highlight delay in action:
When --logDir <path>
is set, Blocking Proxy will create a readable log of
WebDriver commands at the specified path. The log will look something like this:
20:08:14.830 | 834ms | 37f13c | NewSession
{"browserName":"chrome"}
20:08:15.674 | 4ms | 37f13c | SetTimeouts
20:08:15.681 | 578ms | 37f13c | Go http://localhost:8081/ng1/#/interaction
20:08:16.300 | 438ms | 37f13c | FindElement
Using css selector \'.invalid\'
ERROR: no such element
Each line shows the command that was executed and how long it took. For some commands, extra data or the response from WebDriver will be shown on following lines.
gulp format
runs clang-format. gulp lint
validates format and runs tslint.
Unit tests live in spec/unit
and can be run with npm test
. Run npm run test:auto
to automatically watch for changes and run unit tests.
Start webdriver
webdriver-manager update
webdriver-manager start
in another terminal, start the testapp
npm run testapp
Start the proxy with
npm start
in yet another terminal, run the tests
npm run test:e2e
FAQs
WebDriver Proxy for testing rich clients. It block certain calls until Angular is done updating the page under test.
The npm package blocking-proxy receives a total of 0 weekly downloads. As such, blocking-proxy popularity was classified as not popular.
We found that blocking-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.