Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
cypress-v10-preserve-cookie
Advanced tools
Cypress.Cookies.preserveOnce for Cypress v10
# if using NPM
$ npm i -D cypress-v10-preserve-cookie
# if using Yarn
$ yarn add -D cypress-v10-preserve-cookie
Import this module from your spec file or from your support file
import 'cypress-v10-preserve-cookie'
This module adds a custom command cy.preserveCookieOnce
// login sets the cookie like "connect.session" for example
before(loginSomehow)
beforeEach(() => {
// equivalent to cy.preserveCookieOnce('connect.session')
cy.preserveCookieOnce('connect.session')
})
it('is logged in', () => {
...
})
it('is still logged in', () => {
...
})
You can pass multiple cookie names
cy.preserveCookieOnce(
'connect.session',
'refresh_token',
'access_token',
)
// equivalent to
cy.preserveCookieOnce('connect.session')
cy.preserveCookieOnce('refresh_token')
cy.preserveCookieOnce('access_token')
Included in src/index.d.ts
This module uses debug module to output verbose browser console messages when needed. To turn the logging on, open the browser's DevTools console and set the local storage entry:
localStorage.debug = 'cypress-v10-preserve-cookie'
If you re-run the tests, you should see the messages appear in the console.
If you need more control over storing/restoring cookies/users/any other data, check out my plugin cypress-data-session.
Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2022
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
FAQs
Cypress.Cookies.preserveOnce for Cypress v10
We found that cypress-v10-preserve-cookie 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.