Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-nightly-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
fail-fast: false
max-parallel: 6
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-nightly-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
fail-fast: false
max-parallel: 6
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-nightly-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
fail-fast: false
max-parallel: 6
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
6 changes: 5 additions & 1 deletion examples/edge_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ def test_edge(self):
self.assert_text("Microsoft Edge", 'img[srcset*="logo"] + div')
self.highlight('img[srcset*="logo"] + div span:nth-of-type(1)')
self.highlight('img[srcset*="logo"] + div span:nth-of-type(2)')
self.highlight('span[aria-live="assertive"]')
if self.is_element_visible('span[aria-live="assertive"]'):
self.highlight('span[aria-live="assertive"]', loops=8)
elif self.is_element_visible('a[href*="fwlink"]'):
self.highlight('a[href*="fwlink"]', loops=8)
self.highlight('a[href*="chromium"]')
self.highlight('a[href*="credits"]')
41 changes: 39 additions & 2 deletions examples/presenter/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cd examples/presenter
pytest core_presentation.py
```


<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Creating a new presentation:</h3>

```python
Expand All @@ -59,7 +58,6 @@ If creating multiple presentations at the same time, you can pass the ``name`` p
Notes are disabled by default. You can enable notes by specifying:
``show_notes=True``


<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Adding a slide to a presentation:</h3>

```python
Expand Down Expand Up @@ -243,6 +241,45 @@ Presentations automatically get saved when calling:
self.begin_presentation(show_notes=True)
```

<h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="24" /> Special abilities:</h3>

If you want to highlight multiple lines at different times in the same slide with the `<mark>` / `</mark>` tags, you can use the new `<mk-0>`-`</mk-0>`, `<mk-1>`-`</mk-1>` tags, which will generate multiple HTML slides from one Python slide.

Example:

```python
self.add_slide(
code=(
<p><mk-0>Highlight this on the 1st generated slide</mk-0></p>
<p><mk-1>Highlight this on the 2nd generated slide</mk-1></p>
<p><mk-2>Highlight this on the 3rd generated slide</mk-2></p>
<p><mk-3>Highlight this on the 4th generated slide</mk-3></p>
)
)
```

Those should automatically get converted to `<mark>` ... `</mark>` on their turn:

Eg. First generated slide:

```html
<p><mark>Highlight this on the first generated slide</mark></p>
<p>Highlight this on the second generated slide</p>
<p>Highlight this on the third generated slide</p>
<p>Highlight this on the fourth generated slide></p>
```

Eg. Second generated slide:

```html
<p>Highlight this on the first generated slide</p>
<p><mark>Highlight this on the second generated slide</mark></p>
<p>Highlight this on the third generated slide</p>
<p>Highlight this on the fourth generated slide></p>
```

Etc...

--------

<h3 align="left"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="240" /></h3>
158 changes: 25 additions & 133 deletions examples/presenter/edge_presentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,12 @@ def test_presentation(self):
self.highlight(
'img[srcset*="logo"] + div span:nth-of-type(2)', loops=16
)
self.highlight('span[aria-live="assertive"]', loops=8)
if self.is_element_visible('span[aria-live="assertive"]'):
self.highlight('span[aria-live="assertive"]', loops=8)
elif self.is_element_visible('a[href*="fwlink"]'):
self.highlight('a[href*="fwlink"]', loops=8)
self.highlight('a[href*="chromium"]')
self.highlight('a[href*="credits"]')
self.quit_extra_driver()

