cypress-io / cypress-fiddle

Quickly generates Cypress tests from HTML and JS code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReferenceError: `Cypress` is not defined

TheJoeSchr opened this issue · comments

Trying to start this via codesandbox (to fiddle around) I get this error right out the gate:

ReferenceError
Cypress is not defined
evaluate
/src/index.js:7
   4 | const { createMarkdown } = require('safe-marked')
   5 | const markdown = createMarkdown()
   6 | 
>  7 | Cypress.Commands.add('runExample', options => {
   8 |   const { name, description, html, test } = options
   9 |   const testTitle = name || cy.state('runnable').title
  10 | 
View compiled

Link for reproduction: https://codesandbox.io/s/github/cypress-io/cypress-fiddle

The code examples are meant to run only inside Cypress test runner https://github.com/cypress-io/cypress and cannot be executed from a website.

Ah, gotcha, thx!

are you open for a PR that has a docker-compose service with cypress already installed?

Hi @JoeSchr,

Any lead on this issue, did you find a workaround? I'm new to Cypress. I faced the same issue when I imported a react project with testing implemented in Cypress to CodeSandbox, it was working all fine locally; however, on import to CodeSendbox, I was unable to run my tests.

I have read the complete thread and understood the reason behind this behavior, but still, I want to know if you found out any working hack to this issue.

@Iiqra sadly no

My "workaround" was to get a free trial at one of the Dev cloud providers like linode or Digitalocean . There you have more control over your environment and can either install a minimal X11 Server or pass $Display along to your local machine via ssh