
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@synthetixio/synpress
Advanced tools
Synpress in an wrapper around Cypress test runner which extends its capabilities with conjunction of Puppeteer. It's used used across Synthetix projects.
Synpress is an wrapper around Cypress.io with metamask support thanks to puppeteer.
Synpress doesn't seem to communicate with metamask properly if "chromeWebSecurity": false
flag is set. More about it here.
Tests work only in headed mode because extensions are not supported in headless mode in puppeteer and Cypress. It's intended to be used in conjunction with xvfb
on CI.
Synpress downloads latest version of metamask before tests run and loads it automatically to the browser.
There is a global before()
which runs metamask setup before all tests:
rinkeby
)It requires environmental variable called SECRET_WORDS
to be present in following format => 'word1, word2, etc..'
.
If you want to customize it, instead of using environmental variable, you can modify setupMetamask()
to following:
setupMetamask(secretWords, network, password)
, for example: setupMetamask('word1, word2, etc..', 'mainnet', 'password')
.
Project structure:
project_dir
└── src
└── tests
└── e2e
└── .eslintrc.js
└── tsconfig.json
└── specs
└── example-spec.js
└── pages
└── example-page.js
.eslintrc.js
inside your tests folder (/project_dir/tests/e2e
):const path = require('path');
const synpressPath = path.join(process.cwd(), '/node_modules/@synthetixio/synpress');
module.exports = {
extends: `${synpressPath}/.eslintrc.js`,
};
tsconfig.json
inside your tests folder (/project_dir/tests/e2e
):{
"compilerOptions": {
"allowJs": true,
"baseUrl": "../../node_modules",
"types": ["cypress", "@types/puppeteer-core", "@synthetixio/synpress/support", "cypress-wait-until", "@testing-library/cypress"],
"outDir": "./output"
},
"include": ["**/*.*"]
}
Feel free to take a look at kwenta repository for setup example.
synpress run
to run testssynpress open
to open Cypress UITake a look here for additional custom commands and their examples.
Command line interface (synpress help
):
Usage: synpress run [options]
launch tests
Options:
-b, --browser <name> run on specified browser (default: "chrome")
-c, --config <config> set configuration values, separate multiple values with a comma
-cf, --configFile <path> specify a path to a JSON file where configuration values are set
-e, --env <env=val> set environment variables, separate multiple values with comma
-s, --spec <path or glob> run only provided spec files
-ne, --noExit keep runner open after tests finish
-pr, --project <path> run with specific project path
-q, --quiet only test runner output in console
-r, --reporter <reporter> specify mocha reporter
-ro, --reporterOptions <options> specify mocha reporter options, separate multiple values with comma
-r, --record [dashboard] record video of tests running after setting up your project to record
-k, --key <key> [dashboard] set record key
-p, --parallel [dashboard] run recorded specs in parallel across multiple machines
-g, --group <name> [dashboard] group recorded tests together under a single run
-t, --tag <name> [dashboard] add tags to dashboard for test run
-h, --help display help for command
Usage: synpress open [options]
launch test runner UI
Options:
-cf, --configFile <path> specify a path to a JSON file where configuration values are set
-h, --help display help for command
dev
branch to master
branchmaster
branch and pull latest changesnpm run release:patch/minor/major
commanddev
branch up to date with master
Above actions will lead to:
FAQs
[](https://badge.fury.io/js/%40synthetixio%2Fsynpress) [![Discord](https://img.shields.io/discord/1103781993394733136.svg?color=768AD4&label=discord&logo=https%3A%2F%2Fdiscordapp.com%2F
The npm package @synthetixio/synpress receives a total of 11,204 weekly downloads. As such, @synthetixio/synpress popularity was classified as popular.
We found that @synthetixio/synpress demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.