New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to disable test files preprocessing. #533

Closed
kamituel opened this Issue Jun 9, 2017 · 8 comments

Comments

5 participants
@kamituel

kamituel commented Jun 9, 2017

  • Operating System: Mac
  • Cypress Version: 0.19.2
  • Browser/Browser Version: Chrome 58

Are you requesting a feature or reporting a bug?

Feature.

Current behavior:

Cypress preprocesses test JavaScript files (using Babel / Browserify). I'd like to use ClojureScript to write tests, which means using a compiler (based on Google Closure) to obtain a final test JS file. However, Google Closure produces JS files that expect this to be set when invoked outside of a function (in the global context). Current Cypress' preprocessing makes this undefined, which breaks code compiled using Google Closure. I don't know of any obvious workaround for this.

Expected behavior:

To be able to disable test JS files preprocessing, so that I can use ClojureScript / Google Closure compiler.

How to reproduce the current behavior:

  1. Create a ClojureScript test namespace:
(ns st.general)

(js/describe "General" (fn []
  (js/it "Page title" (fn []
    (js/cy.visit "http://localhost:80")
    (.should (js/cy.title) "equal" "Page Title")))))
  1. Compile it using ClojureScript compiler to cypress/integration/test.js

  2. Run this test using Cypress. It will hang for a long time, and eventually produce an error that can be tracked down to this being unset.

Test code:

n/a

Additional Info (images, notes, stack traces, etc)

This has been briefly discussed on Gitter on June 9th around 1:30 PM UTC.

@vemv

This comment has been minimized.

Show comment
Hide comment
@vemv

vemv Aug 25, 2017

Any plan on making this possible?

ClojureScript has a mature (6+ years), large, enthusiastic community without a lot of robust available options in the integration-testing space.

cypress could fill that gap!

@kamituel , could you get this to work?

vemv commented Aug 25, 2017

Any plan on making this possible?

ClojureScript has a mature (6+ years), large, enthusiastic community without a lot of robust available options in the integration-testing space.

cypress could fill that gap!

@kamituel , could you get this to work?

@kamituel

This comment has been minimized.

Show comment
Hide comment
@kamituel

kamituel Aug 25, 2017

without a lot of robust available options in the integration-testing space

selenium-java :)

@kamituel , could you get this to work?

Nope. For now I settled on using JavaScript basically. However, I'm using Cypress to test a proof-of-concept project we're working on. If we were to start using Cypress for our main web app, ClojureScript support would be necessary.

I discussed it briefly with Cypress' team on Gitter a while back and they weren't opposed to this idea. It's probably just not high on a priority list.

Having that said, Cypress 1.0.0 which is likely just around the corner, will be open source, and then we'll be able to tackle this ourselves.

kamituel commented Aug 25, 2017

without a lot of robust available options in the integration-testing space

selenium-java :)

@kamituel , could you get this to work?

Nope. For now I settled on using JavaScript basically. However, I'm using Cypress to test a proof-of-concept project we're working on. If we were to start using Cypress for our main web app, ClojureScript support would be necessary.

I discussed it briefly with Cypress' team on Gitter a while back and they weren't opposed to this idea. It's probably just not high on a priority list.

Having that said, Cypress 1.0.0 which is likely just around the corner, will be open source, and then we'll be able to tackle this ourselves.

@chrisbreiding

This comment has been minimized.

Show comment
Hide comment
@chrisbreiding

chrisbreiding Aug 25, 2017

Collaborator

We're currently working on a generic plugin system for preprocessing spec files that will solve this issue. You'll be able to create a plugin that integrates with the Cypress preprocessing pipeline. It will allow you to disable the default preprocessing, or you could create a ClojureScript preprocessor that transpiles your ClojureScript tests and lets the app know to re-run.

This should be released within the next month or so. If it doesn't make it into 1.0.0, it will be in 1.1.0.

Collaborator

chrisbreiding commented Aug 25, 2017

We're currently working on a generic plugin system for preprocessing spec files that will solve this issue. You'll be able to create a plugin that integrates with the Cypress preprocessing pipeline. It will allow you to disable the default preprocessing, or you could create a ClojureScript preprocessor that transpiles your ClojureScript tests and lets the app know to re-run.

This should be released within the next month or so. If it doesn't make it into 1.0.0, it will be in 1.1.0.

@vemv

This comment has been minimized.

Show comment
Hide comment
@vemv

vemv Aug 25, 2017

Sounding awesome!

Good luck with the development and release of Cypress!

Cheers - Victor

vemv commented Aug 25, 2017

Sounding awesome!

Good luck with the development and release of Cypress!

Cheers - Victor

@kamituel

This comment has been minimized.

Show comment
Hide comment
@kamituel

kamituel Aug 25, 2017

@chrisbreiding
Thanks, that sounds great.

kamituel commented Aug 25, 2017

@chrisbreiding
Thanks, that sounds great.

@kamituel kamituel closed this Aug 25, 2017

@kamituel kamituel reopened this Aug 25, 2017

@brian-mann brian-mann added this to the 1.1.0 milestone Nov 20, 2017

@brian-mann

This comment has been minimized.

Show comment
Hide comment
@brian-mann

brian-mann Nov 20, 2017

Member

Fixed by #888.

Member

brian-mann commented Nov 20, 2017

Fixed by #888.

@brian-mann brian-mann closed this Nov 20, 2017

@brian-mann

This comment has been minimized.

Show comment
Hide comment
@brian-mann

brian-mann Nov 20, 2017

Member

Fixed in 1.1.0.

Member

brian-mann commented Nov 20, 2017

Fixed in 1.1.0.

@chrisbreiding

This comment has been minimized.

Show comment
Hide comment
@chrisbreiding

chrisbreiding Nov 20, 2017

Collaborator

With the plugins API now released, you can create a ClojureScript preprocessor or you can essentially disable preprocessing by using the watch preprocessor.

Collaborator

chrisbreiding commented Nov 20, 2017

With the plugins API now released, you can create a ClojureScript preprocessor or you can essentially disable preprocessing by using the watch preprocessor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment