Skip to content

Commit 8065254

Browse files
committed
Update the docs
1 parent b02e820 commit 8065254

File tree

7 files changed

+60
-34
lines changed

7 files changed

+60
-34
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ class MyTestClass(BaseCase):
122122

123123
def test_basic(self):
124124
self.open("https://store.xkcd.com/search")
125-
self.type('input[name="q"]', "xkcd book\n")
125+
self.type('input[name="q"]', "xkcd book")
126+
self.click('input[value="Search"]')
126127
self.assert_text("xkcd: volume 0", "h3")
127128
self.open("https://xkcd.com/353/")
128129
self.assert_title("xkcd: Python")
@@ -132,6 +133,8 @@ class MyTestClass(BaseCase):
132133
self.go_back()
133134
self.click_link_text("About")
134135
self.assert_exact_text("xkcd.com", "h2")
136+
self.click_link_text("geohashing")
137+
self.assert_element("#comic img")
135138
```
136139

137140
* By default, **[CSS Selectors](https://www.w3schools.com/cssref/css_selectors.asp)** are used for finding page elements.
@@ -470,7 +473,7 @@ pytest proxy_test.py --proxy=proxy1
470473

471474
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Changing the User-Agent:</h3>
472475

473-
If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
476+
If you wish to change the User-Agent for your browser tests (Chromium and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
474477

475478
```bash
476479
pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU"
@@ -805,6 +808,8 @@ Additionally, you can use the ``@retry_on_exception()`` decorator to specificall
805808
<div><b>If you like us, give us a star!</b></div>
806809
<div><a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=888CFA" title="Stargazers" /></a></div>
807810
</p>
811+
<div><!--not_for_site--><iframe src="https://seleniumbase.io/" style="width:92%;height:450px;" title="iframe content"></iframe></div>
812+
<div><!--not_for_site--><iframe src="https://seleniumbase.io/help_docs/ReadMe/" style="width:92%;height:580px;" title="iframe content"></iframe></div>
808813
<p><div><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></div></p>
809814

810815
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb.png" title="SeleniumBase" width="290" /></a></div>

docs/prepare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ def main(*args, **kwargs):
115115
'title="SeleniumBase" width="20" /> SeleniumBase Docs '
116116
'<img src="https://seleniumbase.io/img/sb_icon.png" '
117117
'title="SeleniumBase" width="20" /></h2>')
118+
if "<!--not_for_site--><iframe" in line and "</iframe>" in line:
119+
changed = True
120+
line = ("")
118121
seleniumbase_lines.append(line)
119122
if changed:
120123
out_file = codecs.open(readme_file, "w+", encoding='utf-8')

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
livereload==2.6.3;python_version>="3.6"
22
pymdown-extensions==8.0
33
mkdocs==1.1.2
4-
mkdocs-material==5.5.7
4+
mkdocs-material==5.5.8
55
mkdocs-simple-hooks==0.1.1
66
mkdocs-material-extensions==1.0
77
mkdocs-minify-plugin==0.3.0

examples/chart_maker/ReadMe.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h3 align="left"><img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb23.png" alt="SeleniumBase" width="290" /></h3>
22

3-
# 📊 Chart Maker 📊
3+
<h3> 📊 Chart Maker 📊 </h3>
44

55
SeleniumBase Chart Maker allows you to create HTML charts with Python. (Using HighCharts JS)
66

@@ -53,7 +53,7 @@ Here are screenshots from the examples:
5353
<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>
5454

5555

56-
### Here's a line chart example:
56+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Here's a line chart example:</h3>
5757

5858
```python
5959
from seleniumbase import BaseCase
@@ -74,7 +74,7 @@ class MyChartMakerClass(BaseCase):
7474
self.begin_presentation(filename="line_chart.html", interval=8)
7575
```
7676

77-
#### This example is from [test_line_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/test_line_chart.py), which you can run from the ``examples/chart_maker`` folder with the following command:
77+
This example is from [test_line_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/test_line_chart.py), which you can run from the ``examples/chart_maker`` folder with the following command:
7878

7979
```bash
8080
pytest test_line_chart.py
@@ -83,7 +83,7 @@ pytest test_line_chart.py
8383
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.)
8484

8585

86-
### For a more advanced example (multiple charts in a presentation):
86+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> For a more advanced example (multiple charts in a presentation):</h3>
8787

8888
```python
8989
from seleniumbase import BaseCase
@@ -138,7 +138,7 @@ pytest chart_presentation.py
138138
Multi-Series charts can also be created. Try the available examples to learn more.
139139

140140

141-
## Chart Maker API
141+
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Chart Maker API</h2>
142142

143143
```python
144144
self.create_pie_chart(
@@ -245,7 +245,7 @@ self.create_area_chart(
245245
If creating multiple charts at the same time, you can pass the ``chart_name`` parameter to distinguish between different charts.
246246

247247

248-
### Adding a data point to a chart:
248+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Adding a data point to a chart:</h3>
249249

250250
```python
251251
self.add_data_point(label, value, color=None, chart_name=None):
@@ -262,7 +262,7 @@ self.add_data_point(label, value, color=None, chart_name=None):
262262
```
263263

264264

265-
### Adding a new data series to an existing chart:
265+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Adding a new data series to an existing chart:</h3>
266266

267267
```python
268268
self.add_series_to_chart(self, data_name=None, chart_name=None):
@@ -276,7 +276,7 @@ self.add_series_to_chart(self, data_name=None, chart_name=None):
276276
```
277277

278278

279-
### Saving a chart to a file:
279+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Saving a chart to a file:</h3>
280280

281281
```python
282282
self.save_chart(chart_name=None, filename=None):
@@ -292,7 +292,7 @@ self.save_chart(chart_name=None, filename=None):
292292
The full HTML of the chart is saved to the ``saved_charts/`` folder.
293293

294294

295-
### Extracting the HTML of a chart:
295+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Extracting the HTML of a chart:</h3>
296296

297297
```python
298298
self.extract_chart(chart_name=None):
@@ -304,7 +304,7 @@ self.extract_chart(chart_name=None):
304304
```
305305

306306

307-
### Displaying a chart in the browser window:
307+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Displaying a chart in the browser window:</h3>
308308

309309
```python
310310
self.display_chart(chart_name=None, filename=None):

examples/presenter/ReadMe.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
11
<h3 align="left"><img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb23.png" alt="SeleniumBase" width="290" /></h3>
22

3-
# 📰 Presenter 📰
3+
<h1> 📰 Presenter 📰 </h1>
44

5-
SeleniumBase Presenter allows you to create HTML presentations with Python.<br />
6-
The Reveal-JS library is used for running the presentations.
5+
<b>SeleniumBase Presenter allows you to create HTML presentations with Python.</b><br />
6+
(The "Reveal-JS" library is used for running the presentations.)
77

88
**Here's a sample presentation:**
99

1010
<a href="https://seleniumbase.io/other/presenter.html"><img width="500" src="https://seleniumbase.io/other/presenter.gif" title="Screenshot"></a><br>
1111

1212
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/presenter.html))
1313

14+
([Here's the code for that presentation](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/my_presentation.py))
15+
1416
Slides can include HTML, code, images, and iframes.
1517

1618
Here's how to run the example presentation:
17-
```
19+
20+
```bash
1821
cd examples/presenter
1922
pytest my_presentation.py
2023
```
2124

