Skip to content

Commit 9d69b00

Browse files
authored
Merge pull request #584 from seleniumbase/many-changes
New console scripts interface, translations, fixes, and more
2 parents 7063374 + ca4d9dc commit 9d69b00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+413
-100
lines changed

docs/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def main(*args, **kwargs):
100100
r'<a href="https://github.com/seleniumbase/SeleniumBase">'
101101
r'<img src="https://img.shields.io/badge/'
102102
r'✅%20💛%20View%20Code-on%20GitHub%20🌎%20🚀'
103-
r'-02A79E.svg" alt="SeleniumBase.io Docs" />'
103+
r'-02A79E.svg" alt="SeleniumBase on GitHub" />'
104104
r'</a></div></p>')
105105
if "<!-- SeleniumBase Header -->" in line:
106106
changed = True

examples/master_qa/ReadMe.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![](https://cdn2.hubspot.net/hubfs/100006/images/masterqa6.gif "MasterQA")
66

7-
Here's example code from [basic_masterqa_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/basic_masterqa_test.py):
7+
Here's example code from [basic_masterqa_test_0.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/basic_masterqa_test_0.py):
88

99
```python
1010
self.open("https://xkcd.com/1700/")
@@ -17,7 +17,7 @@ self.verify('Do you see "dragons" in the search results?')
1717

1818
After each automation checkpoint, a pop-up window will ask the user questions for each verification command.
1919

20-
When the test run completes, as seen from [this longer example](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test.py), you'll reach the results page that appears after answering all the verification questions. (Failed verifications generate links to screenshots and log files.)
20+
When the test run completes, as seen from [this longer example](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test_1.py), you'll reach the results page that appears after answering all the verification questions. (Failed verifications generate links to screenshots and log files.)
2121

2222
![](https://cdn2.hubspot.net/hubfs/100006/images/hybrid_screen.png "MasterQA")
2323

@@ -30,13 +30,13 @@ cd SeleniumBase
3030
pip install -r requirements.txt --upgrade
3131
python setup.py develop
3232
cd examples/master_qa
33-
pytest basic_masterqa_test.py
34-
pytest masterqa_test.py
33+
pytest basic_masterqa_test_0.py
34+
pytest masterqa_test_1.py
3535
```
3636

3737
At the end of your test run, you'll receive a report with results, screenshots, and log files. Close the Results Page window when you're done.
3838

39-
### Check out [masterqa_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test.py) to learn how to write your own MasterQA tests:
39+
### Check out [masterqa_test_1.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test_1.py) to learn how to write your own MasterQA tests:
4040

4141
You'll notice that tests are written the same way as regular [SeleniumBase](https://seleniumbase.com) tests, with the key difference being a different import: ``from seleniumbase import MasterQA`` rather than ``from seleniumbase import BaseCase``. Now your Python test class will import ``MasterQA`` instead of ``BaseCase``.
4242

examples/my_first_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ def test_basic(self):
9090
#
9191
# 6. For backwards-compatibilty, some SeleniumBase methods that do the
9292
# same thing have multiple names, kept on from previous versions.
93-
# Ex: wait_for_element_visible() is the same as find_element().
93+
# Ex: self.wait_for_element() is the same as self.find_element().
9494
# Both search for and return the element, and raise an exception if
9595
# the element does not appear on the page within the timeout limit.
96-
# And assert_element() also does this (minus returning the element).
96+
# And self.assert_element() does this too (without returning it).
9797
#
9898
# 7. For the full method list, see one of the following:
9999
# * SeleniumBase/seleniumbase/fixtures/base_case.py

examples/offline_examples/test_demo_page.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import pytest
23
from seleniumbase import BaseCase
34

@@ -7,7 +8,11 @@ class OfflineTestClass(BaseCase):
78

89
def test_demo_page(self):
910
# Load a local html file into the browser
10-
self.load_html_file("demo_page.html")
11+
dir_name = os.path.dirname(os.path.abspath(__file__))
12+
self.load_html_file(dir_name + "/demo_page.html")
13+
14+
# Assert the title of the current web page
15+
self.assert_title("Web Testing Page")
1116

1217
# Assert that the element is visible on the page
1318
self.assert_element("tbody#tbodyId")
@@ -88,4 +93,7 @@ def test_demo_page(self):
8893
self.assert_link_text("SeleniumBase on GitHub")
8994

9095
# Assert the title of the current web page
91-
self.assert_title("Web Testing Page")
96+
self.assert_link_text("seleniumbase.com")
97+
self.assert_link_text("SeleniumBase on GitHub")
98+
self.assert_link_text("seleniumbase.io")
99+
self.assert_link_text("SeleniumBase Demo Page")

examples/test_apple_site.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*- coding: utf-8 -*-
12
from seleniumbase import BaseCase
23

34

examples/test_demo_site.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ class MyTestClass(BaseCase):
66
def test_demo_site(self):
77
self.open("https://seleniumbase.io/demo_page.html")
88

9+
# Assert the title of the current web page
10+
self.assert_title("Web Testing Page")
11+
912
# Assert that the element is visible on the page
1013
self.assert_element("tbody#tbodyId")
1114

@@ -80,9 +83,13 @@ def test_demo_site(self):
8083
self.assert_true(self.is_selected(".fBox"))
8184
self.switch_to_default_content()
8285

83-
# Assert link text - Use click_link_text() to click
86+
# Assert link text
8487
self.assert_link_text("seleniumbase.com")
8588
self.assert_link_text("SeleniumBase on GitHub")
89+
self.assert_link_text("seleniumbase.io")
8690

87-
# Assert the title of the current web page
88-
self.assert_title("Web Testing Page")
91+
# Click link text
92+
self.click_link_text("SeleniumBase Demo Page")
93+
94+
# Assert exact text
95+
self.assert_exact_text("Demo Page", "h1")

examples/test_skype_site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_skype_website_on_mobile(self):
1515
if not self.mobile_emulator:
1616
print("\n This test is only for mobile devices / emulators!")
1717
print(" (Usage: '--mobile' with a Chromium-based browser.)")
18-
self.skip("Please rerun this test using '--mobile!'!")
18+
self.skip("Please rerun this test using '--mobile' !!!")
1919
self.open("https://www.skype.com/en/")
2020
self.assert_text("Install Skype", "div.appInfo")
2121
self.highlight("div.appBannerContent")

examples/tour_examples/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class MyTourClass(BaseCase):
9494
self.play_tour()
9595
```
9696

97-
#### This example was taken from [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py), which you can run from the ``examples/tour_examples`` folder with the following command:
97+
#### This example is from [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py), which you can run from the ``examples/tour_examples`` folder with the following command:
9898

9999
```bash
100100
pytest google_tour.py

0 commit comments

Comments
 (0)