Update the documentation

This commit is contained in:
Michael Mintz 2022-12-23 22:59:16 -05:00
parent a5f1849aca
commit d8fe78f67a
17 changed files with 116 additions and 114 deletions

View File

@ -1,4 +1,4 @@
### <img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase Workflows
### <img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase Workflows
> **Table of Contents / Navigation:**
> - [**CI build**](workflows/python-package.yml)

View File

@ -1,3 +1,3 @@
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> CHANGELOG</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> CHANGELOG</h2>
<h3>See: [SeleniumBase/releases](https://github.com/seleniumbase/SeleniumBase/releases)</h3>

View File

@ -7,11 +7,9 @@
<meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
<link rel="icon" href="https://seleniumbase.github.io/img/logo3b.png" />
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="450" /></a></p>
<h2 align="center"><b>SeleniumBase - Python Web UI Testing Made Easy</b><br /><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a></h2>
<h3 align="center"><b>SeleniumBase - Python Web UI Testing Made Easy</b></h3>
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a></p>
<p align="center"><a href="https://seleniumbase.github.io/cdn/gif/my_first_test_2.gif" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/my_first_test_2.gif" width="480" alt="SeleniumBase Example" title="SeleniumBase Example" /></a></p>
<p align="center">
<a href="#python_installation">🚀 Start</a> |
@ -54,7 +52,7 @@
--------
<blockquote>
<p dir="auto"><strong>Table of Contents:</strong></p>
<p dir="auto"><strong>SeleniumBase - Table of Contents:</strong></p>
<ul dir="auto">
<li><a href="#python_installation" ><strong>Set up Python & Git</strong></a></li>
<li><a href="#install_seleniumbase" ><strong>Install SeleniumBase</strong></a></li>
@ -465,7 +463,7 @@ pytest my_first_test.py --pdb
🔵 Here are some useful command-line options that come with <code>pytest</code>:
```bash
-v # Verbose mode. Prints the full name of each test run.
-v # Verbose mode. Prints the full name of each test and shows more details.
-q # Quiet mode. Print fewer details in the console output when running tests.
-x # Stop running the tests after the first failure is reached.
--html=report.html # Creates a detailed pytest-html report after tests finish.
@ -554,7 +552,8 @@ pytest my_first_test.py --pdb
--incognito # (Enable Chrome's Incognito mode.)
--guest # (Enable Chrome's Guest mode.)
--devtools # (Open Chrome's DevTools when the browser opens.)
--reuse-session | --rs # (Reuse the browser session between tests.)
--reuse-session | --rs # (Reuse browser session for all tests.)
--reuse-class-session | --rcs # (Reuse session for tests in class.)
--crumbs # (Delete all cookies between tests reusing a session.)
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)

View File

@ -1,14 +1,14 @@
<!-- SeleniumBase Docs -->
<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="290">
<img src="https://seleniumbase.github.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="290">
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Example Boilerplates:</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Example Boilerplates:</h2>
* Boilerplate files are located in the [SeleniumBase => examples/boilerplates/](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/boilerplates) folder.
* Boilerplates can help you structure tests using common design patterns such as the Page Object Model.
* For all 20 SeleniumBase design patterns, see: [Syntax Formats](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md)
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Boilerplate Files:</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Boilerplate Files:</h2>
* <b>[base_test_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/boilerplates/base_test_case.py):</b> This example demonstrates a test class inheriting [BaseCase](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py) for adding new methods.
* <b>[page_objects.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/boilerplates/page_objects.py):</b> This example demonstrates Page Objects for reusing commonly-used selectors in tests.
@ -17,4 +17,4 @@
--------
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" width="300" /></a></div>
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" width="300" /></a></div>

View File

@ -1,10 +1,10 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📊 ChartMaker 📶
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 📊 ChartMaker 📶
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts.</p>
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="480" src="https://seleniumbase.io/cdn/gif/chart_pres.gif" title="Chart Presentation"></a><br>
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="480" src="https://seleniumbase.github.io/cdn/gif/chart_pres.gif" title="Chart Presentation"></a><br>
([Click to see a presentation with multiple charts](https://seleniumbase.io/other/chart_presentation.html))
@ -40,20 +40,20 @@ pytest chart_presentation.py
Here are screenshots from the examples:
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="500" src="https://seleniumbase.io/other/sample_pie_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/chart_presentation.html"><img width="500" src="https://seleniumbase.github.io/other/sample_pie_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.io/other/sample_column_chart.png"><img width="500" src="https://seleniumbase.io/other/sample_column_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/sample_column_chart.png"><img width="500" src="https://seleniumbase.github.io/other/sample_column_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.io/other/sample_bar_chart.png"><img width="500" src="https://seleniumbase.io/other/sample_bar_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/sample_bar_chart.png"><img width="500" src="https://seleniumbase.github.io/other/sample_bar_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.io/other/sample_line_chart.png"><img width="500" src="https://seleniumbase.io/other/sample_line_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/sample_line_chart.png"><img width="500" src="https://seleniumbase.github.io/other/sample_line_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.io/other/sample_area_chart.png"><img width="500" src="https://seleniumbase.io/other/sample_area_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/sample_area_chart.png"><img width="500" src="https://seleniumbase.github.io/other/sample_area_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.io/other/multi_series_chart.png"><img width="500" src="https://seleniumbase.io/other/multi_series_chart.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/multi_series_chart.png"><img width="500" src="https://seleniumbase.github.io/other/multi_series_chart.png" title="Screenshot"></a><br>
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Here's a line chart example:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Here's a line chart example:</h3>
```python
from seleniumbase import BaseCase
@ -83,7 +83,7 @@ pytest test_line_chart.py
Because that presentation above has an ``interval`` set to ``8``, it will automatically advance to the next slide after 8 seconds. (Or exit if there are no more slides.)
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> For a more advanced example (multiple charts in a presentation):</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> For a more advanced example (multiple charts in a presentation):</h3>
```python
from seleniumbase import BaseCase
@ -138,7 +138,7 @@ pytest chart_presentation.py
Multi-Series charts can also be created. Try the available examples to learn more.
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> ChartMaker API</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> ChartMaker API</h2>
```python
self.create_pie_chart(
@ -260,7 +260,7 @@ self.create_area_chart(
If creating multiple charts at the same time, you can pass the ``chart_name`` parameter to distinguish between different charts.
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Adding a data point to a chart:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Adding a data point to a chart:</h3>
```python
self.add_data_point(label, value, color=None, chart_name=None):
@ -277,7 +277,7 @@ self.add_data_point(label, value, color=None, chart_name=None):
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Adding a new data series to an existing chart:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Adding a new data series to an existing chart:</h3>
```python
self.add_series_to_chart(self, data_name=None, chart_name=None):
@ -291,7 +291,7 @@ self.add_series_to_chart(self, data_name=None, chart_name=None):
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Saving a chart to a file:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Saving a chart to a file:</h3>
```python
self.save_chart(chart_name=None, filename=None):
@ -307,7 +307,7 @@ self.save_chart(chart_name=None, filename=None):
The full HTML of the chart is saved to the ``saved_charts/`` folder.
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Extracting the HTML of a chart:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Extracting the HTML of a chart:</h3>
```python
self.extract_chart(chart_name=None):
@ -319,7 +319,7 @@ self.extract_chart(chart_name=None):
```
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Displaying a chart in the browser window:</h3>
<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Displaying a chart in the browser window:</h3>
```python
self.display_chart(chart_name=None, filename=None):

View File

@ -1,5 +1,5 @@
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="320" /></h3>
<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="320" /></h3>
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Desktop Apps</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Desktop Apps</h2>
* **Recorder** (Run using ``python recorder.py`` or ``sbase recorder``)

View File

@ -6,7 +6,7 @@
<b>Here's a sample presentation:</b>
<a href="https://seleniumbase.github.io/other/presenter.html"><img width="500" src="https://seleniumbase.io/other/presenter.gif" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/presenter.html"><img width="500" src="https://seleniumbase.github.io/other/presenter.gif" title="Screenshot"></a><br>
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/presenter.html))
@ -23,7 +23,7 @@ pytest my_presentation.py
**Here's a presentation with a chart:**
<a href="https://seleniumbase.github.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.io/other/sb_core_areas.png" title="Screenshot"></a><br>
<a href="https://seleniumbase.github.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.github.io/other/sb_core_areas.png" title="Screenshot"></a><br>
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/core_presentation.html))
@ -150,7 +150,7 @@ class MyPresenterClass(BaseCase):
)
self.add_slide(
'<h3>Add <b>images</b> to slides:</h3>',
image="https://seleniumbase.io/other/seagulls.jpg")
image="https://seleniumbase.github.io/other/seagulls.jpg")
self.add_slide(
'<h3>Add <b>code</b> to slides:</h3>',
code=(
@ -220,7 +220,7 @@ class MyPresenterClass(BaseCase):
'self.create_presentation(theme="league")'))
self.add_slide(
'<h2><b>The End</b></h2>',
image="https://seleniumbase.io/img/sb_logo_10.png")
image="https://seleniumbase.github.io/img/sb_logo_10.png")
self.begin_presentation(
filename="presenter.html", show_notes=True, interval=0)
```

View File

@ -2,7 +2,7 @@
<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/g_maps_tour.png" alt="SeleniumBase Tour" width="340" /></h3>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Interactive Product Tours 🚎
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Interactive Product Tours 🚎
<p><b>Increase SaaS Product Adoption by 10x or more.</b></p>

View File

@ -1,6 +1,6 @@
<a id="language_tests"></a>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🌏 Translated Tests 🈺
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) 🌏 Translated Tests 🈺
<b>SeleniumBase</b> supports the following 10 languages: <i>English</i>, <i>Chinese</i>, <i>Dutch</i>, <i>French</i>, <i>Italian</i>, <i>Japanese</i>, <i>Korean</i>, <i>Portuguese</i>, <i>Russian</i>, and <i>Spanish</i>. (Examples can be found in <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/translations">SeleniumBase/examples/translations</a>)
@ -39,7 +39,7 @@ class 私のテストクラス(セレニウムテストケース):
```
<a id="translation_api"></a>
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Translation API 🈺</h2>
<h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> Translation API 🈺</h2>
You can use SeleniumBase to selectively translate the method names of any test from one language to another with the console scripts interface. Additionally, the ``import`` line at the top of the Python file will change to import the new ``BaseCase``. Example: ``BaseCase`` becomes ``CasoDeTeste`` when a test is translated into Portuguese.
@ -88,4 +88,4 @@ plus the 2-letter language code of the new language.
--------
<h3 align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/super_logo_m.png" title="SeleniumBase" width="280" /></a></h3>
<h3 align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_m.png" title="SeleniumBase" width="280" /></a></h3>

View File

@ -1,8 +1,8 @@
<!-- SeleniumBase Docs -->
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_f6.png" alt="SeleniumBase" width="445" /></a></p>
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_f6.png" alt="SeleniumBase" width="445" /></a></p>
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Automated Visual Regression Testing
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Automated Visual Regression Testing
Automated Visual Regression Testing can help you detect when the layout of a web page has changed. Instead of comparing pixels from screenshots, layout differences can be detected by comparing HTML tags and attributes with a baseline. If a change is detected, it could mean that something broke, the web page was redesigned, or dynamic content changed.
@ -138,7 +138,7 @@ First differing element 33:
Here's the ``side_by_side.html`` file for that, (from the ``./latest_logs/`` folder), which shows a visual comparison of the two screenshots as a result of the missing "Donate" button:
<img style="border: 1px solid #222222;" src="https://seleniumbase.io/cdn/img/visual_comparison.png" title="SeleniumBase Visual Comparison" />
<img style="border: 1px solid #222222;" src="https://seleniumbase.github.io/cdn/img/visual_comparison.png" title="SeleniumBase Visual Comparison" />
Here's another example, where a web site logo is resized:
@ -185,7 +185,7 @@ pytest test_layout_fail.py --html=report.html
```
Here's what the pytest HTML Report looks like:<br />
[<img src="https://seleniumbase.io/cdn/img/visual_testing_report_2.png" title="Test Report">](https://seleniumbase.io/cdn/img/visual_testing_report_2.png)
[<img src="https://seleniumbase.github.io/cdn/img/visual_testing_report_2.png" title="Test Report">](https://seleniumbase.github.io/cdn/img/visual_testing_report_2.png)
--------

View File

@ -1,25 +1,27 @@
<!-- SeleniumBase Docs -->
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="450" /></a></p>
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Help Docs
<p align="left">
<a href="https://seleniumbase.io/#python_installation">🏄 Start</a> |
<a href="https://seleniumbase.io/#python_installation">🚀 Start</a> |
<a href="https://seleniumbase.io/examples/example_logs/ReadMe/">📊 Dashboard</a>
<br />
<a href="https://seleniumbase.io/help_docs/features_list/">🏰 Features</a> |
<a href="https://seleniumbase.io/help_docs/customizing_test_runs/">🎛️ Options</a>
<br />
<a href="https://seleniumbase.io/examples/ReadMe/">📚 Examples</a> |
<a href="https://seleniumbase.io/help_docs/mobile_testing/">📱 Mobile</a>
<a href="https://seleniumbase.io/help_docs/mobile_testing/">📱 Emulator</a>
<br />
<a href="https://seleniumbase.io/help_docs/syntax_formats/">🔡 Syntax Formats</a> |
<a href="https://seleniumbase.io/integrations/github/workflows/ReadMe/">🤖 CI/CD</a>
<a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/">🌠 Console Scripts</a> |
<a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/">🌐 Grid</a>
<br />
<a href="https://seleniumbase.io/help_docs/method_summary/">📘 Methods / APIs</a> |
<a href="https://seleniumbase.io/examples/tour_examples/ReadMe/">🚎 Tours</a>
<br />
<a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/">🌠 Console Scripts</a> |
<a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/">🌐 Grid</a>
<a href="https://seleniumbase.io/help_docs/syntax_formats/">🔡 Syntax Formats</a> |
<a href="https://seleniumbase.io/integrations/github/workflows/ReadMe/">🤖 CI/CD</a>
<br />
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplates</a> |
<a href="https://seleniumbase.io/help_docs/locale_codes/">🗾 Locale Codes</a>
@ -27,12 +29,12 @@
<a href="https://seleniumbase.io/help_docs/js_package_manager/">🕹️ JS Manager</a> |
<a href="https://seleniumbase.io/examples/visual_testing/ReadMe/">🖼️ Visual Testing</a>
<br />
<a href="https://seleniumbase.io/help_docs/recorder_mode/">⏺️ Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/node_js">🚉 Node GUI</a>
<br />
<a href="https://seleniumbase.io/help_docs/translations/">🌏 Translator</a> |
<a href="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">🛂 Dialog Boxes</a>
<br />
<a href="https://seleniumbase.io/help_docs/recorder_mode/">⏺️ Recorder</a> |
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/migration/raw_selenium">🚝 Migrate</a>
<br />
<a href="https://seleniumbase.io/examples/presenter/ReadMe/">🎞️ Slides</a> |
<a href="https://seleniumbase.io/examples/chart_maker/ReadMe/">📶 Charts</a>
</p>

View File

@ -1,8 +1,8 @@
<!-- SeleniumBase Docs -->
## [<img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Case Plans 🗂️
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) SeleniumBase Case Plans 🗂️
<img src="https://seleniumbase.io/cdn/img/cp/sb_case_plans.png" title="SeleniumBase Case Plans Summary" width="625">
<img src="https://seleniumbase.github.io/cdn/img/cp/sb_case_plans.png" title="SeleniumBase Case Plans Summary" width="625">
🗂️ <b>SeleniumBase Case Plans</b> is Test Case Management Software that uses Markdown tables for displaying test plans directly in GitHub (and other source code management systems that support Markdown format).
@ -160,7 +160,7 @@
sbase caseplans
```
<img src="https://seleniumbase.io/cdn/img/cp/case_plan_boilerplate_gen.png" title="SeleniumBase Case Plans GUI" width="525">
<img src="https://seleniumbase.github.io/cdn/img/cp/case_plan_boilerplate_gen.png" title="SeleniumBase Case Plans GUI" width="525">
🗂️ Once you are running the Case Plans GUI, select the existing tests that need Case Plans, and then click: ``Generate boilerplate Case Plans for selected tests missing them``. For each selected test that didn't already have a Case Plan file, one will be generated. Each new Case Plan file starts with default boilerplate code with a Markdown table. Eg:
@ -200,11 +200,11 @@ sbase caseplans
🗂️ After you've created some Case Plans, you can use the ``Generate Summary of existing Case Plans`` button in the Case Plans GUI to generate the Case Plans Summary file.
<img src="https://seleniumbase.io/cdn/img/cp/case_plan_summary_gen.png" title="SeleniumBase Case Plans GUI" width="550">
<img src="https://seleniumbase.githb.io/cdn/img/cp/case_plan_summary_gen.png" title="SeleniumBase Case Plans GUI" width="550">
🗂️ The generated Case Plans summary file, ``case_summary.md``, gets created in the same location where the Case Plans GUI was launched. This is NOT the same location where individual Case Plan boilerplates are generated, which is in the ``case_plans/`` folders. The ``case_plans/`` folders are generated where individual tests live, which means that if you have your tests in multiple folders, then you could also have multiple ``case_plans/`` folders. A ``case_summary.md`` file may look like this when rendered:
<img src="https://seleniumbase.io/cdn/img/cp/case_plan_summary.png" title="SeleniumBase Case Plans Summary" width="550">
<img src="https://seleniumbase.github.io/cdn/img/cp/case_plan_summary.png" title="SeleniumBase Case Plans Summary" width="550">
🗂️ When calling ``sbase caseplans``, you can provide additional arguments to limit the tests that appear in the list. The same discovery rules apply as when using ``pytest``. Eg:

View File

@ -84,7 +84,7 @@ pytest my_first_test.py --settings-file=custom_settings.py
🎛️ Here are some useful command-line options that come with ``pytest``:
```bash
-v # Verbose mode. Prints the full name of each test run.
-v # Verbose mode. Prints the full name of each test and shows more details.
-q # Quiet mode. Print fewer details in the console output when running tests.
-x # Stop running the tests after the first failure is reached.
--html=report.html # Creates a detailed pytest-html report after tests finish.
@ -172,7 +172,8 @@ pytest my_first_test.py --settings-file=custom_settings.py
--incognito # (Enable Chrome's Incognito mode.)
--guest # (Enable Chrome's Guest mode.)
--devtools # (Open Chrome's DevTools when the browser opens.)
--reuse-session | --rs # (Reuse the browser session between tests.)
--reuse-session | --rs # (Reuse browser session for all tests.)
--reuse-class-session | --rcs # (Reuse session for tests in class.)
--crumbs # (Delete all cookies between tests reusing a session.)
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)

View File

@ -12,7 +12,7 @@ Use ``--mobile`` to run SeleniumBase tests using Chrome's mobile device emulator
pytest test_skype_site.py --mobile
```
[<img src="https://seleniumbase.github.io/cdn/gif/skype_mobile_test_2.gif" title="SeleniumBase Mobile Testing">](https://seleniumbase.io/cdn/gif/skype_mobile_test_2.gif)
[<img src="https://seleniumbase.github.io/cdn/gif/skype_mobile_test_2.gif" title="SeleniumBase Mobile Testing">](https://seleniumbase.github.io/cdn/gif/skype_mobile_test_2.gif)
To configure Device Metrics, use:

View File

@ -4,7 +4,7 @@
## [<img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="40">](https://github.com/seleniumbase/SeleniumBase/) The 23 Syntax Formats
<b>SeleniumBase</b> currently supports 23 unique syntax formats (AKA "design patterns") for structuring tests.
<h3><b>SeleniumBase</b> currently supports 23 unique syntax formats (<i>"design patterns"</i>) for structuring tests.</h3>
--------
@ -42,7 +42,11 @@
<a id="sb_sf_01"></a>
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> 1. BaseCase direct class inheritance</h3>
This format is used by most of the examples in the <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples">SeleniumBase examples folder</a>. It's a great starting point for anyone learning SeleniumBase, and it follows good object-oriented programming principles. In this format, <code>BaseCase</code> is imported at the top of a Python file, followed by a Python class inheriting <code>BaseCase</code>. Then, any test method defined in that class automatically gains access to SeleniumBase methods, including the <code>setUp()</code> and <code>tearDown()</code> methods that are automatically called to spin up and spin down web browsers at the beginning and end of test methods. Here's an example of that:
This format is used by most of the examples in the <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples">SeleniumBase examples folder</a>. It's a great starting point for anyone learning SeleniumBase, and it follows good object-oriented programming principles.
In this format, <code>BaseCase</code> is imported at the top of a Python file, followed by a Python class inheriting <code>BaseCase</code>. Then, any test method defined in that class automatically gains access to SeleniumBase methods, including the <code>setUp()</code> and <code>tearDown()</code> methods that are automatically called to spin up and spin down web browsers at the beginning and end of test methods.
To run a test of this format, use **``pytest``** or ``nosetests``. If you add: ``if __name__ == "__main__":`` ``pytest.main([__file__])`` to the file, you can also use ``python`` as a runner, which invokes ``pytest``. Here's an example a script that uses ``BaseCase`` inheritance:
```python
from seleniumbase import BaseCase
@ -57,6 +61,10 @@ class MyTestClass(BaseCase):
self.click_link("SeleniumBase Demo Page")
self.assert_exact_text("Demo Page", "h1")
self.assert_no_js_errors()
if __name__ == "__main__": # To run with "python" instead of "pytest".
from pytest import main
main([__file__])
```
(See <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py">examples/test_demo_site.py</a> for the full test.)
@ -238,7 +246,7 @@ class OverrideDriverTest(BaseCase):
options.add_argument("--disable-3d-apis")
options.add_argument("--disable-notifications")
if self.headless:
options.add_argument("--headless")
options.add_argument("--headless=chrome")
options.add_argument("--disable-gpu")
options.add_experimental_option(
"excludeSwitches", ["enable-automation", "enable-logging"],
@ -292,41 +300,37 @@ import pytest
@pytest.fixture()
def sb(request):
import sys
from selenium import webdriver
from seleniumbase import BaseCase
class BaseClass(BaseCase):
def setUp(self):
super(BaseClass, self).setUp()
def tearDown(self):
self.save_teardown_screenshot() # On failure or "--screenshot"
super(BaseClass, self).tearDown()
def base_method(self):
pass
def get_new_driver(self, *args, **kwargs):
"""This method overrides get_new_driver() from BaseCase."""
options = webdriver.ChromeOptions()
if "linux" in sys.platform:
if self.headless:
options.add_argument("--headless=chrome")
options.add_argument("--disable-gpu")
options.add_experimental_option(
"excludeSwitches", ["enable-automation"],
)
return webdriver.Chrome(options=options)
if request.cls:
request.cls.sb = BaseClass("base_method")
request.cls.sb.setUp()
yield request.cls.sb
request.cls.sb.tearDown()
else:
sb = BaseClass("base_method")
sb.setUp()
yield sb
sb.tearDown()
def setUp(self):
super(BaseClass, self).setUp()
def base_method(self):
pass
def tearDown(self):
self.save_teardown_screenshot() # On failure or "--screenshot"
super(BaseClass, self).tearDown()
sb = BaseClass("base_method")
sb.setUpClass()
sb.setUp()
yield sb
sb.tearDown()
sb.tearDownClass()
def test_override_fixture_no_class(sb):
sb.open("https://seleniumbase.io/demo_page")
@ -352,6 +356,15 @@ def sb(request):
from seleniumwire import webdriver # Requires "pip install selenium-wire"
class BaseClass(BaseCase):
def get_new_driver(self, *args, **kwargs):
options = webdriver.ChromeOptions()
if "linux" in sys.platform:
options.add_argument("--headless=chrome")
options.add_experimental_option(
"excludeSwitches", ["enable-automation"],
)
return webdriver.Chrome(options=options)
def setUp(self):
super(BaseClass, self).setUp()
@ -362,25 +375,12 @@ def sb(request):
def base_method(self):
pass
def get_new_driver(self, *args, **kwargs):
options = webdriver.ChromeOptions()
if "linux" in sys.platform:
options.add_argument("--headless=chrome")
options.add_experimental_option(
"excludeSwitches", ["enable-automation"],
)
return webdriver.Chrome(options=options)
if request.cls:
request.cls.sb = BaseClass("base_method")
request.cls.sb.setUp()
yield request.cls.sb
request.cls.sb.tearDown()
else:
sb = BaseClass("base_method")
sb.setUp()
yield sb
sb.tearDown()
sb = BaseClass("base_method")
sb.setUpClass()
sb.setUp()
yield sb
sb.tearDown()
sb.tearDownClass()
def test_wire_with_no_class(sb):
sb.open("https://seleniumbase.io/demo_page")
@ -394,7 +394,7 @@ class TestWire:
print(request.url)
```
(NOTE: The ``selenium-wire`` integration is now included with ``seleniumbase``: Add ``--wire`` as a ``pytest`` command-line option to activate. If you need both ``--wire`` with ``--undetected`` together, you'll still need to override ``get_new_driver()``.)
(NOTE: The ``selenium-wire`` integration is now included with ``seleniumbase``: Add ``--wire`` as a ``pytest`` command-line option to activate. If you need both ``--wire`` with ``--undetected`` modes together, you'll still need to override ``get_new_driver()``.)
<a id="sb_sf_11"></a>
<h3><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> 11. BaseCase with Chinese translations</h3>

View File

@ -10,8 +10,8 @@
<p><div><b>Follow us on social media:</b></div></p>
<p><div><span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="56" /></a></span>
<span><a href="https://gitter.im/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="44" /></a></span>
<span><a href="https://twitter.com/seleniumbase"><img src="https://seleniumbase.io/img/social/share_twitter.svg" title="SeleniumBase on Twitter" alt="SeleniumBase on Twitter" width="60" /></a></span>
<span><a href="https://instagram.com/seleniumbase"><img src="https://seleniumbase.io/img/social/share_instagram.svg" title="SeleniumBase on Instagram" alt="SeleniumBase on Instagram" width="52" /></a></span>
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="56" /></a></span></div></p>
<p><div><span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="54" /></a></span>
<span><a href="https://gitter.im/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_gitter.svg" title="SeleniumBase on Gitter" alt="SeleniumBase on Gitter" width="42" /></a></span>
<span><a href="https://twitter.com/seleniumbase"><img src="https://seleniumbase.github.io/img/social/share_twitter.svg" title="SeleniumBase on Twitter" alt="SeleniumBase on Twitter" width="58" /></a></span>
<span><a href="https://instagram.com/seleniumbase"><img src="https://seleniumbase.github.io/img/social/share_instagram.svg" title="SeleniumBase on Instagram" alt="SeleniumBase on Instagram" width="50" /></a></span>
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="54" /></a></span></div></p>

View File

@ -1,6 +1,6 @@
<img src="https://seleniumbase.io/img/sb_logo_10.png" alt="SeleniumBase" width="212" />
<img src="https://seleniumbase.github.io/cdn/img/sb_word_cloud.png" alt="SeleniumBase" title="SeleniumBase" width="400" />
<h2><img src="https://seleniumbase.io/img/logo3b.png" title="SeleniumBase" width="32" /> Framework Folders</h2>
<h2><img src="https://seleniumbase.github.io/img/logo3b.png" title="SeleniumBase" width="32" /> Framework Folders</h2>
* <b>[fixtures](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/fixtures):</b> Includes [base_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py), where SeleniumBase test methods are defined.
* <b>[core](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/core):</b> Includes [browser_launcher.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/browser_launcher.py), which is used for spinning up browsers for tests.
@ -20,6 +20,6 @@
--------
<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="300">
<img src="https://seleniumbase.github.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" width="300" /></a></div>
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" width="360" /></a></div>