14
14
# KIND, either express or implied. See the License for the
15
15
# specific language governing permissions and limitations
16
16
# under the License.
17
-
17
+ import os
18
18
import pytest
19
19
20
20
from selenium .common .exceptions import WebDriverException
@@ -130,21 +130,26 @@ def test_should_set_the_rect_of_the_current_window(driver):
130
130
131
131
132
132
@pytest .mark .xfail_chrome (raises = WebDriverException ,
133
- reason = 'Get Window Rect command not implemented' )
133
+ reason = 'Fullscreen command not implemented' )
134
134
@pytest .mark .xfail_firefox (raises = WebDriverException ,
135
- reason = 'Get Window Rect command not implemented' )
135
+ reason = 'Fullscreen command not implemented' )
136
136
@pytest .mark .xfail_phantomjs (raises = WebDriverException ,
137
- reason = 'Get Window Rect command not implemented' )
137
+ reason = 'Fullscreen command not implemented' )
138
138
@pytest .mark .xfail_remote (raises = WebDriverException ,
139
- reason = 'Get Window Rect command not implemented' )
139
+ reason = 'Fullscreen command not implemented' )
140
140
@pytest .mark .xfail_safari (raises = WebDriverException ,
141
- reason = 'Get Window Rect command not implemented' )
141
+ reason = 'Fullscreen command not implemented' )
142
+ @pytest .mark .skipif (os .environ .get ('CI' ) == 'true' ,
143
+ reason = 'Fullscreen command causes Travis to hang' )
142
144
def test_should_fullscreen_the_current_window (driver ):
143
145
start_width = driver .execute_script ('return window.innerWidth;' )
144
146
start_height = driver .execute_script ('return window.innerHeight;' )
145
147
146
148
driver .fullscreen_window ()
147
149
150
+ WebDriverWait (driver , 2 ).until (lambda d : driver .execute_script ('return window.innerWidth;' ) >
151
+ start_width )
152
+
148
153
end_width = driver .execute_script ('return window.innerWidth;' )
149
154
end_height = driver .execute_script ('return window.innerHeight;' )
150
155
@@ -155,15 +160,17 @@ def test_should_fullscreen_the_current_window(driver):
155
160
156
161
157
162
@pytest .mark .xfail_chrome (raises = WebDriverException ,
158
- reason = 'Get Window Rect command not implemented' )
163
+ reason = 'Minimize command not implemented' )
159
164
@pytest .mark .xfail_firefox (raises = WebDriverException ,
160
- reason = 'Get Window Rect command not implemented' )
165
+ reason = 'Minimize command not implemented' )
161
166
@pytest .mark .xfail_phantomjs (raises = WebDriverException ,
162
- reason = 'Get Window Rect command not implemented' )
167
+ reason = 'Minimize command not implemented' )
163
168
@pytest .mark .xfail_remote (raises = WebDriverException ,
164
- reason = 'Get Window Rect command not implemented' )
169
+ reason = 'Minimize command not implemented' )
165
170
@pytest .mark .xfail_safari (raises = WebDriverException ,
166
- reason = 'Get Window Rect command not implemented' )
171
+ reason = 'Minimize command not implemented' )
172
+ @pytest .mark .skipif (os .environ .get ('CI' ) == 'true' ,
173
+ reason = 'Minimize command causes Travis to hang' )
167
174
@pytest .mark .no_driver_after_test
168
175
def test_should_minimize_the_current_window (driver ):
169
176
driver .minimize_window ()
0 commit comments