diff --git a/README.md b/README.md index d1facbe5d89..418be4f3561 100755 --- a/README.md +++ b/README.md @@ -6,21 +6,22 @@
+-Build fast, reliable, end-to-end tests. +End-to-end testing for the next generation.
-
-
-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.
-
+
Pie Chart
" + 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("Bar Chart
" + 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") diff --git a/examples/chart_maker/pie_charts.py b/examples/chart_maker/pie_charts.py new file mode 100755 index 00000000000..abdf6e1fc2f --- /dev/null +++ b/examples/chart_maker/pie_charts.py @@ -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("Lemon Meringue Pie
" + 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("Blueberry Pie
" + 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("Fruit Tart Pie
" + 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("Apple Pie
" + 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("Boston Cream Pie
" + self.extract_chart()) + + self.begin_presentation(filename="pie_charts.html") diff --git a/examples/chart_maker/test_display_chart.py b/examples/chart_maker/test_display_chart.py index 994a0a2828d..d40772b0344 100755 --- a/examples/chart_maker/test_display_chart.py +++ b/examples/chart_maker/test_display_chart.py @@ -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") diff --git a/help_docs/chart_maker.md b/help_docs/chart_maker.md index addc15296b9..64930305745 100755 --- a/help_docs/chart_maker.md +++ b/help_docs/chart_maker.md @@ -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. """ ``` @@ -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. """ ``` @@ -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. """ ``` @@ -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. """ ``` @@ -231,7 +243,8 @@ 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). @@ -239,6 +252,8 @@ self.create_area_chart( 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. """ ``` diff --git a/help_docs/method_summary.md b/help_docs/method_summary.md index 670b80552bd..7a3d6fde3b4 100755 --- a/help_docs/method_summary.md +++ b/help_docs/method_summary.md @@ -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) @@ -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) diff --git a/requirements.txt b/requirements.txt index ba3ae4f5727..734156ad7be 100755 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ pip>=21.0.1;python_version>="3.6" packaging>=20.9 setuptools>=44.1.1;python_version<"3.5" setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6" -setuptools>=54.1.1;python_version>="3.6" +setuptools>=54.1.2;python_version>="3.6" setuptools-scm>=5.0.2 wheel>=0.36.2 attrs>=20.3.0 @@ -33,7 +33,6 @@ py==1.10.0;python_version>="3.5" pytest==4.6.11;python_version<"3.5" pytest==6.1.2;python_version>="3.5" and python_version<"3.6" pytest==6.2.2;python_version>="3.6" -pytest-cov==2.11.1 pytest-forked==1.3.0 pytest-html==1.22.1;python_version<"3.6" pytest-html==2.0.1;python_version>="3.6" @@ -59,7 +58,7 @@ pygments==2.8.1;python_version>="3.5" traitlets==4.3.3;python_version<"3.7" traitlets==5.0.5;python_version>="3.7" prompt-toolkit==1.0.18;python_version<"3.6" -prompt-toolkit==3.0.16;python_version>="3.6" +prompt-toolkit==3.0.17;python_version>="3.6" ipython==5.10.0;python_version<"3.5" ipython==6.5.0;python_version>="3.5" and python_version<"3.6" ipython==7.16.1;python_version>="3.6" and python_version<"3.7" @@ -70,7 +69,6 @@ importlib-metadata==2.0.0;python_version<"3.6" virtualenv>=20.4.2 pymysql==0.10.1;python_version<"3.6" pymysql==1.0.2;python_version>="3.6" -coverage==5.5 brython==3.9.1 pyotp==2.6.0 boto==2.49.0 @@ -80,13 +78,21 @@ Pillow==6.2.2;python_version<"3.5" Pillow==7.2.0;python_version>="3.5" and python_version<"3.6" Pillow==8.1.2;python_version>="3.6" rich==9.13.0;python_version>="3.6" and python_version<"4.0" -flake8==3.7.9;python_version<"3.5" -flake8==3.8.4;python_version>="3.5" -pyflakes==2.1.1;python_version<"3.5" -pyflakes==2.2.0;python_version>="3.5" tornado==5.1.1;python_version<"3.5" tornado==6.1;python_version>="3.5" allure-pytest==2.8.22;python_version<"3.5" allure-pytest==2.8.36;python_version>="3.5" pdfminer.six==20191110;python_version<"3.5" pdfminer.six==20201018;python_version>="3.5" + +# --- Testing Requirements --- # +# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.) + +coverage==5.5 +pytest-cov==2.11.1 +flake8==3.7.9;python_version<"3.5" +flake8==3.9.0;python_version>="3.5" +pyflakes==2.1.1;python_version<"3.5" +pyflakes==2.3.0;python_version>="3.5" +pycodestyle==2.5.0;python_version<"3.5" +pycodestyle==2.7.0;python_version>="3.5" diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index bb7931bac96..11609779dfc 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "1.57.1" +__version__ = "1.58.0" diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 2ea66acbafc..e5599ef0968 100755 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -4003,7 +4003,7 @@ def save_presentation( '\n' '\n' '\n' '