Cypress Testing Tips & Tricks

Share this post

Cypress.R(amda)

cypresstips.substack.com

Cypress.R(amda)

Advent day 1: How to load any library and make it available in all specs

Gleb Bahmutov
Dec 1, 2021
4
Share

Do you like the bundled libraries in Cypress global object, like Cypress._, Cypress.Promise, Cypress.$, etc? Are you missing Cypress.moment that was removed? This short video teaches you how to load Ramda library (my fav) and make it available in every spec under the Cypress.R property.

(TL;DR)

// cypress/support/index.js
import * as R from ‘ramda’
Cypress.R = R
// from any spec file use Cypress.R.* functions
4
Share
Comments
Top
New
Community

No posts

Ready for more?

© 2023 Gleb Bahmutov
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing