Skip to content

Updates for ChartMaker, Traffic-generator, refactoring, and more #840

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 15, 2021
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@
<link rel="icon" href="https://seleniumbase.io/img/logo6.png" />

<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/">
<img src="https://seleniumbase.io/img/sb_logo_10.png" alt="SeleniumBase" title="SeleniumBase" width="280" /></a></p>
<img src="https://seleniumbase.io/cdn/img/sb_logo_gs.png" alt="SeleniumBase" title="SeleniumBase" width="500" /></a></p>
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/releases">
<img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=2277EE" alt="Latest Release on GitHub" /></a> <a href="https://pypi.python.org/pypi/seleniumbase">
<img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=22AAEE" alt="Latest Release on PyPI" /></a></p>
<p align="center">
<b>Build fast, reliable, end-to-end tests.</b>
<b>End-to-end testing for the next generation.</b>
</p>

<!-- View on GitHub -->
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/releases">
<img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=2277EE" alt="Latest Release on GitHub" /></a> <a href="https://pypi.python.org/pypi/seleniumbase">
<img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=22AAEE" alt="Latest Release on PyPI" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions">
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/actions">
<img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://dev.azure.com/seleniumbase/seleniumbase/_build/latest?definitionId=1&branchName=master"> <img src="https://dev.azure.com/seleniumbase/seleniumbase/_apis/build/status/seleniumbase.SeleniumBase?branchName=master" alt="SeleniumBase Azure Pipelines" /></a> <a href="https://gitter.im/seleniumbase/SeleniumBase">
<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="SeleniumBase" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a> <a href="https://seleniumbase.io">
<img src="https://img.shields.io/badge/docs-%20seleniumbase.io-22BBAA.svg" alt="SeleniumBase.io Docs" /></a></p>

<p>
SeleniumBase is a Python framework for web automation, end-to-end testing, and more.
SeleniumBase is a Python framework for fast and reliable web automation and testing.
Tests are run with "pytest". Browsers are controlled by WebDriver.
</p>

Expand Down Expand Up @@ -50,9 +51,8 @@ Tests are run with "pytest". Browsers are controlled by WebDriver.
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🛂 MasterQA</a>
</p>

