You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><b>SeleniumBase</b> is a complete framework for browser automation, end-to-end testing, reports, charts, presentations, website tours, and visual testing.
19
+
<p><b>SeleniumBase</b> is a complete browser automation solution for end-to-end testing, reports, charts, presentations, website tours, and visual testing.
20
20
Tests are run with <ahref="https://docs.pytest.org/en/latest/index.html">pytest</a>. Browsers are controlled by <ahref="https://www.w3.org/TR/webdriver2/#endpoints">WebDriver</a>.</p>
21
21
22
22
<palign="center">
@@ -48,11 +48,11 @@ Tests are run with <a href="https://docs.pytest.org/en/latest/index.html">pytest
* Simplifies the process of creating UI tests for websites.
52
-
*Uses reliable, smart-waiting code to prevent flaky tests.
53
-
* Includes tools for [logging, screenshots, and test reports](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).
54
-
* Has plugins that add new [pytest command-line options](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).
55
-
*Enhances Selenium's Python API with[versatile methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).
51
+
* Simplifies the creation of Web-UI tests.
52
+
*Smart-waiting code keeps tests reliable.
53
+
* Includes tools for [loggingand reports](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).
54
+
* Has plugins that add new [pytest options](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).
55
+
*Has a vast library of[versatile methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).
* You can install ``seleniumbase`` from [pypi](https://pypi.python.org/pypi/seleniumbase):
80
80
@@ -131,7 +131,7 @@ COMMANDS:
131
131
* (Use "pytest"for running tests) *
132
132
```
133
133
134
-
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Download a webdriver:</h3>
134
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Download a webdriver:</h3>
135
135
136
136
SeleniumBase can download webdrivers to the [seleniumbase/drivers](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/drivers) folder with the ``install`` command:
(See [seleniumbase.io/seleniumbase/console_scripts/ReadMe/](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) for more information on SeleniumBase console scripts.)
152
152
153
-
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Create and run tests:</h3>
153
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Create and run tests:</h3>
154
154
155
155
*``sbase mkdir DIR`` creates a folder with sample tests:
156
156
@@ -261,7 +261,7 @@ self.save_screenshot(FILE_NAME) # Save a screenshot of the current page
261
261
262
262
For the complete list of SeleniumBase methods, see: <b><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">Method Summary</a></b>
SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (<i><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">Read more about customizing test runs</a>.</i>)
@@ -317,7 +317,7 @@ For a full list of SeleniumBase features, <a href="https://github.com/seleniumba
<a id="seleniumbase_demo_mode"></a><b>Use Demo Mode to help you see what tests are asserting.</b>
323
323
@@ -444,7 +444,7 @@ To pass additional data from the command-line to tests, add ``--data="ANY STRING
444
444
Inside your tests, you can use ``self.data`` to access that.
445
445
446
446
447
-
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Test Directory Customization:</h3>
447
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Test Directory Customization:</h3>
448
448
449
449
For running tests outside of the SeleniumBase repo with **Pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** on the root folder. For running tests outside of the SeleniumBase repo with **Nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** on the root folder. (Subfolders should include a blank ``__init__.py`` file.) These files specify default configuration details for tests. (For nosetest runs, you can also specify a .cfg file by using ``--config``. Example ``nosetests [MY_TEST.py] --config=[MY_CONFIG.cfg]``)
You'll notice that a logs folder, "latest_logs", was created to hold information about the failing test, and screenshots. During test runs, past results get moved to the archived_logs folder if you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), or if your run tests with ``--archive-logs``. If you choose not to archive existing logs, they will be deleted and replaced by the logs of the latest test run.
482
482
483
+
--------
483
484
484
-
<a id="creating_visual_reports"></a>
485
-
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Creating Visual Test Suite Reports:</h3>
485
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> The SeleniumBase Dashboard:</h3>
486
+
487
+
The ``--dashboard`` option for pytest generates a SeleniumBase Dashboard located at ``dashboard.html``, which updates automatically as tests run and produce results.
Additionally, you can host your own SeleniumBase Dashboard Server on a port of your choice. Here's an example of that using Python 3's ``http.server``:
492
+
493
+
```bash
494
+
python -m http.server 1948
495
+
```
496
+
497
+
Now you can navigate to ``http://localhost:1948/dashboard.html``in order to view the served dashboard from a web browser. (Be sure to run that commandin the same directory where you ran your tests.)
486
498
487
-
(NOTE: Several command-line args are different for Pytest vs Nosetests)
499
+
Here's a full example of what the SeleniumBase Dashboard may look like:
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
549
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Using a Proxy Server:</h3>
527
550
528
551
If you wish to use a proxy server for your browser tests (Chrome and Firefox only), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command-line.
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
570
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Changing the User-Agent:</h3>
548
571
549
572
If you wish to change the User-Agent for your browser tests (Chromium and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
579
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
557
580
558
581
Learn about <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples`` folder). It's great for prototyping a website onboarding experience.
559
582
560
583
561
584
<a id="utilizing_advanced_features"></a>
562
-
<h3><img src="https://seleniumbase.io/img/logo3a.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
585
+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Production Environments & Integrations:</h3>
563
586
564
587
Here are some things you can do to set up a production environment for your testing:
Additionally, you can use the ``@retry_on_exception()`` decorator to specifically retry failing methods. (First import: ``from seleniumbase import decorators``) To learn more about SeleniumBase decorators, [click here](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/common).
0 commit comments