Comments (27)
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.
@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.
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.
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.
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.
I'll reopen it as a reminder to check it, come back as soon as possible
from poltergeist.
Any progress on this?
from poltergeist.
I didn't have time to look into this yet, if anyone has please go ahead
from poltergeist.
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.
Would be nice if Poltergeist implemented something similar to page.driver.alert_messages
from poltergeist.
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.
👍
from poltergeist.
+1 This will be really useful!
from poltergeist.
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.
+1
from poltergeist.
+1
from poltergeist.
+1
from poltergeist.
+1
from poltergeist.
+1
from poltergeist.
@michaelglass Thank you. That looks like it will work for me for now, though I wish this were in Poltergeist for real.
from poltergeist.
@marnen yer welcome! super janky but such is life.
from poltergeist.
@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.
I'd (still) love to see that generically in poltergeist
from poltergeist.
I think @gongo is doing great job for all of us #516
from poltergeist.
@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.
@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.
@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)
- React event not triggered [help] HOT 2
- Capybara::Poltergeist::TimeoutError in some environments HOT 23
- ReferenceError: Can't find variable: Audio HOT 1
- React components not loading HOT 1
- Following jQuery line of code does not work in anything above v1.8.1 HOT 8
- Typo in keys method HOT 1
- Version of JS supported HOT 1
- Broken rails UJS loading when use arrow functions HOT 1
- Timeout occurs causing all following javascript tests to fail. HOT 3
- Capybara::Poltergeist::StatusFailError on 302 redirects with port numbers HOT 2
- Future of Poltergeist HOT 14
- Screenshot is not created HOT 1
- Authz request header missing HOT 5
- User agent does not persist across windows HOT 3
- Capybara::Poltergeist::TimeoutError when running CI tests HOT 7
- current_url returns empty string on about:blank HOT 3
- page.current_path always root HOT 2
- Possible make a method that check if JS Alert exist
- TypeError When dealing with link clicks via Capybara::Session HOT 2
- Capybara::Poltergeist::StatusFailError: failed to reach server (but manually I can connect perfectly) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poltergeist.