@@ -31,26 +31,36 @@ def testShouldBeAbleToDetermineTheLocationOfAnElement(self):
31
31
self .assertGreater (location ["y" ], 0 )
32
32
33
33
def testShouldGetCoordinatesOfAnElement (self ):
34
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
35
+ pytest .xfail ("phantomjs calculates coordinates differently" )
34
36
self .driver .get (self .webserver .where_is ("coordinates_tests/simple_page.html" ))
35
37
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 10 , "y" : 10 })
36
38
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 10 , "y" : 10 })
37
39
38
40
def testShouldGetCoordinatesOfAnEmptyElement (self ):
41
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
42
+ pytest .xfail ("phantomjs calculates coordinates differently" )
39
43
self .driver .get (self .webserver .where_is ("coordinates_tests/page_with_empty_element.html" ))
40
44
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 10 , "y" : 10 })
41
45
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 10 , "y" : 10 })
42
46
43
47
def testShouldGetCoordinatesOfATransparentElement (self ):
48
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
49
+ pytest .xfail ("phantomjs calculates coordinates differently" )
44
50
self .driver .get (self .webserver .where_is ("coordinates_tests/page_with_transparent_element.html" ))
45
51
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 10 , "y" : 10 })
46
52
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 10 , "y" : 10 })
47
53
48
54
def testShouldGetCoordinatesOfAHiddenElement (self ):
55
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
56
+ pytest .xfail ("phantomjs calculates coordinates differently" )
49
57
self .driver .get (self .webserver .where_is ("coordinates_tests/page_with_hidden_element.html" ))
50
58
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 10 , "y" : 10 })
51
59
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 10 , "y" : 10 })
52
60
53
61
def testShouldGetCoordinatesOfAnInvisibleElement (self ):
62
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
63
+ pytest .xfail ("phantomjs calculates coordinates differently" )
54
64
self .driver .get (self .webserver .where_is ("coordinates_tests/page_with_invisible_element.html" ))
55
65
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 0 , "y" : 0 })
56
66
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 0 , "y" : 0 })
@@ -73,13 +83,17 @@ def testShouldGetCoordinatesOfAnElementInAFrame(self):
73
83
74
84
@pytest .mark .ignore_marionette
75
85
def testShouldGetCoordinatesInViewPortOfAnElementInAFrame (self ):
86
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
87
+ pytest .xfail ("phantomjs calculates coordinates differently" )
76
88
self .driver .get (self .webserver .where_is ("coordinates_tests/element_in_frame.html" ))
77
89
self .driver .switch_to_frame (self .driver .find_element (By .NAME , "ifr" ))
78
90
self .assertEqual (self ._get_location_in_viewport (By .ID , "box" ), {"x" : 25 , "y" : 25 })
79
91
self .assertEqual (self ._get_location_on_page (By .ID , "box" ), {"x" : 10 , "y" : 10 })
80
92
81
93
@pytest .mark .ignore_marionette
82
94
def testShouldGetCoordinatesInViewPortOfAnElementInANestedFrame (self ):
95
+ if self .driver .capabilities ['browserName' ] == 'phantomjs' :
96
+ pytest .xfail ("phantomjs calculates coordinates differently" )
83
97
self .driver .get (self .webserver .where_is ("coordinates_tests/element_in_nested_frame.html" ))
84
98
self .driver .switch_to_frame (self .driver .find_element (By .NAME , "ifr" ))
85
99
self .driver .switch_to_frame (self .driver .find_element (By .NAME , "ifr" ))
0 commit comments