seleniumbase 4.24.11__py3-none-any.whl → 4.33.15__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. sbase/__init__.py +1 -0
  2. sbase/steps.py +7 -0
  3. seleniumbase/__init__.py +16 -7
  4. seleniumbase/__version__.py +1 -1
  5. seleniumbase/behave/behave_sb.py +97 -32
  6. seleniumbase/common/decorators.py +16 -7
  7. seleniumbase/config/proxy_list.py +3 -3
  8. seleniumbase/config/settings.py +4 -0
  9. seleniumbase/console_scripts/logo_helper.py +47 -8
  10. seleniumbase/console_scripts/run.py +345 -335
  11. seleniumbase/console_scripts/sb_behave_gui.py +5 -12
  12. seleniumbase/console_scripts/sb_caseplans.py +6 -13
  13. seleniumbase/console_scripts/sb_commander.py +5 -12
  14. seleniumbase/console_scripts/sb_install.py +62 -54
  15. seleniumbase/console_scripts/sb_mkchart.py +13 -20
  16. seleniumbase/console_scripts/sb_mkdir.py +11 -17
  17. seleniumbase/console_scripts/sb_mkfile.py +69 -43
  18. seleniumbase/console_scripts/sb_mkpres.py +13 -20
  19. seleniumbase/console_scripts/sb_mkrec.py +88 -21
  20. seleniumbase/console_scripts/sb_objectify.py +30 -30
  21. seleniumbase/console_scripts/sb_print.py +5 -12
  22. seleniumbase/console_scripts/sb_recorder.py +16 -11
  23. seleniumbase/core/browser_launcher.py +1658 -221
  24. seleniumbase/core/log_helper.py +42 -27
  25. seleniumbase/core/mysql.py +1 -4
  26. seleniumbase/core/proxy_helper.py +35 -30
  27. seleniumbase/core/recorder_helper.py +24 -5
  28. seleniumbase/core/sb_cdp.py +1951 -0
  29. seleniumbase/core/sb_driver.py +162 -8
  30. seleniumbase/core/settings_parser.py +6 -0
  31. seleniumbase/core/style_sheet.py +10 -0
  32. seleniumbase/extensions/recorder.zip +0 -0
  33. seleniumbase/fixtures/base_case.py +1225 -614
  34. seleniumbase/fixtures/constants.py +10 -1
  35. seleniumbase/fixtures/js_utils.py +171 -144
  36. seleniumbase/fixtures/page_actions.py +177 -13
  37. seleniumbase/fixtures/page_utils.py +25 -53
  38. seleniumbase/fixtures/shared_utils.py +97 -11
  39. seleniumbase/js_code/active_css_js.py +1 -1
  40. seleniumbase/js_code/recorder_js.py +1 -1
  41. seleniumbase/plugins/base_plugin.py +2 -3
  42. seleniumbase/plugins/driver_manager.py +340 -65
  43. seleniumbase/plugins/pytest_plugin.py +276 -47
  44. seleniumbase/plugins/sb_manager.py +412 -99
  45. seleniumbase/plugins/selenium_plugin.py +122 -17
  46. seleniumbase/translate/translator.py +0 -7
  47. seleniumbase/undetected/__init__.py +59 -52
  48. seleniumbase/undetected/cdp.py +0 -1
  49. seleniumbase/undetected/cdp_driver/__init__.py +1 -0
  50. seleniumbase/undetected/cdp_driver/_contradict.py +110 -0
  51. seleniumbase/undetected/cdp_driver/browser.py +829 -0
  52. seleniumbase/undetected/cdp_driver/cdp_util.py +458 -0
  53. seleniumbase/undetected/cdp_driver/config.py +334 -0
  54. seleniumbase/undetected/cdp_driver/connection.py +639 -0
  55. seleniumbase/undetected/cdp_driver/element.py +1168 -0
  56. seleniumbase/undetected/cdp_driver/tab.py +1323 -0
  57. seleniumbase/undetected/dprocess.py +4 -7
  58. seleniumbase/undetected/options.py +6 -8
  59. seleniumbase/undetected/patcher.py +11 -13
  60. seleniumbase/undetected/reactor.py +0 -1
  61. seleniumbase/undetected/webelement.py +16 -3
  62. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/LICENSE +1 -1
  63. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/METADATA +299 -252
  64. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/RECORD +67 -69
  65. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/WHEEL +1 -1
  66. sbase/ReadMe.txt +0 -2
  67. seleniumbase/ReadMe.md +0 -25
  68. seleniumbase/common/ReadMe.md +0 -71
  69. seleniumbase/console_scripts/ReadMe.md +0 -731
  70. seleniumbase/drivers/ReadMe.md +0 -27
  71. seleniumbase/extensions/ReadMe.md +0 -12
  72. seleniumbase/masterqa/ReadMe.md +0 -61
  73. seleniumbase/resources/ReadMe.md +0 -31
  74. seleniumbase/resources/favicon.ico +0 -0
  75. seleniumbase/utilities/selenium_grid/ReadMe.md +0 -84
  76. seleniumbase/utilities/selenium_ide/ReadMe.md +0 -111
  77. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/entry_points.txt +0 -0
  78. {seleniumbase-4.24.11.dist-info → seleniumbase-4.33.15.dist-info}/top_level.txt +0 -0
