Socket
Socket
Sign inDemoInstall

@commercetools-frontend/cypress-cookie-consent

Package Overview
Dependencies
4
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @commercetools-frontend/cypress-cookie-consent

Cypress package to set a cookie consent cookie


Version published
Weekly downloads
2.5K
increased by220.69%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

This package allows to set a cookie consent cookie using the @commercetools-frontend/cypress-cookie-consent package.

Installation

$ npm install --save @commercetools-frontend/cypress-cookie-consent

Usage

You need to extend your Cypress commands. You might have an e2e.ts file containing your library and custom commands. If so add this to it:

import '@commercetools-frontend/cypress-cookie-consent/add-commands';

This will register a setConsentCookie on Cypress which you can invoke as cy.setConsentCookie. It accepts an argument called commandOptions which has a property named consentGroups. The consent groups are the groups you want to give consent for, for your Cypress test. So in summary you may call it as:

cy.setConsentCookie({
  consentGroups: {
    essentialCookies: true,
    performanceCookies: true,
    functionalCookies: true,
    targetingCookies: true,
    socialMediaCookies: true,
  },
});

FAQs

Last updated on 15 Apr 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc