You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<palign="center">SeleniumBase is a complete framework for web automation & end-to-end testing with <ahref="https://docs.pytest.org/en/latest/index.html">pytest</a>.<br />The API simplifies <ahref="https://www.selenium.dev/documentation/">Selenium</a>'s out-of-the-box API, which leads to more maintainable test code. <br />SeleniumBase includes advanced features such as a realtime <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">Dashboard</a>, a <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">Recorder</a>, & more.</p>
21
+
<palign="center">SeleniumBase is a complete framework for browser automation and testing with <ahref="https://docs.pytest.org/en/latest/index.html">pytest</a>.<br />The API simplifies <ahref="https://www.selenium.dev/documentation/">Selenium</a>'s out-of-the-box API, which leads to more maintainable code. <br />Includes advanced features such as the <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">Dashboard</a>, a <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">Recorder</a>, and <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/js_package_manager.md">JS code generators</a>.</p>
<h2><imgsrc="https://seleniumbase.io/img/logo6.png"title="SeleniumBase"width="32" /> JS Package Manager and Code Generators</h2>
4
4
5
5
<div>SeleniumBase lets you load JavaScript packages from any CDN link into any website.</div>
6
-
<p><div>Here's an example of loading a website-tour library into the browser while visiting Google:</div></p>
7
6
8
-
<imgsrc="https://seleniumbase.io/cdn/gif/driverjs_tour.gif"title="SeleniumBase Tour of Google" /><br />
7
+
<p><div>In addition to loading JS packages, SeleniumBase also lets you generate JS code from Python so that you can use these packages more easily.</div></p>
9
8
10
-
This example, ([google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) from the SeleniumBase ``examples/tour_examples/`` folder), can be run with ``pytest`` after you've cloned and installed [SeleniumBase from GitHub](https://github.com/seleniumbase/SeleniumBase):
9
+
<p><div>Here's an example of loading a website-tour library into the browser for a Google Maps tour:</div></p>
10
+
11
+
<imgsrc="https://seleniumbase.io/cdn/gif/introjs_tour.gif"title="SeleniumBase Tour of Google" /><br />
12
+
13
+
This example, ([maps_introjs_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/maps_introjs_tour.py) from the SeleniumBase ``examples/tour_examples/`` folder), can be run with ``pytest`` after you've cloned and installed [SeleniumBase from GitHub](https://github.com/seleniumbase/SeleniumBase): (The ``--interval=1`` makes the tour go automatically to the next step after 1 second.)
11
14
12
15
```bash
13
-
pytest google_tour.py
16
+
cd examples/tour_examples
17
+
pytest maps_introjs_tour.py --interval=1
18
+
```
19
+
20
+
<p>SeleniumBase includes powerful JS code generators for converting Python into JavaScript for using the supported JS packages. A few lines of Python in your tests might generate hundreds of lines of JavaScript. (Here is some tour code in Python from <ahref="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/maps_introjs_tour.py">maps_introjs_tour.py</a> that expands into a lot of JavaScript.)</p>
self.add_tour_step("Thanks for using Tours!", title="End of Guided Tour")
29
+
self.export_tour(filename="maps_introjs_tour.js")
30
+
self.play_tour()
14
31
```
15
32
16
-
<div>Since a CDN is used for holding packages, you no longer need to use other package managers such as NPM, Bower, or Yarn.</div>
17
-
<p><div>Here's the Python code for loading JS packages into the web browser with SeleniumBase:</div></p>
33
+
<p><div>For existing features, SeleniumBase already takes care of loading all the necessary JS and CSS files into the web browser. To load other packages, here are a few useful methods that you should know about:</div></p>
<div>You can load any JS package this way as long as you know the URL.</div>
30
46
31
-
If you're wondering how SeleniumBase does this, here's the full Python code, which uses WebDriver's ``execute_script()`` method for making JS calls after escaping quotes:
47
+
If you're wondering how SeleniumBase does this, here's the full Python code from [js_utils.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/js_utils.py), which uses WebDriver's ``execute_script()`` method for making JS calls after escaping quotes with backslashes as needed:
<div>Website tours are just one of the many ways of using the SeleniumBase JS Package Manager.</div>
98
+
<div>Website tours are just one of the many uses of the JS Package Manager.</div>
83
99
<p><div>The following example shows the <ahref="https://github.com/craftpip/jquery-confirm">JqueryConfirm</a> package loaded into a website for creating fancy dialog boxes:</div></p>
84
100
85
-
<imgsrc="https://seleniumbase.io/cdn/gif/masterqa6.gif"alt="MasterQA by SeleniumBase"title="MasterQA by SeleniumBase" /><br />
<p><div>(Example from <ahref="https://seleniumbase.io/examples/master_qa/ReadMe/">SeleniumBase's MasterQA ReadMe</a>)</div></p>
114
+
<p><div>(Example from the <ahref="https://seleniumbase.io/examples/dialog_boxes/ReadMe/">Dialog Boxes ReadMe</a>)</div></p>
88
115
89
-
<div>Since packages are loaded directly from a CDN, such as <ahref="https://cdnjs.com/">CloudFlare's cdnjs</a>, there's no need to use NPM, Bower, Yarn, or other package managers to get the packages that you need into the websites that you want.</div>
116
+
<div>Since packages are loaded directly from a CDN link, you won't need other package managers like NPM, Bower, or Yarn to get the packages that you need into the websites that you want.</div>
0 commit comments