Skip to content

Commit e7a1b2d

Browse files
authored
Merge pull request #835 from seleniumbase/improve-reuse-session-mode
Improve --reuse-session / --rs mode
2 parents 4754ab0 + 9d73814 commit e7a1b2d

File tree

13 files changed

+49
-29
lines changed

13 files changed

+49
-29
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Tests are run with "pytest". Browsers are controlled by WebDriver.
2828
<a href="#python_installation">🚀 Start</a> |
2929
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🗂️ Features</a> |
3030
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🖥️ CLI</a> |
31-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">👨‍🏫 Examples</a> |
31+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📖 Examples</a> |
3232
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Boilerplates</a> |
3333
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
3434
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/js_package_manager.md">🗄️ PkgManager</a>
@@ -50,9 +50,9 @@ Tests are run with "pytest". Browsers are controlled by WebDriver.
5050
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🛂 MasterQA</a>
5151
</p>
5252

53-
Get set up in minutes. Deploy anywhere.<br />
54-
Build Web-UI tests with a [complete API](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md).<br />
55-
Generate [test reports and dashboards](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).<br />
53+
Easy setup. Can run tests on any cloud.<br />
54+
Uses [Python APIs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md) for web automation.<br />
55+
Can generate [test reports / dashboards](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).<br />
5656

5757
--------
5858

azure-pipelines.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
- job: 'Test'
1010
pool:
11-
vmImage: 'Ubuntu-18.04'
11+
vmImage: 'Ubuntu-20.04'
1212
strategy:
1313
matrix:
1414
Python2.7:
@@ -37,36 +37,45 @@ jobs:
3737
- script: python -m pip install seleniumbase
3838
displayName: 'Verify install from PyPI'
3939

40-
- script: python -m pip install -r requirements.txt --upgrade
41-
displayName: 'Install dependencies'
40+
#- script: python -m pip install -r requirements.txt --upgrade
41+
# displayName: 'Install dependencies'
4242

43-
- script: python setup.py install
43+
- script: python -m pip install -e .
4444
displayName: 'Install SeleniumBase'
4545

4646
- script: |
4747
sudo apt install google-chrome-stable
48-
sudo apt-get install firefox
49-
displayName: 'Install Chrome and Firefox'
48+
displayName: 'Install Chrome'
49+
50+
#- script: |
51+
# sudo apt-get install firefox
52+
# displayName: 'Install Firefox'
5053

5154
- script: |
5255
seleniumbase
5356
sbase
5457
displayName: 'Check the console scripts interface'
5558
5659
- script: |
57-
seleniumbase install chromedriver latest
60+
seleniumbase install chromedriver
5861
displayName: 'Install chromedriver'
5962
6063
- script: |
6164
echo "def test_1(): pass" > nothing.py
6265
pytest nothing.py
6366
displayName: 'Make sure pytest is working'
6467
68+
#- script: python -m pytest examples/unit_tests/verify_framework.py
69+
# displayName: 'Run pytest verify_framework.py'
70+
6571
- script: python -m pytest examples/boilerplates/boilerplate_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
6672
displayName: 'Run pytest boilerplate_test.py --browser=chrome --headless'
6773

68-
- script: python -m pytest examples/test_demo_site.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
69-
displayName: 'Run pytest test_demo_site.py --browser=chrome --headless'
74+
#- script: python -m pytest examples/boilerplates/boilerplate_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
75+
# displayName: 'Run pytest boilerplate_test.py --browser=firefox --headless'
76+
77+
#- script: python -m pytest examples/test_demo_site.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
78+
# displayName: 'Run pytest test_demo_site.py --browser=chrome --headless'
7079

7180
#- script: python -m pytest examples/my_first_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
7281
# displayName: 'Run pytest my_first_test.py --browser=chrome --headless'

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
regex>=2020.11.13
2-
tqdm>=4.58.0
2+
tqdm>=4.59.0
33
livereload==2.6.3;python_version>="3.6"
44
joblib==1.0.1;python_version>="3.6"
55
Markdown==3.3.4

examples/boilerplates/samples/test_page_objects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def click_search_result(self, sb, content):
1818
class SeleniumBaseGitHubPage():
1919

2020
def click_seleniumbase_io_link(self, sb):
21+
sb.wait_for_ready_state_complete()
2122
sb.js_click('a[href*="seleniumbase.io"]')
2223
sb.wait_for_ready_state_complete()
2324
current_url = sb.get_current_url()

examples/example_logs/ReadMe.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Logging, Dashboards, and Reports:</h3>
22

3-
(Log files in [SeleniumBase/examples/example_logs](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/example_logs) were generated when [test_fail.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py) ran and failed.)
3+
[<img src="http://img.youtube.com/vi/XpuJCjJhJwQ/0.jpg" title="SeleniumBase Features" width="285">](https://www.youtube.com/watch?v=XpuJCjJhJwQ)
4+
<p>(<b><a href="https://www.youtube.com/watch?v=XpuJCjJhJwQ">SB Dashboard Tutorial on YouTube</a></b>)</p>
45

56
🔵 During test failures, logs and screenshots from the most recent test run will get saved to the ``latest_logs/`` folder. If ``--archive-logs`` is specified (or if ARCHIVE_EXISTING_LOGS is set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py)), test logs will also get archived to the ``archived_logs/`` folder. Otherwise, the log files will be cleaned out when the next test run begins (by default).
67

