|
7 | 7 | <meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
|
8 | 8 | <link rel="icon" href="https://seleniumbase.github.io/img/logo7.png" />
|
9 | 9 |
|
10 |
| -<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/mac_sb_logo_b.png" alt="SeleniumBase" title="SeleniumBase" width="408" /></a></h3> |
| 10 | +<h3 align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="350" /></a></h3> |
11 | 11 |
|
12 |
| -<h2 align="center">SeleniumBase: Enterprise Python Web Testing</h2> |
| 12 | +<h2 align="center">Python Web UI Testing Framework</h2> |
13 | 13 |
|
14 | 14 | <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>
|
15 | 15 |
|
|
24 | 24 | <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📘 APIs</a> |
|
25 | 25 | <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md"> 🔡 Formats</a> |
|
26 | 26 | <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
|
27 |
| -<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">⏺️ Recorder</a> | |
| 27 | +<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> | |
28 | 28 | <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
|
29 | 29 | <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a>
|
30 | 30 | <br />
|
|
53 | 53 |
|
54 | 54 | --------
|
55 | 55 |
|
56 |
| - |
57 | 56 | <a id="multiple_examples"></a>
|
58 |
| -<p align="left"><b>Example:</b> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py" target="_blank">test_coffee_cart.py</a> from <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples" target="_blank">SeleniumBase/examples/</a></p> |
| 57 | +<p align="left"><b>Example:</b> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py" target="_blank">test_coffee_cart.py</a> from <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples" target="_blank">./examples/</a></p> |
59 | 58 |
|
60 | 59 | ```bash
|
61 | 60 | cd examples/
|
62 | 61 | pytest test_coffee_cart.py --demo
|
63 | 62 | ```
|
64 | 63 |
|
65 |
| -<p>(<code>--demo</code> slows the test with highlighting for better visibility.)</p> |
| 64 | +<p>(<code>--demo</code> mode slows down tests and highlights actions)</p> |
66 | 65 |
|
67 | 66 | <p align="left"><a href="https://seleniumbase.io/demo_page" target="_blank"><img src="https://seleniumbase.github.io/cdn/gif/coffee_cart.gif" width="480" alt="SeleniumBase Example" title="SeleniumBase Example" /></a></p>
|
68 | 67 |
|
| 68 | +* Here's a preview of that test: |
| 69 | + |
| 70 | +```python |
| 71 | +from seleniumbase import BaseCase |
| 72 | + |
| 73 | +class CoffeeCartTest(BaseCase): |
| 74 | + def test_coffee_cart(self): |
| 75 | + self.open("https://seleniumbase.io/coffee/") |
| 76 | + self.click('div[data-sb="Cappuccino"]') |
| 77 | + self.click('div[data-sb="Flat-White"]') |
| 78 | + self.click('div[data-sb="Cafe-Latte"]') |
| 79 | + self.click('a[aria-label="Cart page"]') |
| 80 | + self.assert_exact_text("Total: $53.00", "button.pay") |
| 81 | + self.click("button.pay") |
| 82 | + self.type("input#name", "Selenium Coffee") |
| 83 | + self.type( "input#email", "[email protected]") |
| 84 | + self.click("button#submit-payment") |
| 85 | + self.assert_text("Thanks for your purchase.", "#app") |
| 86 | +``` |
| 87 | + |
69 | 88 | --------
|
70 | 89 |
|
71 | 90 | <details>
|
72 |
| -<summary> ▶️ How is SeleniumBase different from raw Selenium? (<b>click to expand</b>)</summary> |
| 91 | +<summary> ▶️ How is <b>SeleniumBase</b> different from raw Selenium? (<b>click to expand</b>)</summary> |
73 | 92 | <div>
|
74 | 93 |
|
75 | 94 | <p>💡 SeleniumBase is a Python framework for browser automation and testing. SeleniumBase uses <a href="https://www.w3.org/TR/webdriver2/#endpoints" target="_blank">Selenium/WebDriver</a> APIs, and incorporates test-runners such as <code>pytest</code>, <code>nosetests</code>, and <code>behave</code> to provide organized structure, test discovery, test execution, test state (<i>eg. passed, failed, or skipped</i>), and command-line options for changing default settings (<i>such as choosing the browser to use</i>). With raw Selenium, you would need to set up your own options-parser for configuring tests from the command-line.</p>
|
|
0 commit comments