Update the docs
This commit is contained in:
parent
1f9ca9de16
commit
4bc69a1b62
11
README.md
11
README.md
|
@ -4,7 +4,7 @@
|
|||
|
||||
All-in-one framework for web automation, end-to-end testing, and website tours. SeleniumBase uses [pytest](https://pytest.org) for running Python scripts, while using [Selenium WebDriver](https://selenium.dev/) for controlling web browsers.
|
||||
|
||||
* Fast & Reliable [Python methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).
|
||||
* Fast, Reliable [Python methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).
|
||||
* Flexible [command-line options](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md).
|
||||
* Includes web & mobile testing.
|
||||
* Includes a [website tour builder](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
|
||||
|
@ -92,7 +92,7 @@ self.save_screenshot(FILE_NAME) # Save a screenshot of the current page
|
|||
```
|
||||
For the complete list of SeleniumBase methods, see: **[help_docs/method_summary.md](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md)**
|
||||
|
||||
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_dh.png" title="SeleniumBase" align="center" height="145">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
|
||||
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_dh.png" title="SeleniumBase" align="center" height="155">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
|
||||
|
||||
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> Learn More:
|
||||
|
||||
|
@ -102,11 +102,14 @@ SeleniumBase automatically handles common WebDriver actions such as spinning up
|
|||
#### **Simplified code:**<br />
|
||||
SeleniumBase uses simple syntax for commands, such as:
|
||||
```python
|
||||
self.update_text("textarea", "text")
|
||||
self.update_text("input", "dogs\n")
|
||||
```
|
||||
The same command with regular WebDriver is very messy:
|
||||
(<i>And it doesn't include SeleniumBase smart-waiting.</i>)
|
||||
```python
|
||||
self.driver.find_element_by_css_selector("textarea").send_keys("text")
|
||||
self.driver.find_element_by_css_selector("input").clear() # Not always needed
|
||||
self.driver.find_element_by_css_selector("input").send_keys("dogs")
|
||||
self.driver.find_element_by_css_selector("input").submit()
|
||||
```
|
||||
(<i>You can still use ``self.driver`` in your code.</i>)
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@ Run an example test in Headless Mode: (invisible web browser)
|
|||
pytest my_first_test.py --headless
|
||||
```
|
||||
|
||||
Run tests with verbose output per test: (improves logging)
|
||||
Run tests with verbose output: (includes more details)
|
||||
```bash
|
||||
pytest test_suite.py -v
|
||||
```
|
||||
|
||||
Run tests multi-threaded using [n] threads:
|
||||
```bash
|
||||
pytest test_suite.py -n=4
|
||||
pytest test_suite.py -v -n=4
|
||||
```
|
||||
|
||||
Run a parameterized test, which generates multiple tests out of one:
|
||||
|
@ -47,7 +47,7 @@ pytest parameterized_test.py -v
|
|||
|
||||
Run an example test suite and generate a pytest report: (pytest-only)
|
||||
```bash
|
||||
pytest test_suite.py --html=report.html
|
||||
pytest test_suite.py -v --html=report.html
|
||||
```
|
||||
|
||||
Run a failing test: (See the ``latest_logs/`` folder for logs and screenshots)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<a id="feature_list"></a>
|
||||
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> **Features:**
|
||||
* A complete test automation framework for building & running reliable testing scripts.
|
||||
* Uses [Pytest](https://docs.pytest.org/en/latest/) and [Nose](http://nose.readthedocs.io/en/latest/) runners for test discovery, organization, execution, and logging.
|
||||
* Uses [Pytest](https://docs.pytest.org/en/latest/) or [Nose](http://nose.readthedocs.io/en/latest/) runners for test discovery, organization, execution, and logging.
|
||||
* Includes [console scripts](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md) that save you time by installing web drivers automatically, etc.
|
||||
* 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.
|
||||
* Works on multiple platforms such as macOS, Windows, Linux, and [Docker](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/docker/ReadMe.md).
|
||||
|
|
|
@ -7,12 +7,7 @@ For backwards compatibility, older versions of method names have remained to kee
|
|||
|
||||
```python
|
||||
self.open(url)
|
||||
|
||||
self.open_url(url)
|
||||
|
||||
self.get(url)
|
||||
|
||||
self.visit(url)
|
||||
# Duplicates: self.open_url(url), self.get(url), self.visit(url)
|
||||
|
||||
self.click(selector, by=By.CSS_SELECTOR, timeout=None, delay=0)
|
||||
|
||||
|
@ -22,29 +17,23 @@ self.double_click(selector, by=By.CSS_SELECTOR, timeout=None)
|
|||
|
||||
self.click_chain(selectors_list, by=By.CSS_SELECTOR, timeout=None, spacing=0)
|
||||
|
||||
self.type(selector, text, by=By.CSS_SELECTOR, timeout=None, retry=False)
|
||||
|
||||
self.input(selector, text, by=By.CSS_SELECTOR, timeout=None, retry=False)
|
||||
|
||||
self.update_text(selector, new_value, by=By.CSS_SELECTOR, timeout=None, retry=False)
|
||||
# Duplicates: self.type(selector, text, by=By.CSS_SELECTOR, timeout=None, retry=False)
|
||||
# self.input(selector, text, by=By.CSS_SELECTOR, timeout=None, retry=False)
|
||||
|
||||
self.add_text(selector, text, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.send_keys(selector, text, by=By.CSS_SELECTOR, timeout=None)
|
||||
# Duplicates: self.send_keys(selector, text, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.submit(selector, by=By.CSS_SELECTOR)
|
||||
|
||||
self.refresh_page()
|
||||
|
||||
self.refresh()
|
||||
self.refresh() # Also self.refresh_page()
|
||||
|
||||
self.get_current_url()
|
||||
|
||||
self.get_page_source()
|
||||
|
||||
self.get_page_title()
|
||||
|
||||
self.get_title()
|
||||
# Duplicates: self.get_page_title()
|
||||
|
||||
self.go_back()
|
||||
|
||||
|
@ -70,9 +59,8 @@ self.get_link_text_attribute(link_text, attribute, hard_fail)
|
|||
|
||||
self.get_partial_link_text_attribute(link_text, attribute, hard_fail)
|
||||
|
||||
self.click_link_text(link_text, timeout=None)
|
||||
|
||||
self.click_link(link_text, timeout=None)
|
||||
# Duplicates: self.click_link_text(link_text, timeout=None)
|
||||
|
||||
self.click_partial_link_text(partial_link_text, timeout=None)
|
||||
|
||||
|
@ -333,9 +321,8 @@ self.generate_traffic_chain(pages, loops=1)
|
|||
|
||||
self.wait_for_element_present(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.wait_for_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.wait_for_element(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
# Duplicates: self.wait_for_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.get_element(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
|
@ -344,17 +331,15 @@ self.assert_element_present(selector, by=By.CSS_SELECTOR, timeout=None)
|
|||
self.find_element(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.assert_element(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.assert_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
# Duplicates: self.assert_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
########
|
||||
|
||||
self.wait_for_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
self.wait_for_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
# Duplicates: self.wait_for_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.wait_for_exact_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.wait_for_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.find_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
|
||||
self.assert_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
|
||||
|
@ -369,9 +354,8 @@ self.wait_for_link_text_present(link_text, timeout=None)
|
|||
|
||||
self.wait_for_partial_link_text_present(link_text, timeout=None)
|
||||
|
||||
self.wait_for_link_text_visible(link_text, timeout=None)
|
||||
|
||||
self.wait_for_link_text(link_text, timeout=None)
|
||||
# Duplicates: self.wait_for_link_text_visible(link_text, timeout=None)
|
||||
|
||||
self.find_link_text(link_text, timeout=None)
|
||||
|
||||
|
|
Loading…
Reference in New Issue