from seleniumbase import BaseCase


class MyChartMakerClass(BaseCase):

    def test_seleniumbase_chart(self):
        self.create_presentation(theme="league", transition="slide")
        self.create_pie_chart(title="There are 4 core areas of SeleniumBase:")
        self.add_data_point("Basic API (Test methods/functions)", 1)
        self.add_data_point("Command-line Options (pytest Options)", 1)
        self.add_data_point("The Console Scripts interface", 1)
        self.add_data_point("Advanced API (Tours, Charts, & Presentations)", 1)
        self.add_slide("<p>SeleniumBase core areas</p>" + self.extract_chart())
        self.add_slide(
            "<p>Basic API (Test methods/functions) Example</p>",
            code=(
                'from seleniumbase import BaseCase\n\n'
                'class MyTestClass(BaseCase):\n\n'
                '    def test_basic(self):\n'
                '        self.open("https://store.xkcd.com/search")\n'
                '        self.type(\'input[name="q"]\', "xkcd book\\n")\n'
                '        self.assert_text("xkcd book", "div.results")\n'
                '        self.open("https://xkcd.com/353/")\n'
                '        self.click(\'a[rel="license"]\')\n'
                '        self.go_back()\n'
                '        self.click_link_text("About")\n'
                '        self.click_link_text("comic #249")\n'
                '        self.assert_element(\'img[alt*="Chess"]\')\n'))
        self.add_slide(
            "<p>Command-line Options Example</p>",
            code=(
                '$ pytest my_first_test.py\n'
                '$ pytest test_swag_labs.py --mobile\n'
                '$ pytest edge_test.py --browser=edge\n'
                '$ pytest basic_test.py --headless\n'
                '$ pytest my_first_test.py --demo\n'
                '$ pytest basic_test.py --slow\n'
                '$ pytest -v -m marker2 --headless --save-screenshot\n'
                '$ pytest test_suite.py --reuse-session --html=report.html\n'
                '$ pytest basic_test.py --incognito\n'
                '$ pytest parameterized_test.py --guest --reuse-session\n'))
        self.add_slide(
            "<p>Console scripts interface Example</p>",
            code=(
                '$ sbase install chromedriver\n'
                '$ sbase install chromedriver latest\n'
                '$ sbase mkdir new_test_folder\n'
                '$ sbase mkfile new_test.py\n'
                '$ sbase print basic_test.py -n\n'
                '$ sbase translate basic_test.py -p --chinese -n\n'
                '$ sbase translate basic_test.py -p --japanese\n'
                '$ sbase translate basic_test.py -c --russian\n'
                '$ sbase download server\n'
                '$ sbase grid-hub start\n'
                '$ sbase grid-node start --hub="127.0.0.1"\n'
                '$ sbase grid-node stop\n'
                '$ sbase grid-hub stop\n'
                '$ sbase options\n'))
        self.add_slide(
            '<p>Advanced API (creating a presentation) Example</p>',
            code=(
                'from seleniumbase import BaseCase\n\n'
                'class MyPresenterClass(BaseCase):\n\n'
                '    def test_presenter(self):\n'
                '        self.create_presentation(theme="serif")\n'
                '        self.add_slide("Welcome to Presenter!")\n'
                '        self.add_slide(\n'
                '            "Add code to slides:",\n'
                '            code=(\n'
                '                "from seleniumbase import BaseCase\\n\\n"\n'
                '                "class MyPresenterClass(BaseCase):\\n\\n"\n'
                '                "    def test_presenter(self):\\n"\n'
                '                "        self.create_presentation()\\n"))\n'
                '        self.begin_presentation(\n'
                '            filename="demo.html", show_notes=True)'))
        self.add_slide(
            '<p><b>The End</b></p>',
            image="https://seleniumbase.io/cdn/img/sb_logo_g.png")
        self.begin_presentation(filename="core_presentation.html")

@@ -213,22 +213,16 @@
 tle=%22The
-re are
  4 core 
@@ -278,33 +278,33 @@
 int(%22Basic API (
-T
+t
 est methods/func
@@ -298,26 +298,16 @@
  methods
-/functions
 )%22, 1)%0A 
@@ -343,25 +343,25 @@
 ommand-line 
-O
+o
 ptions (pyte
@@ -363,17 +363,17 @@
 (pytest 
-O
+o
 ptions)%22
@@ -652,17 +652,17 @@
 ic API (
-T
+t
 est meth
@@ -668,27 +668,18 @@
 hods
-/functions
 )
+.
  Example
 %3C/p%3E
@@ -666,32 +666,38 @@
 ethods). Example
+ test:
 %3C/p%3E%22,%0A         
@@ -1496,23 +1496,24 @@
 ine 
-O
+o
 ptions
+.
  Example
 %3C/p%3E
@@ -1500,32 +1500,34 @@
 options. Example
+s:
 %3C/p%3E%22,%0A         
@@ -1798,16 +1798,24 @@
 y --demo
+ --guest
 %5Cn'%0A    
@@ -1962,18 +1962,26 @@
 est 
-test_suite
+parameterized_test
 .py 
@@ -1995,16 +1995,59 @@
 -session
+%5Cn'%0A                '$ pytest test_suite.py
  --html=
@@ -2057,16 +2057,21 @@
 ort.html
+ --rs
 %5Cn'%0A    
@@ -2096,108 +2096,234 @@
 est 
-basic_test.py --incognito%5Cn'%0A                '$ pytest parameterized_test.py --guest --reuse-session
+test_suite.py --dashboard --html=report.html%5Cn'%0A                '$ pytest github_test.py --demo --disable-csp%5Cn'%0A                '$ pytest test_suite.py -n=2 --rs --crumbs%5Cn'%0A                '$ pytest basic_test.py --incognito
 %5Cn')
@@ -2364,24 +2364,28 @@
     %22%3Cp%3E
+The 
 Console 
 scripts 
@@ -2376,17 +2376,17 @@
 Console 
-s
+S
 cripts i
@@ -2393,24 +2393,25 @@
 nterface
+.
  Example
 %3C/p%3E%22,%0A 
@@ -2398,24 +2398,26 @@
 ace. Example
+s:
 %3C/p%3E%22,%0A     
@@ -3210,42 +3210,30 @@
  API
- (creating a presentation) E
+. %22Presenter%22 e
 xample
+:
 %3C/p%3E

Update a presentation generator