self.switch_to_default_driver()
Expand Down Expand Up @@ -231,96 +235,16 @@ def test_presentation(self):
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"<mark>from selenium import webdriver</mark>\n\n"
"driver = webdriver.Edge()\n\n"
'driver.get("http://selenium.dev")\n\n'
"element = driver.find_element"
"<mk-0>from selenium import webdriver</mk-0>\n\n"
"<mk-1>driver = webdriver.Edge()</mk-1>\n\n"
'<mk-2>driver.get("http://selenium.dev")</mk-2>\n\n'
"<mk-3>element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()\n\n"
"elem_2 = driver.find_element"
"element.click()</mk-3>\n\n"
"<mk-4>elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")\n\n'
"driver.quit()\n\n"
),
)
self.add_slide(
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"from selenium import webdriver\n\n"
"<mark>driver = webdriver.Edge()</mark>\n\n"
'driver.get("http://selenium.dev")\n\n'
"element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()\n\n"
"elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")\n\n'
"driver.quit()\n\n"
),
)
self.add_slide(
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"from selenium import webdriver\n\n"
"driver = webdriver.Edge()\n\n"
'<mark>driver.get("http://selenium.dev")</mark>\n\n'
"element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()\n\n"
"elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")\n\n'
"driver.quit()\n\n"
),
)
self.add_slide(
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"from selenium import webdriver\n\n"
"driver = webdriver.Edge()\n\n"
'driver.get("http://selenium.dev")\n\n'
"<mark>element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()</mark>\n\n"
"elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")\n\n'
"driver.quit()\n\n"
),
)
self.add_slide(
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"from selenium import webdriver\n\n"
"driver = webdriver.Edge()\n\n"
'driver.get("http://selenium.dev")\n\n'
"element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()\n\n"
"<mark>elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")</mark>\n\n'
"driver.quit()\n\n"
),
)
self.add_slide(
"<p>What are some building blocks?</p>\n"
"<hr /><br />\n",
code=(
"from selenium import webdriver\n\n"
"driver = webdriver.Edge()\n\n"
'driver.get("http://selenium.dev")\n\n'
"element = driver.find_element"
'("css selector", "#docsearch span")\n\n'
"element.click()\n\n"
"elem_2 = driver.find_element"
'("css selector", "#docsearch-input")\n\n'
'elem_2.send_keys("Python")\n\n'
"<mark>driver.quit()</mark>\n\n"
'elem_2.send_keys("Python")</mk-4>\n\n'
"<mk-5>driver.quit()</mk-5>\n\n"
),
)
self.add_slide(
Expand Down Expand Up @@ -369,31 +293,17 @@ def test_presentation(self):
"without extra libraries or frameworks?</p><hr />"
"<p><br />\n"
"The command statements can get a bit too long:</p>\n"
"<p><code><mark>"
"<p><code><mk-0>"
"driver.find_element(By.CSS_SELECTOR, CSS_SELECTOR).click()"
"</code></mark></p><br />"
"</code></mk-0></p><br />"
"<p>This is better:</p>"
"<p><code>self.click(CSS_SELECTOR)</code><p><br />",
"<p><code><mk-1>self.click(CSS_SELECTOR)</mk-1></code><p><br />",
)
self.add_slide(
"<p>What are some disadvantages of using <b>raw</b> Selenium "
"without extra libraries or frameworks?</p><hr />"
"<p><br />\n"
"The command statements can get a bit too long:</p>\n"
"<p><code>"
"driver.find_element(By.CSS_SELECTOR, CSS_SELECTOR).click()"
"</code></p><br />"
"<p>This is better:</p>"
"<p><code><mark>self.click(CSS_SELECTOR)</mark></code><p><br />",
)
self.add_slide(
"<p>What are some disadvantages of using <b>raw</b> Selenium "
"without extra libraries or frameworks?</p><hr />"
"<br /><mark>\n"
"No HTML reports, dashboards, screenshots..."
"</mark><br />"
"<p>A test framework can provide those!</p>"
"<br />",
"without extra libraries or frameworks?</p><hr /><br />\n"
"<mark>No HTML reports, dashboards, screenshots...</mark><br />"
"<p>A test framework can provide those!</p><br />",
)
self.add_slide(
"<h6>Raw Selenium disadvantages, continued...</h6><hr />"
Expand All @@ -402,34 +312,16 @@ def test_presentation(self):
image="https://seleniumbase.io/cdn/img/dash_report.png",
)
self.add_slide(
"<p>Raw Selenium disadvantages, continued...</p><hr />\n"
"<br />\n"
"<p><mark>It takes multiple lines of code to do simple tasks:"
"</mark></p>\n"
"<pre>\n"
"<p>Raw Selenium disadvantages, continued...</p><hr />\n<br />\n"
"<p><mk-0>It takes multiple lines of code to do simple tasks:"
"</mk-0></p>\n<pre>\n"
'element = driver.find_element("css selector", "#password")\n'
"element.clear()\n"
'element.send_keys("secret_sauce")\n'
'element.submit()\n'
"</pre>\n"
"<br />\n"
"<p>But with a framework, do all that in ONE line:</p>\n"
'<pre>self.type("#password", "secret_sauce\\n")</pre>'
)
self.add_slide(
"<p>Raw Selenium disadvantages, continued...</p><hr />\n"
"<br />\n"
"<p>It takes multiple lines of code to do simple tasks:</p>\n"
"<pre>\n"
'element = driver.find_element("css selector", "#password")\n'
"element.clear()\n"
'element.send_keys("secret_sauce")\n'
'element.submit()\n'
"</pre>\n"
"<br />\n"
"<p><mark>But with a framework, do all that in ONE line:"
"</mark></p>\n"
'<pre>self.type("#password", "secret_sauce\\n")</pre>'
"</pre>\n<br />\n"
"<p><mk-1>But with a framework, do all that in ONE line:</mk-1>"
'</p>\n<pre>self.type("#password", "secret_sauce\\n")</pre>'
)
self.add_slide(
"<p>What else can test frameworks provide?</p><hr />\n"
Expand Down
Loading