Skip to content

Commit cefc7d0

Browse files
committed
[py] don't run minimize or fullscreen tests on Travis
it causes the build to hang
1 parent edd24f7 commit cefc7d0

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

py/test/selenium/webdriver/common/window_tests.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
17+
import os
1818
import pytest
1919

2020
from selenium.common.exceptions import WebDriverException
@@ -130,21 +130,26 @@ def test_should_set_the_rect_of_the_current_window(driver):
130130

131131

132132
@pytest.mark.xfail_chrome(raises=WebDriverException,
133-
reason='Get Window Rect command not implemented')
133+
reason='Fullscreen command not implemented')
134134
@pytest.mark.xfail_firefox(raises=WebDriverException,
135-
reason='Get Window Rect command not implemented')
135+
reason='Fullscreen command not implemented')
136136
@pytest.mark.xfail_phantomjs(raises=WebDriverException,
137-
reason='Get Window Rect command not implemented')
137+
reason='Fullscreen command not implemented')
138138
@pytest.mark.xfail_remote(raises=WebDriverException,
139-
reason='Get Window Rect command not implemented')
139+
reason='Fullscreen command not implemented')
140140
@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')
142144
def test_should_fullscreen_the_current_window(driver):
143145
start_width = driver.execute_script('return window.innerWidth;')
144146
start_height = driver.execute_script('return window.innerHeight;')
145147

146148
driver.fullscreen_window()
147149

150+
WebDriverWait(driver, 2).until(lambda d: driver.execute_script('return window.innerWidth;') >
151+
start_width)
152+
148153
end_width = driver.execute_script('return window.innerWidth;')
149154
end_height = driver.execute_script('return window.innerHeight;')
150155

@@ -155,15 +160,17 @@ def test_should_fullscreen_the_current_window(driver):
155160

156161

157162
@pytest.mark.xfail_chrome(raises=WebDriverException,
158-
reason='Get Window Rect command not implemented')
163+
reason='Minimize command not implemented')
159164
@pytest.mark.xfail_firefox(raises=WebDriverException,
160-
reason='Get Window Rect command not implemented')
165+
reason='Minimize command not implemented')
161166
@pytest.mark.xfail_phantomjs(raises=WebDriverException,
162-
reason='Get Window Rect command not implemented')
167+
reason='Minimize command not implemented')
163168
@pytest.mark.xfail_remote(raises=WebDriverException,
164-
reason='Get Window Rect command not implemented')
169+
reason='Minimize command not implemented')
165170
@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')
167174
@pytest.mark.no_driver_after_test
168175
def test_should_minimize_the_current_window(driver):
169176
driver.minimize_window()

0 commit comments

Comments
 (0)