Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@dollarshaveclub/e2e
Advanced tools
A end-to-end test runner currently built for:
This test runner mitigates test flakiness and maximizes test speed:
await
s hang, which is the correct way to write Selenium testsIt also has features to make writing and running tests easier:
selenium
or puppeteer
driver so you don't have toSee our example tests.
Install Selenium:
brew tap homebrew/cask
brew cask install chromedriver
brew install selenium-server-standalone geckodriver
Start the Selenium server:
brew services start selenium-server-standalone
Install node@8+:
nvm install 8
Install this package:
npm install @dollarshaveclub/e2e
Run the executable:
./node_modules/.bin/dsc-e2e -h
You can define multiple clients
and multiple parameters
per test.
If you have 5 clients and 5 parameters, your tests will run 5x5 = 25 times.
Keep this in mind as you add clients
and parameters
.
Options for running the test.
Options are:
stepTimeout='30s'
- the default timeout for each step
stepSlowThreshold='5s'
- after this threshold is met for each step
, the color of the step is yellow
retries=1
- number of times to retry a testretryWithSauceLabs=true
- whether to retry failing tests on Sauce Labs when ran with Sauce Labs enabledclients=[]
- an array of clients to test with.
browser='chrome'
width=1280
height=960
platform={}
- the platform to run on, specifically on Sauce Labs
width=1280
height=960
driver='selenium'
- which driver to use.
selenium
, puppeteer
Various parameters to run your test.
Passed to your .test
function and is intended to be used within it.
If your parameters is an array, your test will run for each value in the array.
Define your actual test in this function.
step
- define your tests in step
sparameters
- the parameters defined for your test via exports.parameters
driver
- the Selenium SDK driver instancebrowser
- Puppeteer browser instancepage
- a Puppeteer page instanceA step in your test. Think of this as a test()
or it()
from mocha
or jest
.
As this runner is designed for end-to-end tests, calling each code block step
s
makes more sense than calling it test()
or it()
.
Unlike other frameworks, there is no nesting of step()
s.
For example, if are testing the end-to-end flow of a conversion funnel,
each action a user takes would be a step
.
Practically, however, you should write each await
within its own step
.
The reason is many await
s wait for a condition to occur, and the only way
to test that it does not occur is to timeout.
Thus, the options for each step
are:
timeout
- the timeout for this stepslowThreshold
- when this step is considered slowSame as step()
, but is not actually ran.
Description of your test.
FAQs
Make End-to-End Testing Great for Once
The npm package @dollarshaveclub/e2e receives a total of 19 weekly downloads. As such, @dollarshaveclub/e2e popularity was classified as not popular.
We found that @dollarshaveclub/e2e demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 24 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.