Skip to content

Commit a1f33e0

Browse files
authored
Merge pull request #644 from seleniumbase/update-translations-and-more
Add Presenter slide transitions, and more
2 parents d4c890e + d5c6755 commit a1f33e0

32 files changed

+712
-78
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ python -m pip install -U pip
6464
```bash
6565
git clone https://github.com/seleniumbase/SeleniumBase.git
6666
cd SeleniumBase/
67-
pip install -r requirements.txt
68-
python setup.py install
67+
pip install .
6968
```
70-
If multiple versions of Python are installed, be specific (E.g. use ``python3`` instead of ``python``).
7169

7270
* You can also install ``seleniumbase`` from [pypi](https://pypi.python.org/pypi/seleniumbase).
7371
```bash

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
livereload==2.6.2;python_version>="3.6"
22
mkdocs==1.1.2
3-
mkdocs-material==5.5.0
3+
mkdocs-material==5.5.1
44
mkdocs-simple-hooks==0.1.1
55
mkdocs-material-extensions==1.0
66
mkdocs-minify-plugin==0.3.0

examples/chart_maker/ReadMe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ SeleniumBase Chart Maker allows you to create HTML charts with Python. (HighChar
1010

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

13-
Here's how to run the example presentation with a pie chart from [github.com/seleniumbase/SeleniumBase/tree/master/examples/chart_maker](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/chart_maker):
13+
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):
1414

1515
```bash
1616
cd examples/chart_maker
1717
pytest my_chart.py
1818
```
1919

20-
Here's the code for that pie chart presentation ([github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/my_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/my_chart.py)):
20+
Here's the code for that pie chart presentation ([GitHub => seleniumbase/SeleniumBase/examples/chart_maker/my_chart.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/my_chart.py)):
2121

2222
```python
2323
from seleniumbase import BaseCase

examples/chart_maker/chart_presentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class MyChartMakerClass(BaseCase):
55

66
def test_chart_maker_presentation(self):
7-
self.create_presentation(theme="sky")
7+
self.create_presentation(theme="sky", transition="zoom")
88

99
self.create_pie_chart(title="Automated Tests")
1010
self.add_data_point("Passed", 7, color="#95d96f")

examples/presenter/ReadMe.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pytest my_presentation.py
2323
### Creating a new presentation:
2424

2525
```python
26-
self.create_presentation(name=None, theme="serif")
26+
self.create_presentation(name=None, theme="serif", transition="default")
2727
""" Creates a Reveal-JS presentation that you can add slides to.
2828
@Params
2929
name - If creating multiple presentations at the same time,
@@ -32,6 +32,9 @@ self.create_presentation(name=None, theme="serif")
3232
Valid themes: "serif" (default), "sky", "white", "black",
3333
"simple", "league", "moon", "night",
3434
"beige", "blood", and "solarized".
35+
transition - Set a transition between slides.
36+
Valid transitions: "none" (default), "slide", "fade",
37+
"zoom", "convex", and "concave".
3538
"""
3639
```
3740

@@ -44,7 +47,7 @@ Notes are disabled by default. You can enable notes by specifying:
4447

4548
```python
4649
self.add_slide(content=None, image=None, code=None, iframe=None,
47-
content2=None, notes=None, name=None)
50+
content2=None, notes=None, transition=None, name=None)
4851
""" Allows the user to add slides to a presentation.
4952
@Params
5053
content - The HTML content to display on the presentation slide.
@@ -55,6 +58,9 @@ self.add_slide(content=None, image=None, code=None, iframe=None,
5558
content2 - HTML content to display after adding an image or code.
5659
notes - Additional notes to include with the slide.
5760
ONLY SEEN if show_notes is set for the presentation.
61+
transition - Set a transition between slides. (overrides previous)
62+
Valid transitions: "none" (default), "slide", "fade",
63+
"zoom", "convex", and "concave".
5864
name - If creating multiple presentations at the same time,
5965
use this to select the presentation to add slides to.
6066
"""

examples/presenter/my_presentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class MyPresenterClass(BaseCase):
55

66
def test_presenter(self):
7-
self.create_presentation(theme="serif")
7+
self.create_presentation(theme="serif", transition="none")
88
self.add_slide(
99
'<h1>Welcome</h1><br />\n'
1010
'<h3>Press the <b>Right Arrow</b></h3>')

examples/test_deferred_asserts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class MyTestClass(BaseCase):
1313
def test_deferred_asserts(self):
1414
self.open('https://xkcd.com/993/')
1515
self.wait_for_element('#comic')
16+
print("\n(This test fails on purpose)")
1617
self.deferred_assert_element('img[alt="Brand Identity"]')
1718
self.deferred_assert_element('img[alt="Rocket Ship"]') # Will Fail
1819
self.deferred_assert_element('#comicmap')

examples/test_xfail.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
""" Testing the @pytest.mark.xfail marker.
2+
https://docs.pytest.org/en/latest/skipping.html
3+
(The test is expected to fail, but don't fail the entire build for it.)
4+
"""
5+
6+
import pytest
7+
from seleniumbase import BaseCase
8+
9+
10+
class MyTestClass(BaseCase):
11+
12+
@pytest.mark.xfail
13+
def test_xfail(self):
14+
self.open("https://xkcd.com/376/")
15+
self.sleep(1) # Time to read the comic
16+
self.fail("There is a known bug here!")

examples/timeout_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ class MyTestClass(BaseCase):
1515
def test_time_limit_feature(self):
1616
self.set_time_limit(5) # Fail test if time exceeds 5 seconds
1717
self.open("https://xkcd.com/1658/")
18+
print("\n(This test fails on purpose)")
1819
self.sleep(7)

examples/tour_examples/ReadMe.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ SeleniumBase Tours utilize 5 JavaScript libraries for creating interactive walkt
77
**Example tour:**
88

99
<img src="https://cdn2.hubspot.net/hubfs/100006/google_tour_3.gif" title="SeleniumBase Tour of Google"><br>
10-
```
10+
11+
```bash
1112
cd examples/tour_examples
1213
pytest google_tour.py
1314
```
1415

16+
(From [GitHub => SeleniumBase/examples/tour_examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples))
17+
1518

1619
### Creating a new tour:
1720

0 commit comments

Comments
 (0)