✅ Easy setup. Can run tests on any cloud.<br />
✅ Uses [Python APIs](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md) for web automation.<br />
✅ Can generate [test reports / dashboards](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).<br />
✅ Fast setup: All you need is [Python](https://www.python.org/downloads/)! 🐍<br />
✅ Includes [reporting & dashboard tools](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md).<br />

--------

Expand Down
41 changes: 28 additions & 13 deletions examples/chart_maker/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,16 @@ self.create_pie_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -170,13 +173,16 @@ self.create_bar_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -190,13 +196,16 @@ self.create_column_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -210,14 +219,17 @@ self.create_line_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
zero - If True, the y-axis always starts at 0. (Default: False).
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -231,14 +243,17 @@ self.create_area_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
zero - If True, the y-axis always starts at 0. (Default: False).
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand Down
6 changes: 3 additions & 3 deletions examples/chart_maker/chart_presentation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from seleniumbase import BaseCase


class MyChartMakerClass(BaseCase):
class ChartMakerPresentation(BaseCase):

def test_chart_maker_presentation(self):
self.create_presentation(theme="sky", transition="zoom")
Expand All @@ -12,13 +12,13 @@ def test_chart_maker_presentation(self):
self.add_data_point("Failed", 1, color="#f1888f")
self.add_slide("<p>Pie Chart</p>" + self.extract_chart())

self.create_bar_chart(title="Language", libs=False)
self.create_bar_chart(title="Language", libs=False, legend=False)
self.add_data_point("Python", 33, color="Orange")
self.add_data_point("JavaScript", 27, color="Teal")
self.add_data_point("HTML + CSS", 21, color="Purple")
self.add_slide("<p>Bar Chart</p>" + self.extract_chart())

self.create_column_chart(title="Colors", libs=False)
self.create_column_chart(title="Colors", libs=False, legend=False)
self.add_data_point("Red", 10, color="Red")
self.add_data_point("Green", 25, color="Green")
self.add_data_point("Blue", 15, color="Blue")
Expand Down
45 changes: 45 additions & 0 deletions examples/chart_maker/pie_charts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from seleniumbase import BaseCase


class PieCharts(BaseCase):

def test_pie_charts(self):
self.create_presentation(theme="serif", transition="convex")

self.create_pie_chart(labels=False)
self.add_data_point("Meringue Cream", 3, color="#f1eeea")
self.add_data_point("Lemon Filling", 3, color="#e9d655")
self.add_data_point("Graham Cracker Crust", 1, color="#9d5b34")
self.add_slide("<p>Lemon Meringue Pie</p>" + self.extract_chart())

self.create_pie_chart(labels=False)
self.add_data_point("Blueberries", 1, color="#5c81b7")
self.add_data_point("Blueberry Filling", 2, color="#12405e")
self.add_data_point("Golden Brown Crust", 1, color="#cd7b54")
self.add_slide("<p>Blueberry Pie</p>" + self.extract_chart())

self.create_pie_chart(labels=False)
self.add_data_point("Strawberries", 1, color="#ff282c")
self.add_data_point("Kiwis", 1, color="#a9c208")
self.add_data_point("Apricots", 1, color="#f47a14")
self.add_data_point("Raspberries", 1, color="#b10019")
self.add_data_point("Black Berries", 1, color="#44001e")
self.add_data_point("Blueberries", 1, color="#5c81b7")
self.add_data_point("Custard", 3, color="#eee896")
self.add_data_point("Golden Crust", 4, color="#dca422")
self.add_slide("<p>Fruit Tart Pie</p>" + self.extract_chart())

self.create_pie_chart(labels=False)
self.add_data_point("Apple Crust", 4, color="#b66327")
self.add_data_point("Apple Filling", 5, color="#c5903e")
self.add_data_point("Cinnamon", 1, color="#76210d")
self.add_data_point("Whipped Cream", 2, color="#f2f2f2")
self.add_slide("<p>Apple Pie</p>" + self.extract_chart())

self.create_pie_chart(labels=False)
self.add_data_point("Sponge Cake", 4, color="#e0d5a0")
self.add_data_point("Custard", 3, color="#eee896")
self.add_data_point("Chocolate", 1, color="#5c3625")
self.add_slide("<p>Boston Cream Pie</p>" + self.extract_chart())

self.begin_presentation(filename="pie_charts.html")
4 changes: 2 additions & 2 deletions examples/chart_maker/test_display_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def test_display_chart(self):
self.add_data_point("Failed", 1, color="#f1888f")
self.display_chart(filename="pie_chart.html", interval=2.5)

self.create_bar_chart(title="Bar Chart")
self.create_bar_chart(title="Bar Chart", legend=False)
self.add_data_point("Python", 33, color="Orange")
self.add_data_point("JavaScript", 27, color="Teal")
self.add_data_point("HTML + CSS", 21, color="Purple")
self.display_chart(filename="bar_chart.html", interval=2.5)

self.create_column_chart(title="Column Chart")
self.create_column_chart(title="Column Chart", legend=False)
self.add_data_point("Red", 10, color="Red")
self.add_data_point("Green", 25, color="Green")
self.add_data_point("Blue", 15, color="Blue")
Expand Down
41 changes: 28 additions & 13 deletions help_docs/chart_maker.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,16 @@ self.create_pie_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -170,13 +173,16 @@ self.create_bar_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -190,13 +196,16 @@ self.create_column_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -210,14 +219,17 @@ self.create_line_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
zero - If True, the y-axis always starts at 0. (Default: False).
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on
a web page, you no longer need to re-import the libraries
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand All @@ -231,14 +243,17 @@ self.create_area_chart(
use this to select which one.
title - The title displayed for the chart.
subtitle - The subtitle displayed for the chart.
data_name - Set the series name. Useful for multi-series charts.
data_name - The series name. Useful for multi-series charts.
If no data_name, will default to using "Series 1".
unit - The description label given to the chart's y-axis values.
zero - If True, the y-axis always starts at 0. (Default: False).
libs - The option to include Chart libraries (JS and CSS files).
Should be set to True (default) for the first time creating
a chart on a web page. If creating multiple charts on the
same web page, you won't need to re-import the libraries
when creating additional charts.
labels - If True, displays labels on the chart for data points.
legend - If True, displays the data point legend on the chart.
"""
```

Expand Down
19 changes: 12 additions & 7 deletions help_docs/method_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,24 @@ self.begin_presentation(name=None, filename=None, show_notes=False, interval=0)
############

self.create_pie_chart(chart_name=None, title=None, subtitle=None,
data_name=None, unit=None, libs=True)
data_name=None, unit=None, libs=True,
labels=True, legend=True)

self.create_bar_chart(chart_name=None, title=None, subtitle=None,
data_name=None, unit=None, libs=True)
data_name=None, unit=None, libs=True,
labels=True, legend=True)

self.create_column_chart(chart_name=None, title=None, subtitle=None,
data_name=None, unit=None, libs=True)
data_name=None, unit=None, libs=True,
labels=True, legend=True)

self.create_line_chart(chart_name=None, title=None, subtitle=None,
data_name=None, unit=None, zero=False, libs=True)
data_name=None, unit=None, zero=False, libs=True,
labels=True, legend=True)

self.create_area_chart(chart_name=None, title=None, subtitle=None,
data_name=None, unit=None, zero=False, libs=True)
data_name=None, unit=None, zero=False, libs=True,
labels=True, legend=True)

self.add_series_to_chart(data_name=None, chart_name=None)

Expand Down Expand Up @@ -465,9 +470,9 @@ self.set_messenger_theme(theme="default", location="default",

############

self.generate_referral(start_page, destination_page)
self.generate_referral(start_page, destination_page, selector=None)

self.generate_traffic(start_page, destination_page, loops=1)
self.generate_traffic(start_page, destination_page, loops=1, selector=None)

self.generate_referral_chain(pages)

Expand Down
Loading