25+
**Here's a presentation with a chart:**
26+
27+
<a href="https://seleniumbase.io/other/core_presentation.html"><img width="428" src="https://seleniumbase.io/other/sb_core_areas.png" title="Screenshot"></a><br>
28+
29+
([Click on the image/GIF for the actual presentation](https://seleniumbase.io/other/core_presentation.html))
30+
31+
([Here's the code for that presentation](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/core_presentation.py))
32+
33+
Here's how to run that example:
34+
35+
```bash
36+
cd examples/presenter
37+
pytest core_presentation.py
38+
```
39+
2240

23-
### Creating a new presentation:
41+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Creating a new presentation:</h3>
2442

2543
```python
2644
self.create_presentation(name=None, theme="serif", transition="default")
@@ -43,7 +61,7 @@ Notes are disabled by default. You can enable notes by specifying:
4361
``show_notes=True``
4462

4563

46-
### Adding a slide to a presentation:
64+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Adding a slide to a presentation:</h3>
4765

4866
```python
4967
self.add_slide(content=None, image=None, code=None, iframe=None,
@@ -67,7 +85,7 @@ self.add_slide(content=None, image=None, code=None, iframe=None,
6785
```
6886

6987

70-
### Running a presentation:
88+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Running a presentation:</h3>
7189

7290
```python
7391
self.begin_presentation(
@@ -90,7 +108,7 @@ Before the presentation is run, the full HTML is saved to the ``saved_presentati
90108

91109
All methods have the optional ``name`` argument, which is only needed if you're creating multiple presentations at once.
92110

93-
### Here's an example of using SeleniumBase Presenter:
111+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Here's an example of using SeleniumBase Presenter:</h3>
94112

95113
```python
96114
from seleniumbase import BaseCase
@@ -209,13 +227,13 @@ class MyPresenterClass(BaseCase):
209227
filename="presenter.html", show_notes=True, interval=0)
210228
```
211229

212-
#### This example is from [my_presentation.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/my_presentation.py), which you can run from the ``examples/presenter`` folder with the following command:
230+
That example is from [my_presentation.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/presenter/my_presentation.py), which you can run from the ``examples/presenter`` folder with the following command:
213231

214232
```bash
215233
pytest my_presentation.py
216234
```
217235

218-
### Saving a presentation:
236+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Saving a presentation:</h3>
219237

220238
If you want to save the presentation you created as an HTML file, use:
221239

help_docs/chart_maker.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h3 align="left"><img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_sb23.png" alt="SeleniumBase" width="290" /></h3>
22

3-
# 📊 Chart Maker 📊
3+
<h3> 📊 Chart Maker 📊 </h3>
44

55
SeleniumBase Chart Maker allows you to create HTML charts with Python. (Using HighCharts JS)
66

@@ -53,7 +53,7 @@ Here are screenshots from the examples:
5353
<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>
5454

5555

56-
### Here's a line chart example:
56+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Here's a line chart example:</h3>
5757

5858
```python
5959
from seleniumbase import BaseCase
@@ -74,7 +74,7 @@ class MyChartMakerClass(BaseCase):
7474
self.begin_presentation(filename="line_chart.html", interval=8)
7575
```
7676

77-
#### This example is from [test_line_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/test_line_chart.py), which you can run from the ``examples/chart_maker`` folder with the following command:
77+
This example is from [test_line_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/test_line_chart.py), which you can run from the ``examples/chart_maker`` folder with the following command:
7878

7979
```bash
8080
pytest test_line_chart.py
@@ -83,7 +83,7 @@ pytest test_line_chart.py
8383
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.)
8484

8585

86-
### For a more advanced example (multiple charts in a presentation):
86+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> For a more advanced example (multiple charts in a presentation):</h3>
8787

8888
```python
8989
from seleniumbase import BaseCase
@@ -138,7 +138,7 @@ pytest chart_presentation.py
138138
Multi-Series charts can also be created. Try the available examples to learn more.
139139

140140

141-
## Chart Maker API
141+
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Chart Maker API</h2>
142142

143143
```python
144144
self.create_pie_chart(
@@ -245,7 +245,7 @@ self.create_area_chart(
245245
If creating multiple charts at the same time, you can pass the ``chart_name`` parameter to distinguish between different charts.
246246

247247

248-
### Adding a data point to a chart:
248+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Adding a data point to a chart:</h3>
249249

250250
```python
251251
self.add_data_point(label, value, color=None, chart_name=None):
@@ -262,7 +262,7 @@ self.add_data_point(label, value, color=None, chart_name=None):
262262
```
263263

264264

265-
### Adding a new data series to an existing chart:
265+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Adding a new data series to an existing chart:</h3>
266266

267267
```python
268268
self.add_series_to_chart(self, data_name=None, chart_name=None):
@@ -276,7 +276,7 @@ self.add_series_to_chart(self, data_name=None, chart_name=None):
276276
```
277277

278278

279-
### Saving a chart to a file:
279+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Saving a chart to a file:</h3>
280280

281281
```python
282282
self.save_chart(chart_name=None, filename=None):
@@ -292,7 +292,7 @@ self.save_chart(chart_name=None, filename=None):
292292
The full HTML of the chart is saved to the ``saved_charts/`` folder.
293293

294294

295-
### Extracting the HTML of a chart:
295+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Extracting the HTML of a chart:</h3>
296296

297297
```python
298298
self.extract_chart(chart_name=None):
@@ -304,7 +304,7 @@ self.extract_chart(chart_name=None):
304304
```
305305

306306

307-
### Displaying a chart in the browser window:
307+
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="24" /> Displaying a chart in the browser window:</h3>
308308

309309
```python
310310
self.display_chart(chart_name=None, filename=None):

help_docs/how_it_works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<a id="how_seleniumbase_works"></a>
44
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> How it works:</h2>
55

6-
At the core, SeleniumBase works by extending [pytest](https://docs.pytest.org/en/latest/) as a direct plugin. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the [BaseCase class](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Tests are also given access to [SeleniumBase command-line arguments](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/pytest_plugin.py) and [SeleniumBase methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md), which provide additional functionality.
6+
At the core, SeleniumBase works by extending [pytest](https://docs.pytest.org/en/latest/) as a direct plugin. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the [BaseCase class](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py). Tests are also given access to [SeleniumBase command-line arguments](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) and [SeleniumBase methods](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md), which provide additional functionality.
77

88
(NOTE: pytest uses a feature called test discovery to automatically find and run Python methods that start with "``test_``" from the file that you specified on the command line.)
99

0 commit comments

Comments
 (0)