1.0.22 • Published 1 year ago

cypress-url-parameters v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Purpose

This project came about as essentially a fix to an issue I've been having on work projects. Cypress tests that are scattered across multiple test files all making calls to visit to navigate needed a way to easily add something like ?environment=test

This package aims to fix that problem, by overwriting the visit command and appending each parameter added to a Cypress env variable onto the end of the url prior to Cypress navigating.

Usage

To add a parameter, use cy.setParameter. All subsequent visit calls will honor the query parameter.

import 'cypress-url-parameters'

cy.setParameter('token', 'XXXXX')
cy.visit('https://example.cypress.io/');

If you need to update a parameter, simple use setParameter with the same parameter name and your new value.

To remove a parameter, use removeParameter

import 'cypress-url-parameters'

cy.setParameter('token', 'XXXXX');
cy.visit('https://example.cypress.io/');

cy.removeParameter('token');
cy.visit('https://example.cypress.io/');
1.0.22

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago