GithubHelp home page GithubHelp logo

grantspeelman / cypress-on-rails Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shakacode/cypress-on-rails

39.0 39.0 7.0 219 KB

Use cypress.io with your rails and rack application

Ruby 49.56% HTML 10.39% JavaScript 37.03% CSS 1.14% Shell 1.88%
cypress rack-middleware ruby-on-rails testing

cypress-on-rails's People

Contributors

andrewborstein avatar darioghilardi avatar derfred avatar grantspeelman avatar jankeesvw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cypress-on-rails's Issues

Factories with traits not working

I am having issues using traits:

cy.appFactories([
  ['create', 'order', 'trial']
])

outputs: app error: Trait not registered: trial in the rails stdout/stderr and log/test.log

I noticed you added specs for trait, but with a mock factory. I'll attempt to recreate the issue within the gem specs.

My setup:

# ruby -v
ruby 2.4.5p335
# rails -v
Rails 5.2.2
# bundle info cypress-on-rails
  * cypress-on-rails (1.3.0)
        Summary: Integrates cypress with rails or rack applications
        Homepage: http://github.com/grantspeelman/cypress-on-rails
        Path: /var/lib/gems/2.4.0/gems/cypress-on-rails-1.3.0

Problem on travis.ci

Hello,

I have 3 simple tests working well on my local machine.
I try to run the tests on travis.ci, but I have a 500 error as reponse from the middleware for the clean command... The server logs are pretty empty, I only have one line for the POST on /cypress/command

I'm stuck, maybe somebody can help me at least to have a little bit more logs

Thanks in advance,

Gil

Using allow_any_instance_of in a scenario

Hello,

From what I understood of the original project, rspec mocking commands should be supported. I have tried to use allow_any_instance_of(Class).to receive(:check).and_return([]) as the only command in the basic scenario file (of the provided examples). However, my Rails returns an error when I try to execute this. Do you have any clue how I can get this to work?

Text from the original project:

In the scenario you also have access to RSpec mocking functions. So you could do something like:

scenario :basic do
  allow(ExternalService).to receive(:retrieve).and_return("result")
end

Thanks a lot!

Update:
By adding the following code, I managed to get it to work! However, I am curious if there's a better way. Also, is there a way to clean up my spec changes for when I don't want to mock anymore? Any idea's?

require 'rspec/rails'
RSpec::Mocks.teardown
RSpec::Mocks.setup
extend RSpec::Mocks::ExampleMethods
allow_any_instance_of(Class).to receive(:check).and_return([])

Trigger test run from server

Hello there,
When I change HTML view on my server I would like to tell Cypress to trigger test run. Is there any API that I can use to call and run specific test file?

For example watch server files with Guard and trigger this call.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.