Giter Club home page Giter Club logo

Comments (27)

yaauie avatar yaauie commented on August 19, 2024 1

If someone submits a pull-request, we will be glad to review it & get the feature merged. Comments with "+1" don't do anything to drive this feature forward since @teampoltergeist/committers doesn't really have the resources to do feature-request-driven development.

from poltergeist.

Bastes avatar Bastes commented on August 19, 2024 1

@michaelglass Waiting for a proper implementation in poltergeist, this is an awesome solution ^^ kudos sir, you've made my and my teammate's day ^^d

from poltergeist.

jonleighton avatar jonleighton commented on August 19, 2024

Poltergeist ignores alerts/confirms by default. If that's not happening it's a bug, but I think it just works. (This is also what capybara-webkit does.)

from poltergeist.

monfresh avatar monfresh commented on August 19, 2024

Is there a way to know whether an alert did appear to begin with? I'm trying to test that user-provided input is sanitized, so that if they change their name to <script>var x = 1;alert(x)</script>, it doesn't run the script. I want to be able to confirm that an alert appeared when the code does not do the sanitization (i.e a failing test). Is that possible?

from poltergeist.

monfresh avatar monfresh commented on August 19, 2024

I ended up using capybara-webkit for this by using page.driver.alert_messages to determine if any alerts are present. Does Poltergeist have an equivalent?

from poltergeist.

route avatar route commented on August 19, 2024

I'll reopen it as a reminder to check it, come back as soon as possible

from poltergeist.

jherdman avatar jherdman commented on August 19, 2024

Any progress on this?

from poltergeist.

route avatar route commented on August 19, 2024

I didn't have time to look into this yet, if anyone has please go ahead

from poltergeist.

sirvine avatar sirvine commented on August 19, 2024

It would also be nice to have the ability to send keyboard input to JS prompt dialogs (and get their text content), as per Selenium's Alert class: https://github.com/vertis/selenium-webdriver/blob/8f4aefa604e76b24085c91f70f97a093e40a08d6/lib/selenium/webdriver/common/alert.rb

from poltergeist.

mkarklins avatar mkarklins commented on August 19, 2024

Would be nice if Poltergeist implemented something similar to page.driver.alert_messages

from poltergeist.

michaelglass avatar michaelglass commented on August 19, 2024

here's what I've been doing in my tests

kind of janky but it works.

I don't know if I wrote this or stole it.

https://gist.github.com/michaelglass/8610317

from poltergeist.

gamov avatar gamov commented on August 19, 2024

👍

from poltergeist.

vizcay avatar vizcay commented on August 19, 2024

+1 This will be really useful!

from poltergeist.

thedelchop avatar thedelchop commented on August 19, 2024

Next week I am on vacation and will try to see if we can implement this since it seems to be getting a lot of interest.

from poltergeist.

rickmzp avatar rickmzp commented on August 19, 2024

+1

from poltergeist.

mgmorcos avatar mgmorcos commented on August 19, 2024

+1

from poltergeist.

tsgautier avatar tsgautier commented on August 19, 2024

+1

from poltergeist.

paulcruz avatar paulcruz commented on August 19, 2024

+1

from poltergeist.

lubert avatar lubert commented on August 19, 2024

+1

from poltergeist.

marnen avatar marnen commented on August 19, 2024

@michaelglass Thank you. That looks like it will work for me for now, though I wish this were in Poltergeist for real.

from poltergeist.

michaelglass avatar michaelglass commented on August 19, 2024

@marnen yer welcome! super janky but such is life.

from poltergeist.

mjgiarlo avatar mjgiarlo commented on August 19, 2024

@michaelglass Paraphrasing Rumsfeld re: janky code:

As you know, you go to production with the code you have, not the code you might want or wish to have at a later time.

🍻

from poltergeist.

serioushaircut avatar serioushaircut commented on August 19, 2024

I'd (still) love to see that generically in poltergeist

from poltergeist.

route avatar route commented on August 19, 2024

I think @gongo is doing great job for all of us #516

from poltergeist.

badosu avatar badosu commented on August 19, 2024

@michaelglass solution works very well until a proper fix is pushed.

This should be referenced somewhere as it would have saved a lot of time for me.

from poltergeist.

twalpole avatar twalpole commented on August 19, 2024

@Bastes Poltergeist has had support for Capybaras modal api since September 2015 - you shouldn't need to be including anything else. If it's not working for you please open a new issue with details.
http://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FSession%3Aaccept_alert

from poltergeist.

Bastes avatar Bastes commented on August 19, 2024

@twalpole Indeed it works ^^ could benefit from a little publicity too imo, I'll see if I can send a pull request with a little something in the readme. Thanks ^^d

from poltergeist.

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.