Code Monkey home page Code Monkey logo

Comments (5)

route avatar route commented on May 13, 2024

I see a few issues here:

  1. If one batch of parallel testing exits earlier than the rest I think it will trigger quit on the driver which in turn kill browser because it won't be aware of the rest batches. This will mess up the rest of the tests. If it won't kill the browser after ruby exits the browser would be left in memory which is not good too.

  2. The protocol supports multi-client debugging for tabs but in order to manipulate the browser itself users have to connect to a dedicated url which is generated when browser starts, chrome spits it to stdout for example DevTools listening on ws://127.0.0.1:31337/devtools/browser/93806b13-fce0-43c0-bd46-23922bb7c592 with this url and protocol we can create pages and manipulate them. There are also websockets for each page. We can connect to http://127.0.0.1:31337/json but it only shows urls for pages for example ws://127.0.0.1:31337/devtools/page/FAB21C8A5AE08589AD81B13BCB7CB460 not the browser url.
    So even if host and port are static we still have to somehow start a few capybara sessions parse address from one of them save it somewhere (filesystem?) so the others could read it and connect to the same browser.

With all that +1s on start seems not that bad to me :)

from cuprite.

route avatar route commented on May 13, 2024

@ianks I'm gonna close it for now, feel free to share your thoughts with us if I'm wrong I might have missed something.

from cuprite.

ianks avatar ianks commented on May 13, 2024

@route Sorry for the delay, busy week. Thanks for taking the time to respond in detail 😄

I see a few issues here:

  1. If one batch of parallel testing exits earlier than the rest I think it will trigger quit on the driver which in turn kill browser because it won't be aware of the rest batches. This will mess up the rest of the tests. If it won't kill the browser after ruby exits the browser would be left in memory which is not good too.

Yes you are right. However, in this case the leader node should be responsible for maintaining the browse state, rather than each individual test worker. I would require some decoupling of Browser <-> Process (https://github.com/machinio/cuprite/blob/master/lib/capybara/cuprite/browser.rb#L246) but I think it's doable.

  1. The protocol supports multi-client debugging for tabs but in order to manipulate the browser itself users have to connect to a dedicated url which is generated when browser starts, chrome spits it to stdout for example DevTools listening on ws://127.0.0.1:31337/devtools/browser/93806b13-fce0-43c0-bd46-23922bb7c592 with this url and protocol we can create pages and manipulate them. There are also websockets for each page. We can connect to http://127.0.0.1:31337/json but it only shows urls for pages for example ws://127.0.0.1:31337/devtools/page/FAB21C8A5AE08589AD81B13BCB7CB460 not the browser url.
    So even if host and port are static we still have to somehow start a few capybara sessions parse address from one of them save it somewhere (filesystem?) so the others could read it and connect to the same browser.

Yes, good point. I think the leader<->worker architecture could solve this as well, since it could manage and provide the necessary connection details to the workers.

Thoughts?

from cuprite.

route avatar route commented on May 13, 2024

Sounds good with this architecture, do you want to take a stab?

from cuprite.

sebyx07 avatar sebyx07 commented on May 13, 2024

Check #92

from cuprite.

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.