Giter Site home page Giter Site logo

Comments (7)

vitalis avatar vitalis commented on June 26, 2024

@bigardone we are currently using hound + phantomjs 2.1.1 in our project and we have no issues with forms in react, I suggest you give it another try. I also suggest to run the phantomjs with log level debug and watch for javascript errors.

from hound.

bigardone avatar bigardone commented on June 26, 2024

Hey @vitalis thanks for your response. I'll give it another try today and share here the results :)

from hound.

bigardone avatar bigardone commented on June 26, 2024

Hi @vitalis now it's almost working, but there's something going wrong though.
The tests passes but I get the following output:

✗ mix test test/integration/sign_in_test.exs:5
Including tags: [line: "5"]
Excluding tags: [:test]

11:15:10.429 [error] #PID<0.434.0> running Phoenix.Transports.WebSocket terminated
Server: localhost:4001 (http)
Request: GET /socket/websocket?token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJVc2VyOjIxIiwiZXhwIjoxNDU4Mjk2MDI0LCJpYXQiOjE0NTgwMzY4MjQsImlzcyI6IkthaXJvcyIsImp0aSI6IjFiNWNjNDUxLWRlNDQtNDQxMS05MTcyLWI0MGFhYzgzZWQwZiIsInBlbSI6e30sInN1YiI6IlVzZXI6MjEiLCJ0eXAiOiJ0b2tlbiJ9.yccEo7fGUAr-U7PpWpIR-moPF1rEnvCNXZU1MXAlTY3qEX3a9rQemPz5IP2coiR7J1YhWAHvfPYymnCDHDvSXw&vsn=1.0.0
** (exit) an exception was raised:
    ** (UndefinedFunctionError) undefined function nil.id/0
        nil.id()
        (kairos) Kairos.UserSocket.id/1
        (phoenix) lib/phoenix/socket/transport.ex:154: Phoenix.Socket.Transport.connect_vsn/6
        (phoenix) lib/phoenix/transports/websocket.ex:73: Phoenix.Transports.WebSocket.init/2
        (phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:12: Phoenix.Endpoint.CowboyWebSocket.init/3
        (cowboy) src/cowboy_handler.erl:64: :cowboy_handler.handler_init/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
.

Finished in 1.2 seconds (0.2s on load, 0.9s on tests)
3 tests, 0 failures, 2 skipped

That line in the UserSocket module looks like this:

def id(socket), do: "users_socket:#{socket.assigns.current_user.id}"

The thing is that this error doesn't happens while using ChromeDriver or while navigating through the application... is there anything else I must configure in order to use phantomjs that I might have missed?

Thanks in advance :)

from hound.

vitalis avatar vitalis commented on June 26, 2024

@bigardone
I think it's session related issue, phantomjs uses same cookie jar for all sessions:
https://github.com/HashNuke/hound#phantomjs-caveats
you can try to use Hound.Helpers.Cookie.delete_cookies() to clear previous session data

from hound.

bigardone avatar bigardone commented on June 26, 2024

Thanks for the response. I thought it was something related to that and I added the call to delete_cookies() at the end of the test but the result is still the same though :(

from hound.

danhper avatar danhper commented on June 26, 2024

Hi @bigardone,
Are you still having some troubles? If you still are, if would be great if you could provide us a minimal example to reproduce the issue so that we can help you better.
Thank you!

from hound.

darksheik avatar darksheik commented on June 26, 2024

Sorry for my removed comment - I didn't read the whole thread.

from hound.

Related Issues (20)

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.