Skip to content

Commit f21be3a

Browse files
authored
Merge pull request #192 from seleniumbase/chrome-window-sizing
Set Chrome window default sizing
2 parents 5389c3b + 4ce5742 commit f21be3a

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo3g4.png" title="SeleniumBase" height="45">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1+
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo16.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

3-
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase)<br />
3+
[<img src="https://img.shields.io/pypi/v/seleniumbase.svg" alt="Version" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://img.shields.io/badge/python-2.7,_3.*-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
44

5-
SeleniumBase extends [WebDriver](https://docs.microsoft.com/en-us/microsoft-edge/webdriver) into a complete framework for end-to-end testing with [Pytest](https://github.com/pytest-dev/pytest).
5+
SeleniumBase transforms [WebDriver](https://www.seleniumhq.org/) into a complete test framework that runs with [Pytest](https://github.com/pytest-dev/pytest).
66

77
## ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Quick Start
88

seleniumbase/core/browser_launcher.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from selenium import webdriver
66
from selenium.common.exceptions import WebDriverException
77
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
8-
from seleniumbase.config import settings
98
from seleniumbase.config import proxy_list
109
from seleniumbase.core import download_helper
1110
from seleniumbase.fixtures import constants
@@ -73,11 +72,6 @@ def _set_chrome_options(downloads_path, proxy_string):
7372
chrome_options.add_argument("--disable-web-security")
7473
if proxy_string:
7574
chrome_options.add_argument('--proxy-server=%s' % proxy_string)
76-
if settings.START_CHROME_IN_FULL_SCREEN_MODE:
77-
# Run Chrome in full screen mode on WINDOWS
78-
chrome_options.add_argument("--start-maximized")
79-
# Run Chrome in full screen mode on MAC/Linux
80-
chrome_options.add_argument("--kiosk")
8175
if "win32" in sys.platform or "win64" in sys.platform:
8276
chrome_options.add_argument("--log-level=3")
8377
return chrome_options

seleniumbase/fixtures/base_case.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,11 +2252,22 @@ def get_new_driver(self, browser=None, headless=None,
22522252
# Make sure the invisible browser window is big enough
22532253
try:
22542254
self.set_window_size(1920, 1200)
2255+
self.wait_for_ready_state_complete()
22552256
except Exception:
22562257
# This shouldn't fail, but in case it does,
22572258
# get safely through setUp() so that
22582259
# WebDrivers can get closed during tearDown().
22592260
pass
2261+
else:
2262+
if self.browser == 'chrome':
2263+
try:
2264+
if settings.START_CHROME_IN_FULL_SCREEN_MODE:
2265+
self.driver.maximize_window()
2266+
else:
2267+
self.driver.set_window_size(1250, 800)
2268+
self.wait_for_ready_state_complete()
2269+
except Exception:
2270+
pass # Keep existing browser resolution
22602271
return new_driver
22612272

22622273
def switch_to_driver(self, driver):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='seleniumbase',
10-
version='1.14.3',
10+
version='1.14.4',
1111
description='Web Automation & Testing Framework - http://seleniumbase.com',
1212
long_description='Web Automation and Testing Framework - seleniumbase.com',
1313
platforms='Mac * Windows * Linux * Docker',

0 commit comments

Comments
 (0)