78
```bash
89
pytest test_fail.py
910
```
1011

12+
(Log files in [SeleniumBase/examples/example_logs](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/example_logs) were generated when [test_fail.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_fail.py) ran and failed.)
13+
1114
<b>Examples of expected log files generated during failures:</b>
1215
<ul>
1316
<li><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/basic_test_info.txt">basic_test_info.txt</a></li>

examples/translations/french_test_1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ def test_exemple_1(self):
88
self.ouvrir("https://fr.wikipedia.org/wiki/")
99
self.vérifier_texte("Wikipédia") # noqa
1010
self.vérifier_élément('[alt="Wikipédia"]')
11-
self.taper("#searchInput", "Crème brûlée")
12-
self.cliquer("#searchButton")
11+
self.js_taper("#searchform input", "Crème brûlée")
12+
self.cliquer("#searchform button")
1313
self.vérifier_texte("Crème brûlée", "#firstHeading")
1414
self.vérifier_élément('img[alt*="Crème brûlée"]')
15-
self.taper("#searchInput", "Jardin des Tuileries")
16-
self.cliquer("#searchButton")
15+
self.taper("#searchform input", "Jardin des Tuileries")
16+
self.cliquer("#searchform button")
1717
self.vérifier_texte("Jardin des Tuileries", "#firstHeading")
1818
self.vérifier_élément('img[alt*="Jardin des Tuileries"]')
1919
self.retour()

help_docs/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a href="https://seleniumbase.io/help_docs/customizing_test_runs/">🖥️ CLI</a> |
88
<a href="https://seleniumbase.io/help_docs/features_list/">🗂️ Features</a>
99
<br />
10-
<a href="https://seleniumbase.io/examples/ReadMe/">👨‍🏫 Examples</a> |
10+
<a href="https://seleniumbase.io/examples/ReadMe/">📖 Examples</a> |
1111
<a href="https://seleniumbase.io/help_docs/mobile_testing/">📱 Mobile</a>
1212
<br />
1313
<a href="https://seleniumbase.io/help_docs/syntax_formats/">🔡 Syntax Formats</a> |

help_docs/features_list.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

33
[<img src="http://img.youtube.com/vi/Sjzq9kU5kOw/0.jpg" title="SeleniumBase Features" width="285">](https://www.youtube.com/watch?v=Sjzq9kU5kOw)
4-
<p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the tutorial on YouTube</a></b>)</p>
4+
<p>(<b><a href="https://www.youtube.com/watch?v=Sjzq9kU5kOw">Watch the SB tutorial on YouTube!</a></b>)</p>
55

66
<a id="feature_list"></a>
77
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> ⛲ Features: 🗂️</h2>
@@ -37,4 +37,5 @@
3737
* Can load and make assertions on PDF files from websites or the local file system.
3838
* Includes useful [Python decorators and password obfuscation methods](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/common/ReadMe.md).
3939

40-
[<img src="https://seleniumbase.io/cdn/img/super_logo_3.png" title="SeleniumBase" width="285">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
40+
[<img src="http://img.youtube.com/vi/yEQeAU_mrg0/0.jpg" title="SeleniumBase Features" width="285">](https://www.youtube.com/watch?v=yEQeAU_mrg0)
41+
<p>(<b><a href="https://www.youtube.com/watch?v=yEQeAU_mrg0">See a quick overview on YouTube!</a></b>)</p>

help_docs/method_summary.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Method Summary (API Reference)</h2>
44

5-
Here's a summary of SeleniumBase method definitions, which are defined in [base_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py)
5+
[<img src="http://img.youtube.com/vi/_yNJlHnp2JA/0.jpg" title="SeleniumBase Features" width="285">](https://www.youtube.com/watch?v=_yNJlHnp2JA)
6+
<p>(<b><a href="https://www.youtube.com/watch?v=_yNJlHnp2JA">Common API Methods on YouTube</a></b>)</p>
67

7-
For backwards compatibility, older versions of method names have remained to keep older scripts working. *(Ex: wait_for_element_visible was later shortened to wait_for_element and then to find_element. Also, add_text and send_keys are the same, etc.)*
8+
Here's a list of SeleniumBase method definitions, which are defined in [base_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py)
9+
10+
For backwards compatibility, older versions of method names have remained to keep older scripts working. *(E.g: wait_for_element_visible was shortened to wait_for_element and then to find_element.)*
811

912
```python
1013
self.open(url)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pip>=21.0.1;python_version>="3.6"
33
packaging>=20.9
44
setuptools>=44.1.1;python_version<"3.5"
55
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
6-
setuptools>=54.0.0;python_version>="3.6"
6+
setuptools>=54.1.0;python_version>="3.6"
77
setuptools-scm>=5.0.2
88
wheel>=0.36.2
99
attrs>=20.3.0

0 commit comments

Comments
 (0)