Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Integrate Cypress with alternative cloud services like Sorry Cypress or Currents
Currents.dev - is a hosted cloud service used to run millions of Cypress tests without breaking the bank. This is an enhanced version of Sorry Cypress with better security, performance, analytics, integrations and support.
Sorry Cypress - is an open-source, free alternative to Cypress Cloud that unlocks unlimited parallelization, test recordings, and integration with GitHub, Slack and more.
cy2
integrates cypress with alternative orchestration services like Sorry Cypress or Currents.
March 2023 Update
⭐️ Cypress 12.6.0+ users, please use https://github.com/currents-dev/cypress-cloud if you are seeing Cypress does not support recording test results to this third party service
error ⭐️
npm install cy2
Set the environment variable CYPRESS_API_URL
and run cy2
. The command passes down all the CLI flags to cypress runner as-is.
# use `http://localhost:1234` as orchestration cloud service
CYPRESS_API_URL="http://localhost:1234/" cy2 run --parallel --record --key somekey --ci-build-id hello-cypress
Example usage with sorry-cypress. The URL should point to director
service.
CYPRESS_API_URL="https://sorry-cypress-demo-director.herokuapp.com" cy2 run --parallel --record --key somekey --ci-build-id hello-cypress
run
Run Cypress via its Module API
run(apiUrl: string, config: CypressCommandLine.CypressRunOptions): Promise<CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult>
Example:
import { run } from 'cy2';
const results = await run('https://sorry-cypress.company.net', {
reporter: 'junit',
browser: 'chrome',
config: {
baseUrl: 'http://localhost:8080',
video: true,
},
});
spawn
Spawn Cypress as a child process and inherit all the flags and environment variables. It invokes process.exit
with the child process' exit code.
spawn(apiUrl: string): Promise<void>
Example:
import { spawn } from 'cy2';
await spawn(process.env.CYPRESS_API_URL);
patch
method was deprecated. Use run
instead.run
and patch
rely on process.env.CYPRESS_API_URL
instead of accepting an argument. That's because of a new patching method that doesn't permanently change cypress configuration after invoking cy2
.patch
[deprecated in 4+]Deprecated due to the changes in cypress introduced in version 12+.
Change cypress configuration without running it.
patch(cypressPackageEntryPath: string) => Promise<void>
⚠️ Make sure to set process.env.CYPRESS_API_URL
before invoking patch
Example:
import { patch } from 'cy2';
import cypress from 'cypress';
process.env.CYPRESS_API_URL = 'https://dashboard.service.url';
async function main() {
// optional - provide cypress package main entry point location
await patch(require.resolve('cypress'));
cypress
.run({
// the path is relative to the current working directory
spec: './cypress/e2e/examples/actions.cy.js',
})
.then((results) => {
console.log(results);
})
.catch((err) => {
console.error(err);
});
}
main().catch((error) => {
console.error(error);
process.exit(1);
});
FAQs
Integrate Cypress with alternative cloud services like Sorry Cypress or Currents
The npm package cy2 receives a total of 118,913 weekly downloads. As such, cy2 popularity was classified as popular.
We found that cy2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.