Skip to content

Commit 912b5d0

Browse files
authored
Merge pull request #181 from seleniumbase/fix-edge-cases
Fix edge cases
2 parents a7bf236 + 3aa70b6 commit 912b5d0

File tree

5 files changed

+27
-12
lines changed

5 files changed

+27
-12
lines changed

examples/example_logs/ReadMe.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#### Logging, Screenshots, and Reports examples
22

3-
Log files in [example_logs/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/example_logs) were generated when [test_fail.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py) was run with the logging plugin. (Usage: "``--with-testing_base``".) By default, logs are saved to ``latest_logs/``. If ARCHIVE_EXISTING_LOGS is set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), past logs get saved to ``archived_logs/``.
3+
Log files in [example_logs/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/example_logs) were generated when [test_fail.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py) ran and failed. By default, logs are saved to ``latest_logs/``. If ARCHIVE_EXISTING_LOGS is set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), past logs get saved to ``archived_logs/``.
44

5-
**Usage examples:**
65
```bash
7-
pytest test_fail.py --with-testing_base --browser=chrome
6+
pytest test_fail.py --browser=chrome
87

9-
nosetests test_fail.py --with-selenium --with-testing_base --browser=firefox
8+
nosetests test_fail.py --browser=firefox
109
```
1110

1211
**Expected log files generated during failures:**
@@ -24,7 +23,7 @@ Reports are most useful when running large test suites. Pytest and Nosetest repo
2423
Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
2524

2625
```bash
27-
pytest my_test_suite.py --with-selenium --html=report.html
26+
pytest my_test_suite.py --html=report.html
2827
```
2928
![](https://cdn2.hubspot.net/hubfs/100006/images/PytestReport.png "Example Pytest Report")
3029

@@ -33,7 +32,7 @@ pytest my_test_suite.py --with-selenium --html=report.html
3332
The ``--report`` option gives you a fancy report after your test suite completes. (Requires ``--with-testing_base`` to also be set when ``--report`` is used because it's part of that plugin.)
3433

3534
```bash
36-
nosetests my_test_suite.py --with-selenium --with-testing_base --report --browser=chrome
35+
nosetests my_test_suite.py --report --browser=chrome
3736
```
3837
![](http://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png "Example Nosetest Report")
3938

help_docs/features_list.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<a id="feature_list"></a>
22
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **SeleniumBase Features:**
33
* A versatile test automation framework for building & running Selenium scripts reliably.
4-
* Uses [Pytest](https://docs.pytest.org/en/latest/) and [Nose](http://nose.readthedocs.io/en/latest/) for test discovery and for gathering detailed stacktrace info.
5-
* Can run tests locally, from [Jenkins](https://jenkins.io/) headlessly, or remotely with [Selenium Grid](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/selenium_grid).
6-
* Uses a [flexible command-line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/command_line.md) to customize & control test runs.
4+
* Uses [Pytest](https://docs.pytest.org/en/latest/) and [Nose](http://nose.readthedocs.io/en/latest/) runners for test discovery, organization, execution, and logging.
5+
* Includes a [website tour builder](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md) for creating and running walkthroughs on any website.
6+
* Works on multiple platforms such as Mac, Windows, Linux, and [Docker](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/docker/ReadMe.md).
7+
* Uses a [flexible command-line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/command_line.md) to customize & configure test runs.
78
* Has [Python libraries](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase) for helping you do more with Selenium-WebDriver.
8-
* Has [Plugins](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/plugins) for logging data and screenshots automatically. ([Click to learn how](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md))
9+
* Has [Plugins](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/plugins) for logging data and screenshots automatically. ([Click to learn more](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md))
910
* Uses a [global config file](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) to make SeleniumBase unique to your specific environment needs.
1011
* Backwards-compatible with [WebDriver](http://www.seleniumhq.org/projects/webdriver/). (Use ``self.driver`` anywhere.)
1112
* Can run tests through a proxy server. (Use ``--proxy=IP_ADDRESS:PORT``)
1213
* Includes a hybrid-automation solution called **[MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md)** to speed up manual testing.
13-
* Includes integrations with [MySQL](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/testcase_manager.py), [Docker](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/docker/ReadMe.md), [Google Cloud](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/google_cloud/ReadMe.md), [Amazon S3](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/s3_logging_plugin.py), and [NodeJS](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js).
14+
* Includes integrations with [MySQL](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/testcase_manager.py), [Selenium Grid](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/selenium_grid), [Google Cloud](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/google_cloud/ReadMe.md), [Amazon S3](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/s3_logging_plugin.py), and [NodeJS](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js).
1415
* Includes a [tool to convert Selenium IDE recordings](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/selenium_ide) into clean & robust SeleniumBase scripts.
1516
* Written in Python, but can also make JavaScript calls using ``self.execute_script()``.
1617
* Includes useful Python decorators and password obfuscation methods. ([Learn more here](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md))

seleniumbase/core/browser_launcher.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ def _set_chrome_options(downloads_path, proxy_string):
7070
chrome_options.add_argument("--start-maximized")
7171
# Run Chrome in full screen mode on MAC/Linux
7272
chrome_options.add_argument("--kiosk")
73+
if "win32" in sys.platform or "win64" in sys.platform:
74+
chrome_options.add_argument("--log-level=3")
7375
return chrome_options
7476

7577

7678
def _create_firefox_profile(downloads_path, proxy_string):
7779
profile = webdriver.FirefoxProfile()
7880
profile.set_preference("reader.parse-on-load.enabled", False)
7981
profile.set_preference("pdfjs.disabled", True)
82+
profile.set_preference("app.update.auto", False)
83+
profile.set_preference("app.update.enabled", False)
8084
if proxy_string:
8185
proxy_server = proxy_string.split(':')[0]
8286
proxy_port = proxy_string.split(':')[1]

seleniumbase/plugins/base_plugin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import os
9+
import sys
910
import time
1011
from nose.plugins import Plugin
1112
from nose.exc import SkipTest
@@ -55,6 +56,16 @@ def options(self, parser, env):
5556
dest='show_report',
5657
default=False,
5758
help="If true when using report, will display it after tests run.")
59+
found_processes_arg = False
60+
for arg in sys.argv:
61+
if "--processes=" in arg:
62+
found_processes_arg = True
63+
if found_processes_arg:
64+
print("* WARNING: Don't use multi-threading with nosetests! *")
65+
parser.add_option(
66+
'--processes', dest='processes',
67+
default=0,
68+
help="WARNING: Don't use multi-threading with nosetests!")
5869

5970
def configure(self, options, conf):
6071
super(Base, self).configure(options, conf)

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.13.0',
10+
version='1.13.1',
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)