@@ -1,27 +0,0 @@
1
- ### <img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase webdriver storage
2
-
3
- To run web automation, you'll need webdrivers for each browser you plan on using. With SeleniumBase, drivers are downloaded automatically as needed into the SeleniumBase ``drivers`` folder.
4
-
5
- You can also download drivers manually with these commands:
6
-
7
- ```bash
8
- seleniumbase get chromedriver
9
- seleniumbase get geckodriver
10
- seleniumbase get edgedriver
11
- ```
12
-
13
- After running the commands above, web drivers will get downloaded into the ``seleniumbase/drivers/`` folder. SeleniumBase uses those drivers during tests. (The drivers don't come with SeleniumBase by default.)
14
-
15
- If the necessary driver is not found in this location while running tests, SeleniumBase will instead look for the driver on the System PATH. If the necessary driver is not on the System PATH either, SeleniumBase will automatically attempt to download the required driver.
16
-
17
- * You can also download specific versions of drivers. Examples:
18
-
19
- ```bash
20
- sbase get chromedriver 107
21
- sbase get chromedriver 107.0.5304.62
22
- sbase get chromedriver latest
23
- sbase get chromedriver latest-1
24
- sbase get edgedriver 106.0.1370.42
25
- ```
26
-
27
- (NOTE: ``sbase`` is a shortcut for ``seleniumbase``)
@@ -1,12 +0,0 @@
1
- <!-- SeleniumBase Docs -->
2
-
3
- [<img src="https://seleniumbase.github.io/cdn/img/sb_text_f.png" title="SeleniumBase" align="center" width="360">](https://github.com/seleniumbase/SeleniumBase)
4
-
5
- <h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> SeleniumBase browser extension storage</h2>
6
-
7
- <b>The List:</b>
8
-
9
- * ad_block.zip => This extension blocks certain types of iframe ads from loading.
10
- * disable_csp.zip => This extension disables a website's Content-Security-Policy.
11
- * recorder.zip => Save browser actions to sessionStorage with good CSS selectors.
12
- * sbase_ext.zip => An extension that does nothing, but helps people learn things.
@@ -1,61 +0,0 @@
1
- <!-- SeleniumBase Docs -->
2
-
3
- ![](https://seleniumbase.github.io/cdn/img/masterqa_logo.png "MasterQA")
4
-
5
- <h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32" /> MasterQA combines automation with manual verification steps.</h3>
6
-
7
- ![](https://seleniumbase.github.io/cdn/gif/masterqa6.gif "MasterQA")
8
-
9
- Here's code from [basic_masterqa_test_0.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/basic_masterqa_test_0.py):
10
-
11
- ```python
12
- from seleniumbase import MasterQA
13
-
14
- class MasterQATests(MasterQA):
15
- def test_masterqa(self):
16
- self.open("https://xkcd.com/1700/")
17
- self.verify("Do you see a webcomic?")
18
- self.open("https://seleniumbase.io/demo_page")
19
- self.highlight('table')
20
- self.verify("Do you see elements in a table?")
21
- self.open("https://seleniumbase.io/devices/")
22
- self.highlight("div.mockup-wrapper")
23
- self.verify("Do you see 4 computer devices?")
24
- ```
25
-
26
- After each automation checkpoint, a pop-up window will ask the user questions for each verification command.
27
-
28
- When the test run completes, as seen from [this longer example](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test_1.py), you'll reach the results page that appears after answering all the verification questions. (Failed verifications generate links to screenshots and log files.)
29
-
30
- ![](https://seleniumbase.github.io/cdn/img/mqa_hybrid.png "MasterQA")
31
-
32
- You may have noticed the ``Incomplete Test Runs`` row on the results page. If the value for that is not zero, it means that one of the automated steps failed. This could happen if you tell your script to perform an action on an element that doesn't exist. Now that we're mixing automation with manual QA, it's good to tell apart the failures from each. The results_table CSV file contains a spreadsheet with the details of each failure (if any) for both manual and automated steps.
33
-
34
- **How to run the example tests from scratch:**
35
-
36
- ```bash
37
- git clone https://github.com/seleniumbase/SeleniumBase.git
38
- cd SeleniumBase
39
- pip install .
40
- cd examples/master_qa
41
- pytest basic_masterqa_test_0.py
42
- pytest masterqa_test_1.py
43
- ```
44
-
45
- At the end of your test run, you'll receive a report with results, screenshots, and log files. Close the Results Page window when you're done.
46
-
47
- **Check out [masterqa_test_1.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/masterqa_test_1.py) to learn how to write your own MasterQA tests:**
48
-
49
- You'll notice that tests are written the same way as regular [SeleniumBase](https://seleniumbase.com) tests, with the key difference being a different import: ``from seleniumbase import MasterQA`` rather than ``from seleniumbase import BaseCase``. Now your Python test class will import ``MasterQA`` instead of ``BaseCase``.
50
-
51
- To add a manual verification step, use ``self.verify()`` in the code after each part of your test that needs a manual verification step. If you want to include a custom question, add text inside that call (in quotes). Example:
52
-
53
- ```python
54
- self.verify()
55
-
56
- self.verify("Can you find the moon?")
57
- ```
58
-
59
- --------
60
-
61
- MasterQA is powered by [SeleniumBase](https://seleniumbase.com), the most advanced open-source automation framework on the [Planet](https://en.wikipedia.org/wiki/Earth).
@@ -1,31 +0,0 @@
1
- <!-- SeleniumBase Docs -->
2
-
3
- ## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Resource Files
4
-
5
- SeleniumBase uses JavaScript libraries for bonus features such as the Website Tour Maker, Presentation Maker, Chart Maker, Demo Mode, HTML Inspector, and more. In general, SeleniumBase retrieves these resources via CDN link.
6
-
7
- **favicon.ico** - This file is used by [style_sheet.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/style_sheet.py) for the favicon icon. Currently, SeleniumBase uses the version at [https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/resources/favicon.ico](https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/resources/favicon.ico).
8
-
9
- --------
10
-
11
- The remaining resources have been moved into [github.com/seleniumbase/resource-files](https://github.com/seleniumbase/resource-files) in order to reduce the size of SeleniumBase:
12
-
13
- **messenger/** - Files in this folder are used for creating JavaScript notifications during test runs in Demo Mode.
14
-
15
- **jquery_confirm/** - Files in this folder are used for creating JavaScript confirmation prompts during test runs when using MasterQA.
16
-
17
- **html_inspector/** - Files in this folder are used for the HTML Inspector, which validates website pages.
18
-
19
- **reveal/** - Files in this folder are used for the HTML Presentation Maker.
20
-
21
- **prettify/** - Files in this folder are used to assist the HTML Presentation Maker.
22
-
23
- **shepherd/** - Files in this folder are used for creating website tours using the Shepherd JavaScript library.
24
-
25
- **bootstrap_tour/** - Files in this folder are used for creating website tours using the Bootstrap Tour JavaScript library.
26
-
27
- **introjs/** - Files in this folder are used for creating website tours using the IntroJS JavaScript library.
28
-
29
- **driverjs/** - Files in this folder are used for creating website tours using the DriverJS JavaScript library.
30
-
31
- **hopscotch/** - Files in this folder are used for creating website tours using the Hopscotch JavaScript library.
Binary file
@@ -1,84 +0,0 @@
1
- <!-- SeleniumBase Docs -->
2
-
3
- [<img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="290">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
4
-
5
- <h2><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> The Selenium Grid Hub:</h2>
6
-
7
- The Selenium Grid Hub lets you distribute tests to run in parallel across multiple node machines. Each node machine can then run its own allocation of tests. This allows you to run a large suite of tests very quickly.
8
-
9
- <h3><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> Running the Selenium Grid Hub:</h3>
10
-
11
- The following commands will work once you've installed seleniumbase.
12
-
13
- <h4><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> Downloading the Selenium Server JAR file:</h4>
14
-
15
- ```bash
16
- seleniumbase download server
17
- ```
18
-
19
- * (Required for using your own Selenium Grid)
20
-
21
- <h4><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> Grid Hub server controls:</h4>
22
-
23
- ```bash
24
- seleniumbase grid-hub {start|stop|restart} [OPTIONS]
25
- ```
26
-
27
- <b>Options:</b>
28
- <ul>
29
- <li> -v / --verbose (Increases verbosity of logging output.)</li>
30
- <li> --timeout=TIMEOUT (Close idle browser after TIMEOUT sec.)</li>
31
- </ul>
32
-
33
- <h4><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> Grid node server controls:</h4>
34
-
35
- ```bash
36
- seleniumbase grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]
37
- ```
38
-
39
- <b>Options:</b>
40
- <ul>
41
- <li> -v / --verbose (Increases verbosity of logging output.)</li>
42
- <li> --hub=[HUB_IP] (Specifies the Grid Hub to connect to. Default: "127.0.0.1".)</li>
43
- </ul>
44
-
45
- When the Grid Hub Console is up and running, you'll be able to find it here: [http://127.0.0.1:4444/grid/console](http://127.0.0.1:4444/grid/console)
46
-
47
- Now you can run your tests on the Selenium Grid:
48
-
49
- ```bash
50
- pytest test_demo_site.py --server=IP_ADDRESS --port=4444
51
- ```
52
-
53
- You can also run your tests on someone else's Selenium Grid to avoid managing your own. Here are some Selenium Grids that you can use (and the run command format):
54
-
55
- * [BrowserStack](https://www.browserstack.com/automate#) Selenium Grid:
56
-
57
- ```bash
58
- pytest test_demo_site.py --server=USERNAME:KEY@hub.browserstack.com --port=80
59
- ```
60
-
61
- * [Sauce Labs](https://saucelabs.com/products/platform-configurator) Selenium Grid:
62
-
63
- ```bash
64
- pytest test_demo_site.py --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https
65
- ```
66
-
67
- * [CrossBrowserTesting](https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/) Selenium Grid:
68
-
69
- ```bash
70
- pytest test_demo_site.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
71
- ```
72
-
73
- To use a server on the ``https`` protocol, add ``--protocol=https``:
74
- (<i>SeleniumBase 1.65.2 and newer uses ``https`` automatically for ``--port=443``.</i>)
75
-
76
- ```bash
77
- pytest test_demo_site.py --protocol=https --server=IP_ADDRESS --port=PORT
78
- ```
79
-
80
- (For setting browser desired capabilities while running Selenium remotely, see the <a href="https://seleniumbase.io/help_docs/desired_capabilities/">desired capabilities documentation</a> and the sample files located in <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities">SeleniumBase/examples/capabilities</a>)
81
-
82
- <h4><img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="28" /> More info about the Selenium Grid Hub can be found here:</h4>
83
-
84
- * [https://www.selenium.dev/documentation/grid/](https://www.selenium.dev/documentation/grid/)
@@ -1,111 +0,0 @@
1
- <!-- SeleniumBase Docs -->
2
-
3
- ### Converting Katalon recordings into SeleniumBase test scripts
4
-
5
- ### (NOTE: **[SeleniumBase now has Recorder Mode](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md)**, which is recommended over other record & playback tools.)
6
-
7
- --------
8
-
9
- Katalon Recorder (Selenium IDE) is a tool that allows you to record and playback actions performed inside a web browser. It's available as a [downloadable Chrome extension](https://chrome.google.com/webstore/detail/katalon-recorder-selenium/ljdobmomdgdljniojadhoplhkpialdid) and a [downloadable Firefox extension](https://addons.mozilla.org/en-US/firefox/addon/katalon-automation-record/). The Katalon Recorder comes with an option to export recordings as various WebDriver test scripts, one of which is ``Python 2 (WebDriver + unittest)``. Unfortunately, these natively-exported scripts can be very messy and don't always run reliably. The purpose of this converter is to clean up and improve the scripts so that they can be used in production-level environments.
10
-
11
- #### Step 1: Make a recording with the Katalon Recorder
12
-
13
- ![](https://seleniumbase.io/cdn/img/katalon_recorder_2.png "Katalon Recorder example")
14
-
15
- #### Step 2: Export your recording as a Python 2 Webdriver script
16
-
17
- * ``{} Export`` => ``Python 2 (WebDriver + unittest)`` => ``Save As File``
18
-
19
- #### Step 3: Run ``seleniumbase convert`` on your exported Python file
20
-
21
- ```bash
22
- seleniumbase convert MY_TEST.py
23
- ```
24
-
25
- * 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.
26
-
27
- --------
28
-
29
- --------
30
-
31
- The following is an example of a Katalon Recorder exported file (**WebDriver + unittest format**).
32
- It is **messy** and has **unnecessary lines of code** to do the task that was recorded:
33
-
34
- ```python
35
- # -*- coding: utf-8 -*-
36
- from selenium import webdriver
37
- from selenium.webdriver.common.by import By
38
- from selenium.webdriver.common.keys import Keys
39
- from selenium.webdriver.support.ui import Select
40
- from selenium.common.exceptions import NoSuchElementException
41
- from selenium.common.exceptions import NoAlertPresentException
42
- import unittest, time, re
43
-
44
- class Swag(unittest.TestCase):
45
- def setUp(self):
46
- self.driver = webdriver.Firefox()
47
- self.driver.implicitly_wait(30)
48
- self.base_url = "https://www.google.com/"
49
- self.verificationErrors = []
50
- self.accept_next_alert = True
51
-
52
- def test_swag(self):
53
- driver = self.driver
54
- driver.get("https://www.saucedemo.com/")
55
- driver.find_element_by_id("user-name").click()
56
- driver.find_element_by_id("user-name").clear()
57
- driver.find_element_by_id("user-name").send_keys("standard_user")
58
- driver.find_element_by_id("password").click()
59
- driver.find_element_by_id("password").clear()
60
- driver.find_element_by_id("password").send_keys("secret_sauce")
61
- driver.find_element_by_id("login-button").click()
62
-
63
- def is_element_present(self, how, what):
64
- try: self.driver.find_element(by=how, value=what)
65
- except NoSuchElementException as e: return False
66
- return True
67
-
68
- def is_alert_present(self):
69
- try: self.driver.switch_to_alert()
70
- except NoAlertPresentException as e: return False
71
- return True
72
-
73
- def close_alert_and_get_its_text(self):
74
- try:
75
- alert = self.driver.switch_to_alert()
76
- alert_text = alert.text
77
- if self.accept_next_alert:
78
- alert.accept()
79
- else:
80
- alert.dismiss()
81
- return alert_text
82
- finally: self.accept_next_alert = True
83
-
84
- def tearDown(self):
85
- self.driver.quit()
86
- self.assertEqual([], self.verificationErrors)
87
-
88
- if __name__ == "__main__":
89
- unittest.main()
90
- ```
91
-
92
- <div><b>This can be improved on...</b></div>
93
-
94
- <b>After running <code>seleniumbase convert [FILE.py]</code> on it, here is the new result:</b>
95
-
96
- ```python
97
- # -*- coding: utf-8 -*-
98
- from seleniumbase import BaseCase
99
-
100
-
101
- class Swag(BaseCase):
102
-
103
- def test_swag(self):
104
- self.open('https://www.saucedemo.com/')
105
- self.type('#user-name', 'standard_user')
106
- self.type('#password', 'secret_sauce')
107
- self.click('#login-button')
108
- ```
109
-
110
- <b>This is much cleaner than the original version.
111
- It also uses the more reliable SeleniumBase methods.</b>