phanq003 left a comment (openstreetmap/openstreetmap-website#7076)

With tests, originally tried to test the `beforeunload` popup directly using 
`dismiss_confirm`  (see commit 
[05fc44b](https://github.com/openstreetmap/openstreetmap-website/pull/7076/commits/05fc44b8a5c867d2e088a94acf579296750916ed)),
 but according to 
[https://makandracards.com/makandra/622849-allow-testing-beforeunload-confirmation-dialogs-modern](https://makandracards.com/makandra/622849-allow-testing-beforeunload-confirmation-dialogs-modern)
 ChromeDriver 127+ automatically closes the dialogs. This is causing 
`Capybara::ModalNotFound: Unable to find modal dialog`.

Attempted to work around this adapting the solution from the mentioned 
reference, but then would get 
`Selenium::WebDriver::Error::SessionNotCreatedError: session not created: 
Chrome instance exited`.

As a workaround I've used a DOM attribute to keep track of when the listener is 
attached to be able to test that its there.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7076#issuecomment-4421048988
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/7076/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to