All Projects → bahmutov → local-cypress

bahmutov / local-cypress

Licence: other
Use Cypress without global objects

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to local-cypress

cypress-gh-action-example
Example running Cypress tests inside GitHub Action
Stars: ✭ 29 (+52.63%)
Mutual labels:  cypress, cypress-example
Cypress Example Recipes
Various recipes for testing common scenarios with Cypress
Stars: ✭ 2,485 (+12978.95%)
Mutual labels:  cypress, cypress-example
todo-graphql-example
Example Todo app on top of json-graphql-server
Stars: ✭ 20 (+5.26%)
Mutual labels:  cypress, cypress-example
cypress-example-todomvc-redux
Example TodoMVC application with full code coverage
Stars: ✭ 43 (+126.32%)
Mutual labels:  cypress, cypress-example
nodejs-vuejs-mysql-boilerplate
Node.js (REST API) + Vue.js/Nuxt.js (Frontend/Backend) + MySQL Boilerplate
Stars: ✭ 134 (+605.26%)
Mutual labels:  cypress
Recorder
A browser extension that generates Cypress, Playwright and Puppeteer test scripts from your interactions 🖱 ⌨
Stars: ✭ 277 (+1357.89%)
Mutual labels:  cypress
app
Source code of intencje.pl website and mobile/desktop apps based on Angular, Firebase, and Capacitor.
Stars: ✭ 12 (-36.84%)
Mutual labels:  cypress
webring
“วงแหวนเว็บ” แห่งนี้สร้างขึ้นเพื่อส่งเสริมให้ศิลปิน นักออกแบบ และนักพัฒนาชาวไทย สร้างเว็บไซต์ของตัวเองและแบ่งปันการเข้าชมซึ่งกันและกัน
Stars: ✭ 125 (+557.89%)
Mutual labels:  cypress
cypress-angularjs-unit-test
Unit test Angularjs code using Cypress.io test runner
Stars: ✭ 23 (+21.05%)
Mutual labels:  cypress
cypress-browser-permissions
A Cypress plugin to set launched browser preferences including permissions like Geolocation, Notifications, Microphone, etc.
Stars: ✭ 40 (+110.53%)
Mutual labels:  cypress
instrument-cra
Little module for CRA applications to instrument code without ejecting react-scripts
Stars: ✭ 61 (+221.05%)
Mutual labels:  cypress
svelte-starter-kit
Svelte starter kit — router, state management and testing included.
Stars: ✭ 16 (-15.79%)
Mutual labels:  cypress
cypress-routines
Easily write scalable Node.js setup code for Cypress
Stars: ✭ 43 (+126.32%)
Mutual labels:  cypress
cypress-get-it
Get elements by data attribute by creating a Cy command on the fly
Stars: ✭ 23 (+21.05%)
Mutual labels:  cypress
cypress-watch-and-reload
Reloads Cypress when one of the watched files changes
Stars: ✭ 46 (+142.11%)
Mutual labels:  cypress
Madara
✍️ A way for people to manage their tasks.
Stars: ✭ 17 (-10.53%)
Mutual labels:  cypress
eyes-cypress
Applitools Eyes SDK for cypress.io - This repository is deprecated. It has moved to https://github.com/applitools/eyes.sdk.javascript1/tree/master/packages/eyes-cypress
Stars: ✭ 23 (+21.05%)
Mutual labels:  cypress
angular-workshop
Learning Angular: From component state to NgRx
Stars: ✭ 40 (+110.53%)
Mutual labels:  cypress
vite-primevue-starter
VUE 3 Starter project for using primevue 3 with Vite 2 - Pages, Layouts, Validation
Stars: ✭ 37 (+94.74%)
Mutual labels:  cypress
wargabantuwarga.com
Inisiatif warga untuk berbagi informasi seputar fasilitas kesehatan dan alat kesehatan untuk COVID-19.
Stars: ✭ 533 (+2705.26%)
Mutual labels:  cypress

local-cypress

ci status badges status renovate-app badge cypress version

Use Cypress without global objects, read the blog post

The objects are still attached to the window object during the test, but the types are no longer global, you need to explicitly import them from this package.

WORK IN PROGRESS ⚠️

  • local cy and Cypress object types
  • local expect and assert assertion types
  • local Mocha's describe, it, etc types
  • missing EventEmitter and NodeEventEmitter types
  • uses relative path cy-chai.d.ts

Install

npm install -D local-cypress
# or
yarn add -D local-cypress postinstall-postinstall

Use

In your spec files, instead of using global variables like cy and expect, import them

// cypress/integration/spec.js
import { cy, Cypress, expect, it } from 'local-cypress'

it('works', () => {
  console.log(Cypress.config())
  cy.visit('/')
  expect(1).to.equal(1)
})

Examples

Small print

Author: Gleb Bahmutov <[email protected]> © 2021

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

MIT License

Copyright (c) 2021 Gleb Bahmutov <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].