Skip to content

Commit 2e2cd71

Browse files
committed
Update the docs
1 parent 209a41a commit 2e2cd71

File tree

5 files changed

+216
-208
lines changed

5 files changed

+216
-208
lines changed

examples/chart_maker/ReadMe.md

Lines changed: 92 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SeleniumBase Chart Maker allows you to create HTML charts with Python. (Using Hi
88

99
([Click to see a presentation with multiple charts](https://seleniumbase.io/other/chart_presentation.html))
1010

11-
Here's how to run the example presentation with a pie chart from [GitHub => seleniumbase/SeleniumBase/examples/chart_maker](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/chart_maker):
11+
Here's how to run a simple pie chart presentation from [GitHub => seleniumbase/SeleniumBase/examples/chart_maker](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/chart_maker):
1212

1313
```bash
1414
cd examples/chart_maker
@@ -31,7 +31,7 @@ class MyChartMakerClass(BaseCase):
3131
self.begin_presentation(filename="my_chart.html")
3232
```
3333

34-
Here's how to run an example presentation with multiple charts: (Press the right arrow to advance to the next slide)
34+
Here's how to run an example presentation with multiple charts:
3535

3636
```bash
3737
cd examples/chart_maker
@@ -53,7 +53,92 @@ 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-
### Creating new charts:
56+
### Here's a line chart example:
57+
58+
```python
59+
from seleniumbase import BaseCase
60+
61+
class MyChartMakerClass(BaseCase):
62+
def test_chart_maker(self):
63+
self.create_presentation()
64+
self.create_line_chart(
65+
title="Time Outside", subtitle="Last Week", unit="Minutes")
66+
self.add_data_point("Sun", 5)
67+
self.add_data_point("Mon", 10)
68+
self.add_data_point("Tue", 20)
69+
self.add_data_point("Wed", 40)
70+
self.add_data_point("Thu", 80)
71+
self.add_data_point("Fri", 65)
72+
self.add_data_point("Sat", 50)
73+
self.add_slide("<p>Line Chart</p>" + self.extract_chart())
74+
self.begin_presentation(filename="line_chart.html", interval=8)
75+
```
76+
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:
78+
79+
```bash
80+
pytest test_line_chart.py
81+
```
82+
83+
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.)
84+
85+
86+
### For a more advanced example (multiple charts in a presentation):
87+
88+
```python
89+
from seleniumbase import BaseCase
90+
91+
class MyChartMakerClass(BaseCase):
92+
93+
def test_chart_maker_presentation(self):
94+
self.create_presentation(theme="sky")
95+
96+
self.create_pie_chart(title="Automated Tests")
97+
self.add_data_point("Passed", 7, color="#95d96f")
98+
self.add_data_point("Untested", 2, color="#eaeaea")
99+
self.add_data_point("Failed", 1, color="#f1888f")
100+
self.add_slide("<p>Pie Chart</p>" + self.extract_chart())
101+
102+
self.create_bar_chart(title="Language", libs=False)
103+
self.add_data_point("Python", 33, color="Orange")
104+
self.add_data_point("JavaScript", 27, color="Teal")
105+
self.add_data_point("HTML + CSS", 21, color="Purple")
106+
self.add_slide("<p>Bar Chart</p>" + self.extract_chart())
107+
108+
self.create_column_chart(title="Colors", libs=False)
109+
self.add_data_point("Red", 10, color="Red")
110+
self.add_data_point("Green", 25, color="Green")
111+
self.add_data_point("Blue", 15, color="Blue")
112+
self.add_slide("<p>Column Chart</p>" + self.extract_chart())
113+
114+
self.create_line_chart(title="Last Week's Data", libs=False)
115+
self.add_data_point("Sun", 5)
116+
self.add_data_point("Mon", 10)
117+
self.add_data_point("Tue", 20)
118+
self.add_data_point("Wed", 40)
119+
self.add_data_point("Thu", 80)
120+
self.add_data_point("Fri", 65)
121+
self.add_data_point("Sat", 50)
122+
self.add_slide("<p>Line Chart</p>" + self.extract_chart())
123+
124+
self.begin_presentation(filename="chart_presentation.html")
125+
```
126+
127+
Here's how to run that example:
128+
129+
```bash
130+
cd examples/chart_maker
131+
pytest chart_presentation.py
132+
```
133+
134+
(Press the Right Arrow to advance to the next slide in that chart presentation)
135+
136+
([Click to see a live example of that presentation](https://seleniumbase.io/other/chart_presentation.html))
137+
138+
Multi-Series charts can also be created. Try the available examples to learn more.
139+
140+
141+
## Chart Maker API
57142

58143
```python
59144
self.create_pie_chart(
@@ -151,8 +236,8 @@ self.create_area_chart(
151236
zero - If True, the y-axis always starts at 0. (Default: False).
152237
libs - The option to include Chart libraries (JS and CSS files).
153238
Should be set to True (default) for the first time creating
154-
a chart on a web page. If creating multiple charts on
155-
a web page, you no longer need to re-import the libraries
239+
a chart on a web page. If creating multiple charts on the
240+
same web page, you won't need to re-import the libraries
156241
when creating additional charts.
157242
"""
158243
```
@@ -176,6 +261,7 @@ self.add_data_point(label, value, color=None, chart_name=None):
176261
"""
177262
```
178263

264+
179265
### Adding a new data series to an existing chart:
180266

181267
```python
@@ -233,88 +319,4 @@ self.display_chart(chart_name=None, filename=None):
233319
"""
234320
```
235321

236-
All methods have the optional ``chart_name`` argument, which is only needed if you're creating multiple charts at the same time.
237-
238-
239-
### Here's an example of using SeleniumBase Chart Maker:
240-
241-
```python
242-
from seleniumbase import BaseCase
243-
244-
class MyChartMakerClass(BaseCase):
245-
def test_chart_maker(self):
246-
self.create_presentation()
247-
self.create_line_chart(
248-
title="Time Outside", subtitle="Last Week", unit="Minutes")
249-
self.add_data_point("Sun", 5)
250-
self.add_data_point("Mon", 10)
251-
self.add_data_point("Tue", 20)
252-
self.add_data_point("Wed", 40)
253-
self.add_data_point("Thu", 80)
254-
self.add_data_point("Fri", 65)
255-
self.add_data_point("Sat", 50)
256-
self.add_slide("<p>Line Chart</p>" + self.extract_chart())
257-
self.begin_presentation(filename="line_chart.html", interval=8)
258-
```
259-
260-
#### 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:
261-
262-
```bash
263-
pytest test_line_chart.py
264-
```
265-
266-
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.)
267-
268-
### For a more advanced example (multiple charts in a presentation):
269-
270-
```python
271-
from seleniumbase import BaseCase
272-
273-
class MyChartMakerClass(BaseCase):
274-
275-
def test_chart_maker_presentation(self):
276-
self.create_presentation(theme="sky")
277-
278-
self.create_pie_chart(title="Automated Tests")
279-
self.add_data_point("Passed", 7, color="#95d96f")
280-
self.add_data_point("Untested", 2, color="#eaeaea")
281-
self.add_data_point("Failed", 1, color="#f1888f")
282-
self.add_slide("<p>Pie Chart</p>" + self.extract_chart())
283-
284-
self.create_bar_chart(title="Language", libs=False)
285-
self.add_data_point("Python", 33, color="Orange")
286-
self.add_data_point("JavaScript", 27, color="Teal")
287-
self.add_data_point("HTML + CSS", 21, color="Purple")
288-
self.add_slide("<p>Bar Chart</p>" + self.extract_chart())
289-
290-
self.create_column_chart(title="Colors", libs=False)
291-
self.add_data_point("Red", 10, color="Red")
292-
self.add_data_point("Green", 25, color="Green")
293-
self.add_data_point("Blue", 15, color="Blue")
294-
self.add_slide("<p>Column Chart</p>" + self.extract_chart())
295-
296-
self.create_line_chart(title="Last Week's Data", libs=False)
297-
self.add_data_point("Sun", 5)
298-
self.add_data_point("Mon", 10)
299-
self.add_data_point("Tue", 20)
300-
self.add_data_point("Wed", 40)
301-
self.add_data_point("Thu", 80)
302-
self.add_data_point("Fri", 65)
303-
self.add_data_point("Sat", 50)
304-
self.add_slide("<p>Line Chart</p>" + self.extract_chart())
305-
306-
self.begin_presentation(filename="chart_presentation.html")
307-
```
308-
309-
Here's how to run that example:
310-
311-
```bash
312-
cd examples/chart_maker
313-
pytest chart_presentation.py
314-
```
315-
316-
(Press the Right Arrow to advance to the next slide in that chart presentation)
317-
318-
([Click to see a live example of that presentation](https://seleniumbase.io/other/chart_presentation.html))
319-
320-
Multi-Series charts can also be created. Try the available examples to learn more.
322+
All methods have the optional ``chart_name`` argument, which is only needed when storing multiple charts at the same time.

help_docs/ReadMe.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<div><a href="https://seleniumbase.io/help_docs/features_list/"><b>Features List</b></a></div>
88
<div><a href="https://seleniumbase.io/help_docs/customizing_test_runs/"><b>Command Line Tutorial</b></a></div>
99
<div><a href="https://seleniumbase.io/examples/ReadMe/"><b>Usage Examples</b></a></div>
10+
<div><a href="https://seleniumbase.io/demo_page"><b>Demo Page for Tests</b></a></div>
1011
<div><a href="https://seleniumbase.io/help_docs/how_it_works/"><b>How SeleniumBase Works</b></a></div>
1112
<div><a href="https://seleniumbase.io/help_docs/install_python_pip_git/"><b>Installing Python, Pip, & Git</b></a></div>
1213
<div><a href="https://seleniumbase.io/help_docs/virtualenv_instructions/"><b>Python Virtual Env Tutorial</b></a></div>
@@ -19,6 +20,8 @@
1920
<div><a href="https://seleniumbase.io/help_docs/translations/"><b>Language Translations</b></a></div>
2021
<div><a href="https://seleniumbase.io/help_docs/js_package_manager/"><b>JS Package Manager</b></a></div>
2122
<div><a href="https://seleniumbase.io/examples/tour_examples/ReadMe/"><b>Tour Examples</b></a></div>
23+
<div><a href="https://seleniumbase.io/examples/presenter/ReadMe/"><b>Presentation Maker</b></a></div>
24+
<div><a href="https://seleniumbase.io/help_docs/chart_maker/"><b>Chart Maker</b></a></div>
2225
<div><a href="https://seleniumbase.io/help_docs/mysql_installation/"><b>MySQL Installation Overview</b></a></div>
2326
<div><a href="https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/"><b>Using the Selenium Grid</b></a></div>
2427
<div><a href="https://seleniumbase.io/help_docs/desired_capabilities/"><b>Browser Desired Capabilities</b></a></div>
@@ -30,27 +33,29 @@
3033

3134
<h3>GitHub Pages ToC (<a href="https://seleniumbase.com">seleniumbase.com</a>)</h3>
3235

33-
<div><a href="https://seleniumbase.com/help_docs/features_list.html"><b>Features List</b></a></div>
34-
<div><a href="https://seleniumbase.com/help_docs/customizing_test_runs.html"><b>Command Line Tutorial</b></a></div>
36+
<div><a href="https://seleniumbase.com/help_docs/features_list"><b>Features List</b></a></div>
37+
<div><a href="https://seleniumbase.com/help_docs/customizing_test_runs"><b>Command Line Tutorial</b></a></div>
3538
<div><a href="https://seleniumbase.com/examples/"><b>Usage Examples</b></a></div>
36-
<div><a href="https://seleniumbase.com/help_docs/how_it_works.html"><b>How SeleniumBase Works</b></a></div>
37-
<div><a href="https://seleniumbase.com/help_docs/install_python_pip_git.html"><b>Installing Python, Pip, & Git</b></a></div>
38-
<div><a href="https://seleniumbase.com/help_docs/virtualenv_instructions.html"><b>Python Virtual Env Tutorial</b></a></div>
39-
<div><a href="https://seleniumbase.com/help_docs/install.html"><b>SeleniumBase Installation</b></a></div>
40-
<div><a href="https://seleniumbase.com/help_docs/webdriver_installation.html"><b>Webdriver Installation</b></a></div>
41-
<div><a href="https://seleniumbase.com/help_docs/verify_webdriver.html"><b>Verify Webdriver Works</b></a></div>
39+
<div><a href="https://seleniumbase.com/help_docs/how_it_works"><b>How SeleniumBase Works</b></a></div>
40+
<div><a href="https://seleniumbase.com/help_docs/install_python_pip_git"><b>Installing Python, Pip, & Git</b></a></div>
41+
<div><a href="https://seleniumbase.com/help_docs/virtualenv_instructions"><b>Python Virtual Env Tutorial</b></a></div>
42+
<div><a href="https://seleniumbase.com/help_docs/install"><b>SeleniumBase Installation</b></a></div>
43+
<div><a href="https://seleniumbase.com/help_docs/webdriver_installation"><b>Webdriver Installation</b></a></div>
44+
<div><a href="https://seleniumbase.com/help_docs/verify_webdriver"><b>Verify Webdriver Works</b></a></div>
4245
<div><a href="https://seleniumbase.com/seleniumbase/console_scripts/"><b>Console Scripts Tutorial</b></a></div>
43-
<div><a href="https://seleniumbase.com/help_docs/mobile_testing.html"><b>Mobile Device Testing</b></a></div>
44-
<div><a href="https://seleniumbase.com/help_docs/method_summary.html"><b>Method Summary (API Ref)</b></a></div>
45-
<div><a href="https://seleniumbase.com/help_docs/translations.html"><b>Language Translations</b></a></div>
46-
<div><a href="https://seleniumbase.com/help_docs/js_package_manager.html"><b>JS Package Manager</b></a></div>
46+
<div><a href="https://seleniumbase.com/help_docs/mobile_testing"><b>Mobile Device Testing</b></a></div>
47+
<div><a href="https://seleniumbase.com/help_docs/method_summary"><b>Method Summary (API Ref)</b></a></div>
48+
<div><a href="https://seleniumbase.com/help_docs/translations"><b>Language Translations</b></a></div>
49+
<div><a href="https://seleniumbase.com/help_docs/js_package_manager"><b>JS Package Manager</b></a></div>
4750
<div><a href="https://seleniumbase.com/examples/tour_examples/"><b>Tour Examples</b></a></div>
48-
<div><a href="https://seleniumbase.com/help_docs/mysql_installation.html"><b>MySQL Installation Overview</b></a></div>
51+
<div><a href="https://seleniumbase.com/examples/presenter/"><b>Presentation Maker</b></a></div>
52+
<div><a href="https://seleniumbase.com/help_docs/chart_maker"><b>Chart Maker</b></a></div>
53+
<div><a href="https://seleniumbase.com/help_docs/mysql_installation"><b>MySQL Installation Overview</b></a></div>
4954
<div><a href="https://seleniumbase.com/seleniumbase/utilities/selenium_grid/"><b>Using the Selenium Grid</b></a></div>
50-
<div><a href="https://seleniumbase.com/help_docs/desired_capabilities.html"><b>Browser Desired Capabilities</b></a></div>
51-
<div><a href="https://seleniumbase.com/help_docs/using_safari_driver.html"><b>Safari Driver Detailed Info</b></a></div>
52-
<div><a href="https://seleniumbase.com/help_docs/hidden_files_info.html"><b>Seeing Hidden Files on macOS</b></a></div>
53-
<div><a href="https://seleniumbase.com/help_docs/happy_customers.html"><b>Case Studies</b></a></div>
55+
<div><a href="https://seleniumbase.com/help_docs/desired_capabilities"><b>Browser Desired Capabilities</b></a></div>
56+
<div><a href="https://seleniumbase.com/help_docs/using_safari_driver"><b>Safari Driver Detailed Info</b></a></div>
57+
<div><a href="https://seleniumbase.com/help_docs/hidden_files_info"><b>Seeing Hidden Files on macOS</b></a></div>
58+
<div><a href="https://seleniumbase.com/help_docs/happy_customers"><b>Case Studies</b></a></div>
5459

5560
--------
5661

0 commit comments

Comments
 (0)