|
207 | 207 | end
|
208 | 208 | end
|
209 | 209 |
|
210 |
| - describe "alerts" do |
211 |
| - not_compliant_on :browser => [:iphone, :safari, :phantomjs] do |
| 210 | + # Edge BUG - https://connect.microsoft.com/IE/feedback/details/1850030 |
| 211 | + not_compliant_on :browser => [:iphone, :safari, :phantomjs, :edge] do |
| 212 | + describe "alerts" do |
212 | 213 | it "allows the user to accept an alert" do
|
213 |
| - driver.navigate.to url_for("alerts.html") |
214 |
| - driver.find_element(:id => "alert").click |
| 214 | + driver.navigate.to url_for("alerts.html") |
| 215 | + driver.find_element(:id => "alert").click |
215 | 216 |
|
216 |
| - alert = wait_for_alert |
217 |
| - alert.accept |
| 217 | + alert = wait_for_alert |
| 218 | + alert.accept |
218 | 219 |
|
219 |
| - expect(driver.title).to eq("Testing Alerts") |
220 |
| - end |
221 |
| - end |
| 220 | + expect(driver.title).to eq("Testing Alerts") |
| 221 | + end |
222 | 222 |
|
223 |
| - not_compliant_on({:browser => :chrome, :platform => :macosx}, |
224 |
| - {:browser => :iphone}, |
225 |
| - {:browser => :safari}, |
226 |
| - {:browser => :phantomjs}) do |
227 |
| - it "allows the user to dismiss an alert" do |
228 |
| - driver.navigate.to url_for("alerts.html") |
229 |
| - driver.find_element(:id => "alert").click |
| 223 | + not_compliant_on({:browser => :chrome, :platform => :macosx}) do |
| 224 | + it "allows the user to dismiss an alert" do |
| 225 | + driver.navigate.to url_for("alerts.html") |
| 226 | + driver.find_element(:id => "alert").click |
230 | 227 |
|
231 |
| - alert = wait_for_alert |
232 |
| - alert.dismiss |
| 228 | + alert = wait_for_alert |
| 229 | + alert.dismiss |
233 | 230 |
|
234 |
| - wait_for_no_alert |
| 231 | + wait_for_no_alert |
235 | 232 |
|
236 |
| - expect(driver.title).to eq("Testing Alerts") |
| 233 | + expect(driver.title).to eq("Testing Alerts") |
| 234 | + end |
237 | 235 | end
|
238 |
| - end |
239 | 236 |
|
240 |
| - # Edge BUG - https://connect.microsoft.com/IE/feedback/details/1850030 |
241 |
| - not_compliant_on :browser => [:iphone, :safari, :phantomjs, :edge] do |
242 | 237 | it "allows the user to set the value of a prompt" do
|
243 | 238 | driver.navigate.to url_for("alerts.html")
|
244 | 239 | driver.find_element(:id => "prompt").click
|
|
272 | 267 | expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoAlertPresentError)
|
273 | 268 | end
|
274 | 269 |
|
275 |
| - end |
276 |
| - |
277 |
| - not_compliant_on :browser => [:ie, :iphone, :safari, :phantomjs] do |
278 |
| - it "raises NoAlertOpenError if no alert is present" do |
279 |
| - expect { driver.switch_to.alert }.to raise_error( |
280 |
| - Selenium::WebDriver::Error::NoAlertPresentError, /alert|modal dialog/i) |
| 270 | + not_compliant_on :browser => :ie do |
| 271 | + it "raises NoAlertOpenError if no alert is present" do |
| 272 | + expect { driver.switch_to.alert }.to raise_error( |
| 273 | + Selenium::WebDriver::Error::NoAlertPresentError, /alert|modal dialog/i) |
| 274 | + end |
281 | 275 | end
|
282 |
| - end |
283 | 276 |
|
284 |
| - # TODO - File Edge bug; clicking for alert causes driver to hang |
285 |
| - compliant_on :browser => [:firefox, :ie, :edge] do |
286 |
| - it "raises an UnhandledAlertError if an alert has not been dealt with" do |
287 |
| - driver.navigate.to url_for("alerts.html") |
288 |
| - driver.find_element(:id => "alert").click |
289 |
| - wait_for_alert |
| 277 | + compliant_on :browser => [:firefox, :ie] do |
| 278 | + it "raises an UnhandledAlertError if an alert has not been dealt with" do |
| 279 | + driver.navigate.to url_for("alerts.html") |
| 280 | + driver.find_element(:id => "alert").click |
| 281 | + wait_for_alert |
290 | 282 |
|
291 |
| - expect { driver.title }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError, /cheese/) |
| 283 | + expect { driver.title }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError, /cheese/) |
292 | 284 |
|
293 |
| - expect(driver.title).to eq("Testing Alerts") # :chrome does not auto-dismiss the alert |
| 285 | + expect(driver.title).to eq("Testing Alerts") # :chrome does not auto-dismiss the alert |
| 286 | + end |
294 | 287 | end
|
295 | 288 | end
|
296 |
| - |
297 | 289 | end
|
298 | 290 | end
|
0 commit comments