| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
from selenium.webdriver import Ie |
| 19 |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities |
| 20 |
from selenium.webdriver.ie.options import Options |
| 21 |
|
| 22 |
|
| 23 |
def test_launch_and_close_browser(): |
| 24 |
driver = Ie() |
| 25 |
driver.quit() |
| 26 |
|
| 27 |
|
| 28 |
def test_we_can_launch_multiple_ie_instances(): |
| 29 |
driver1 = Ie() |
| 30 |
driver2 = Ie() |
| 31 |
driver3 = Ie() |
| 32 |
driver1.quit() |
| 33 |
driver2.quit() |
| 34 |
driver3.quit() |
| 35 |
|
| 36 |
|
| 37 |
def test_launch_ie_do_not_affect_default_capabilities(): |
| 38 |
expected = DesiredCapabilities.INTERNETEXPLORER.copy() |
| 39 |
driver = Ie() |
| 40 |
actual = DesiredCapabilities.INTERNETEXPLORER.copy() |
| 41 |
driver.quit() |
| 42 |
assert actual == expected |
| 43 |
|
| 44 |
|
| 45 |
def test_launch_ie_with_options(pages): |
| 46 |
opts = Options() |
| 47 |
expected = "clicks.html" |
| 48 |
opts.initial_browser_url = pages.url(expected) |
| 49 |
driver = Ie(options=opts) |
| 50 |
actual = driver.current_url |
| 51 |
driver.quit() |
| 52 |
assert expected in actual |