Skip to content

Commit 3459aa9

Browse files
committed
Update the docs
1 parent 5d7f586 commit 3459aa9

File tree

8 files changed

+268
-2
lines changed

8 files changed

+268
-2
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ mkdocs-material==7.3.4;python_version>="3.6"
2424
mkdocs-exclude-search==0.5.2;python_version>="3.6"
2525
mkdocs-simple-hooks==0.1.3
2626
mkdocs-material-extensions==1.0.3;python_version>="3.6"
27-
mkdocs-minify-plugin==0.4.1
27+
mkdocs-minify-plugin==0.5.0

examples/example_logs/ReadMe.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[<img src="https://seleniumbase.io/cdn/img/sb_logo_10t.png" title="SeleniumBase" width="240">](https://github.com/seleniumbase/SeleniumBase/)
2+
13
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Logs, The Dashboard, and Reports:</h3>
24

35
<!-- YouTube View --><a href="https://www.youtube.com/watch?v=XpuJCjJhJwQ"><img src="http://img.youtube.com/vi/XpuJCjJhJwQ/0.jpg" title="SeleniumBase on YouTube" width="285" /></a>

help_docs/ReadMe.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
<div><a href="https://seleniumbase.io/help_docs/webdriver_installation/"><b>Webdriver Installation</b></a></div>
5252
<div><a href="https://seleniumbase.io/help_docs/verify_webdriver/"><b>Verify Webdriver Works</b></a></div>
5353
<div><a href="https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/"><b>Console Scripts Tutorial</b></a></div>
54+
<div><a href="https://seleniumbase.io/examples/example_logs/ReadMe/"><b>The Dashboard</b></a></div>
55+
<div><a href="https://seleniumbase.io/help_docs/recorder_mode/"><b>Recorder Mode</b></a></div>
5456
<div><a href="https://seleniumbase.io/help_docs/syntax_formats/"><b>Syntax Formats</b></a></div>
5557
<div><a href="https://seleniumbase.io/help_docs/mobile_testing/"><b>Mobile Device Testing</b></a></div>
5658
<div><a href="https://seleniumbase.io/help_docs/method_summary/"><b>Method Summary (API Ref)</b></a></div>
@@ -95,6 +97,8 @@
9597
<div><a href="https://seleniumbase.dev/help_docs/webdriver_installation"><b>Webdriver Installation</b></a></div>
9698
<div><a href="https://seleniumbase.dev/help_docs/verify_webdriver"><b>Verify Webdriver Works</b></a></div>
9799
<div><a href="https://seleniumbase.dev/seleniumbase/console_scripts/"><b>Console Scripts Tutorial</b></a></div>
100+
<div><a href="https://seleniumbase.dev/examples/example_logs/"><b>The Dashboard</b></a></div>
101+
<div><a href="https://seleniumbase.dev/help_docs/recorder_mode"><b>Recorder Mode</b></a></div>
98102
<div><a href="https://seleniumbase.dev/help_docs/syntax_formats"><b>Syntax Formats</b></a></div>
99103
<div><a href="https://seleniumbase.dev/help_docs/mobile_testing"><b>Mobile Device Testing</b></a></div>
100104
<div><a href="https://seleniumbase.dev/help_docs/method_summary"><b>Method Summary (API Ref)</b></a></div>

help_docs/method_summary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,4 +710,4 @@ self._print(TEXT) # Calls Python's print() / Allows for translations
710710
* [test_tinymce.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_tinymce.py)
711711
* And many more...
712712

713-
[<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
713+
[<img src="https://seleniumbase.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="280">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)

help_docs/recorder_mode.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class RecorderTest(BaseCase):
7676

7777
<p>🔴 SeleniumBase <code>2.0.1</code> adds the ability to preview selectors via the page title when hovering over elements. It also fixes an issue that may occur when opening up new URLs while in Recorder Mode.</p>
7878

79+
<p>🔴 SeleniumBase <code>2.0.2</code> fixes a bug with Recorder Mode that was preventing the last recorded assert on a domain from being saved unless it was followed by a non-assert recorded action on the same domain.</p>
80+
7981
--------
8082

8183
<div>To learn more about SeleniumBase, check out the Docs Site:</div>

integrations/katalon/ReadMe.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,89 @@ seleniumbase convert MY_TEST.py
2121
```
2222

2323
* You should see a [MY_TEST_SB.py] file appear in the folder. (``_SB`` is added to the file name so that the original file stays intact in case you still need it.) This new clean & reliable SeleniumBase test script is ready to be added into your test suite for running.
24+
25+
--------
26+
27+
--------
28+
29+
The following is an example of a Katalon Recorder exported file (**WebDriver + unittest format**).
30+
It is **messy** and has **unnecessary lines of code** to do the task that was recorded:
31+
32+
```python
33+
# -*- coding: utf-8 -*-
34+
from selenium import webdriver
35+
from selenium.webdriver.common.by import By
36+
from selenium.webdriver.common.keys import Keys
37+
from selenium.webdriver.support.ui import Select
38+
from selenium.common.exceptions import NoSuchElementException
39+
from selenium.common.exceptions import NoAlertPresentException
40+
import unittest, time, re
41+
42+
class Swag(unittest.TestCase):
43+
def setUp(self):
44+
self.driver = webdriver.Firefox()
45+
self.driver.implicitly_wait(30)
46+
self.base_url = "https://www.google.com/"
47+
self.verificationErrors = []
48+
self.accept_next_alert = True
49+
50+
def test_swag(self):
51+
driver = self.driver
52+
driver.get("https://www.saucedemo.com/")
53+
driver.find_element_by_id("user-name").click()
54+
driver.find_element_by_id("user-name").clear()
55+
driver.find_element_by_id("user-name").send_keys("standard_user")
56+
driver.find_element_by_id("password").click()
57+
driver.find_element_by_id("password").clear()
58+
driver.find_element_by_id("password").send_keys("secret_sauce")
59+
driver.find_element_by_id("login-button").click()
60+
61+
def is_element_present(self, how, what):
62+
try: self.driver.find_element(by=how, value=what)
63+
except NoSuchElementException as e: return False
64+
return True
65+
66+
def is_alert_present(self):
67+
try: self.driver.switch_to_alert()
68+
except NoAlertPresentException as e: return False
69+
return True
70+
71+
def close_alert_and_get_its_text(self):
72+
try:
73+
alert = self.driver.switch_to_alert()
74+
alert_text = alert.text
75+
if self.accept_next_alert:
76+
alert.accept()
77+
else:
78+
alert.dismiss()
79+
return alert_text
80+
finally: self.accept_next_alert = True
81+
82+
def tearDown(self):
83+
self.driver.quit()
84+
self.assertEqual([], self.verificationErrors)
85+
86+
if __name__ == "__main__":
87+
unittest.main()
88+
```
89+
90+
<div><b>This can be improved on...</b></div>
91+
92+
<b>After running <code>seleniumbase convert [FILE.py]</code> on it, here is the new result:</b>
93+
94+
```python
95+
# -*- coding: utf-8 -*-
96+
from seleniumbase import BaseCase
97+
98+
99+
class Swag(BaseCase):
100+
101+
def test_swag(self):
102+
self.open('https://www.saucedemo.com/')
103+
self.type('#user-name', 'standard_user')
104+
self.type('#password', 'secret_sauce')
105+
self.click('#login-button')
106+
```
107+
108+
<b>This is much cleaner than the original version.
109+
It also uses the more reliable SeleniumBase methods.</b>

integrations/selenium_ide/ReadMe.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,89 @@ seleniumbase convert MY_TEST.py
2121
```
2222

2323
* You should see a [MY_TEST_SB.py] file appear in the folder. (``_SB`` is added to the file name so that the original file stays intact in case you still need it.) This new clean & reliable SeleniumBase test script is ready to be added into your test suite for running.
24+
25+
--------
26+
27+
--------
28+
29+
The following is an example of a Katalon Recorder exported file (**WebDriver + unittest format**).
30+
It is **messy** and has **unnecessary lines of code** to do the task that was recorded:
31+
32+
```python
33+
# -*- coding: utf-8 -*-
34+
from selenium import webdriver
35+
from selenium.webdriver.common.by import By
36+
from selenium.webdriver.common.keys import Keys
37+
from selenium.webdriver.support.ui import Select
38+
from selenium.common.exceptions import NoSuchElementException
39+
from selenium.common.exceptions import NoAlertPresentException
40+
import unittest, time, re
41+
42+
class Swag(unittest.TestCase):
43+
def setUp(self):
44+
self.driver = webdriver.Firefox()
45+
self.driver.implicitly_wait(30)
46+
self.base_url = "https://www.google.com/"
47+
self.verificationErrors = []
48+
self.accept_next_alert = True
49+
50+
def test_swag(self):
51+
driver = self.driver
52+
driver.get("https://www.saucedemo.com/")
53+
driver.find_element_by_id("user-name").click()
54+
driver.find_element_by_id("user-name").clear()
55+
driver.find_element_by_id("user-name").send_keys("standard_user")
56+
driver.find_element_by_id("password").click()
57+
driver.find_element_by_id("password").clear()
58+
driver.find_element_by_id("password").send_keys("secret_sauce")
59+
driver.find_element_by_id("login-button").click()
60+
61+
def is_element_present(self, how, what):
62+
try: self.driver.find_element(by=how, value=what)
63+
except NoSuchElementException as e: return False
64+
return True
65+
66+
def is_alert_present(self):
67+
try: self.driver.switch_to_alert()
68+
except NoAlertPresentException as e: return False
69+
return True
70+
71+
def close_alert_and_get_its_text(self):
72+
try:
73+
alert = self.driver.switch_to_alert()
74+
alert_text = alert.text
75+
if self.accept_next_alert:
76+
alert.accept()
77+
else:
78+
alert.dismiss()
79+
return alert_text
80+
finally: self.accept_next_alert = True
81+
82+
def tearDown(self):
83+
self.driver.quit()
84+
self.assertEqual([], self.verificationErrors)
85+
86+
if __name__ == "__main__":
87+
unittest.main()
88+
```
89+
90+
<div><b>This can be improved on...</b></div>
91+
92+
<b>After running <code>seleniumbase convert [FILE.py]</code> on it, here is the new result:</b>
93+
94+
```python
95+
# -*- coding: utf-8 -*-
96+
from seleniumbase import BaseCase
97+
98+
99+
class Swag(BaseCase):
100+
101+
def test_swag(self):
102+
self.open('https://www.saucedemo.com/')
103+
self.type('#user-name', 'standard_user')
104+
self.type('#password', 'secret_sauce')
105+
self.click('#login-button')
106+
```
107+
108+
<b>This is much cleaner than the original version.
109+
It also uses the more reliable SeleniumBase methods.</b>

seleniumbase/utilities/selenium_ide/ReadMe.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,89 @@ seleniumbase convert MY_TEST.py
2121
```
2222

2323
* You should see a [MY_TEST_SB.py] file appear in the folder. (``_SB`` is added to the file name so that the original file stays intact in case you still need it.) This new clean & reliable SeleniumBase test script is ready to be added into your test suite for running.
24+
25+
--------
26+
27+
--------
28+
29+
The following is an example of a Katalon Recorder exported file (**WebDriver + unittest format**).
30+
It is **messy** and has **unnecessary lines of code** to do the task that was recorded:
31+
32+
```python
33+
# -*- coding: utf-8 -*-
34+
from selenium import webdriver
35+
from selenium.webdriver.common.by import By
36+
from selenium.webdriver.common.keys import Keys
37+
from selenium.webdriver.support.ui import Select
38+
from selenium.common.exceptions import NoSuchElementException
39+
from selenium.common.exceptions import NoAlertPresentException
40+
import unittest, time, re
41+
42+
class Swag(unittest.TestCase):
43+
def setUp(self):
44+
self.driver = webdriver.Firefox()
45+
self.driver.implicitly_wait(30)
46+
self.base_url = "https://www.google.com/"
47+
self.verificationErrors = []
48+
self.accept_next_alert = True
49+
50+
def test_swag(self):
51+
driver = self.driver
52+
driver.get("https://www.saucedemo.com/")
53+
driver.find_element_by_id("user-name").click()
54+
driver.find_element_by_id("user-name").clear()
55+
driver.find_element_by_id("user-name").send_keys("standard_user")
56+
driver.find_element_by_id("password").click()
57+
driver.find_element_by_id("password").clear()
58+
driver.find_element_by_id("password").send_keys("secret_sauce")
59+
driver.find_element_by_id("login-button").click()
60+
61+
def is_element_present(self, how, what):
62+
try: self.driver.find_element(by=how, value=what)
63+
except NoSuchElementException as e: return False
64+
return True
65+
66+
def is_alert_present(self):
67+
try: self.driver.switch_to_alert()
68+
except NoAlertPresentException as e: return False
69+
return True
70+
71+
def close_alert_and_get_its_text(self):
72+
try:
73+
alert = self.driver.switch_to_alert()
74+
alert_text = alert.text
75+
if self.accept_next_alert:
76+
alert.accept()
77+
else:
78+
alert.dismiss()
79+
return alert_text
80+
finally: self.accept_next_alert = True
81+
82+
def tearDown(self):
83+
self.driver.quit()
84+
self.assertEqual([], self.verificationErrors)
85+
86+
if __name__ == "__main__":
87+
unittest.main()
88+
```
89+
90+
<div><b>This can be improved on...</b></div>
91+
92+
<b>After running <code>seleniumbase convert [FILE.py]</code> on it, here is the new result:</b>
93+
94+
```python
95+
# -*- coding: utf-8 -*-
96+
from seleniumbase import BaseCase
97+
98+
99+
class Swag(BaseCase):
100+
101+
def test_swag(self):
102+
self.open('https://www.saucedemo.com/')
103+
self.type('#user-name', 'standard_user')
104+
self.type('#password', 'secret_sauce')
105+
self.click('#login-button')
106+
```
107+
108+
<b>This is much cleaner than the original version.
109+
It also uses the more reliable SeleniumBase methods.</b>

0 commit comments

Comments
 (0)