vigilant-kit 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of vigilant-kit might be problematic. Click here for more details.
- vigilant_kit-1.2.1.dist-info/METADATA +59 -0
- {vigilant_kit-1.2.0.dist-info → vigilant_kit-1.2.1.dist-info}/RECORD +5 -5
- vigilant_kit-1.2.0.dist-info/METADATA +0 -150
- {vigilant_kit-1.2.0.dist-info → vigilant_kit-1.2.1.dist-info}/WHEEL +0 -0
- {vigilant_kit-1.2.0.dist-info → vigilant_kit-1.2.1.dist-info}/entry_points.txt +0 -0
- {vigilant_kit-1.2.0.dist-info → vigilant_kit-1.2.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: vigilant_kit
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: Library that makes functional testing with Selenium WebDriver fast and easy.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ivpel/vigilant
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/ivpel/vigilant/issues
|
|
7
|
+
Author-email: Pelykh Ivan <ivan.pelykh@protonmail.com>
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: bdd,functional,functional-testing,pytest,selenium,tdd,testing,unittest,webdriver
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Requires-Dist: click
|
|
12
|
+
Requires-Dist: python-dotenv
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Requires-Dist: selenium
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Vigilant Kit
|
|
18
|
+
Vigilant is a set of tools designed to help write and run robust functional tests using Selenium WebDriver. It provides
|
|
19
|
+
methods for interacting with the WebBrowser, assertions, and waiting. With Vigilant, you can start writing complex test
|
|
20
|
+
cases in a minute.
|
|
21
|
+
|
|
22
|
+
## Why Vigilant?
|
|
23
|
+
- **Easy to start & Fast To Write**: Easy configuration process, straightforward way to writing your tests.
|
|
24
|
+
Vigilant provides you with methods that help you write functional tests quickly without spending time on writing
|
|
25
|
+
boilerplate code every time you start a new project.
|
|
26
|
+
- **Flexible Framework Usage**: Usage is not limited to a single testing framework; you can use Vigilant with unittest,
|
|
27
|
+
pytest, or anything else.
|
|
28
|
+
|
|
29
|
+
## What it includes?
|
|
30
|
+
Methods for **interacting** with WebBrowser (`click`, `scroll_to`, etc.), **assertions** (`see`, `dont_see`, `see_text`
|
|
31
|
+
, etc.) **waiters** (`wait_for_element_to_be_visible`, `wait_for_element_to_be_clickable`, etc.)
|
|
32
|
+
It is already there, ready to use.
|
|
33
|
+
|
|
34
|
+
Also, a bunch of CLI scripts, to make your life easier!
|
|
35
|
+
|
|
36
|
+
Use `vgl --help` to see all available commands.
|
|
37
|
+
|
|
38
|
+
List of all available [actions](docs/actions.md).
|
|
39
|
+
|
|
40
|
+
## Extending Functionality
|
|
41
|
+
If you need something that is not covered in this library, you still have access to all native `Selenium WebDriver`
|
|
42
|
+
methods. You can create your own methods or use native `WebDriver` methods and share them on one browser session.
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
```shell
|
|
46
|
+
pip install vigilant-kit
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Docs
|
|
50
|
+
- [How to install Selenium server & browser drivers](docs/selenium_install.md)
|
|
51
|
+
- [Quick start example using `unittest` library](docs/vigilant_unittest.md)
|
|
52
|
+
- [Quick start example using `pytest`](docs/vigilant_pytest.md)
|
|
53
|
+
- [How to add custom browser options](docs/browser_options.md)
|
|
54
|
+
- [Access native Selenium WebDriver methods](docs/native_selenium.md)
|
|
55
|
+
- [List of actions](docs/actions.md).
|
|
56
|
+
|
|
57
|
+
## Tutorials
|
|
58
|
+
- [Testing ecommerce project using `vigilant-kit` and `pytest`](docs/tutorial_pytest.md)
|
|
59
|
+
|
|
@@ -12,8 +12,8 @@ vigilant/actions/vigilant_actions.py,sha256=2OwnuKJHU4MUq4atLq49FbRQPUeE0mCXs0ps
|
|
|
12
12
|
vigilant/actions/waiter.py,sha256=_sgL-R-Kp3I-DP27Sd_OAL8erjvhLvHLWFURXNX3V2w,3298
|
|
13
13
|
vigilant/driver/__init__.py,sha256=brf9Jk8uq_TNomOKu2k_0u9mAuimLf9bxF0XHafaZGs,207
|
|
14
14
|
vigilant/driver/vigilant_driver.py,sha256=rw5CfWfBWOIFPgnkmxTi7cSbrrxLtDtRlxg2FMfyEVw,3398
|
|
15
|
-
vigilant_kit-1.2.
|
|
16
|
-
vigilant_kit-1.2.
|
|
17
|
-
vigilant_kit-1.2.
|
|
18
|
-
vigilant_kit-1.2.
|
|
19
|
-
vigilant_kit-1.2.
|
|
15
|
+
vigilant_kit-1.2.1.dist-info/METADATA,sha256=sOPWPkskC1HySS4nO2Nh-lPD9s4GlYFPAHaYgWSKvQg,2566
|
|
16
|
+
vigilant_kit-1.2.1.dist-info/WHEEL,sha256=9MIigYJ7D5sOqAPqr0-o6tSMY_nQ7c6kvtvyeUB99YQ,87
|
|
17
|
+
vigilant_kit-1.2.1.dist-info/entry_points.txt,sha256=c_azSnuBSdtgwdPlioaG0n2gZOEhuPIzL9VQ8DeKTow,40
|
|
18
|
+
vigilant_kit-1.2.1.dist-info/licenses/LICENSE,sha256=VQoL58PKrdEeZx2K4hXS7O6w4O_DMBB0XFE-GjK1CMo,35125
|
|
19
|
+
vigilant_kit-1.2.1.dist-info/RECORD,,
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: vigilant_kit
|
|
3
|
-
Version: 1.2.0
|
|
4
|
-
Summary: Library that makes functional testing with Selenium WebDriver fast and easy.
|
|
5
|
-
Project-URL: Homepage, https://github.com/ivpel/vigilant
|
|
6
|
-
Project-URL: Bug Tracker, https://github.com/ivpel/vigilant/issues
|
|
7
|
-
Author-email: Pelykh Ivan <ivan.pelykh@protonmail.com>
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Keywords: bdd,functional,functional-testing,pytest,selenium,tdd,testing,unittest,webdriver
|
|
10
|
-
Requires-Python: >=3.7
|
|
11
|
-
Requires-Dist: click
|
|
12
|
-
Requires-Dist: python-dotenv
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: selenium
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
|
|
17
|
-
# Vigilant Kit
|
|
18
|
-
Vigilant is a set of tools made to help writing and running robust functional tests using Selenium WebDriver.
|
|
19
|
-
|
|
20
|
-
## Why Vigilant?
|
|
21
|
-
- It allows you to start writing complex test cases in a minute.
|
|
22
|
-
- Simple configuration process (just one `.vigilant.env` file to start)
|
|
23
|
-
- Usage is not limited to a single testing framework, it can be used with `unittest`, `pytest` or anything else.
|
|
24
|
-
It is up to you.
|
|
25
|
-
|
|
26
|
-
**Vigilant** provide you with methods that help write functional tests fast, without spending your time on writing
|
|
27
|
-
boilerplate code every time you start new project.
|
|
28
|
-
|
|
29
|
-
Methods for **interacting** with WebBrowser (`click`, `scroll_to`, etc.), **assertions** (`see`, `dont_see`, `see_text`
|
|
30
|
-
, etc.) **waiting** (`wait_for_element_to_be_visible`, `wait_for_element_to_be_clickable`, etc.)
|
|
31
|
-
It is already there, ready to use.
|
|
32
|
-
|
|
33
|
-
List of all available [actions](docs/actions.md).
|
|
34
|
-
|
|
35
|
-
### What if you need something that is not covered in this library?
|
|
36
|
-
|
|
37
|
-
You still have access to all native `Selenium WebDriver` methods. Despite all functional that library provide -
|
|
38
|
-
you can create your own methods or use native `WebDriver` methods and share them on one browser session.
|
|
39
|
-
|
|
40
|
-
## Docs
|
|
41
|
-
- [How to install Selenium server & browser drivers](docs/selenium_install.md)
|
|
42
|
-
- [Quick start example using `unittest` library](docs/vigilant_unittest.md)
|
|
43
|
-
- [Quick start example using `pytest`](docs/vigilant_pytest.md)
|
|
44
|
-
- [How to add custom browser options](docs/browser_options.md)
|
|
45
|
-
- [Access native Selenium WebDriver methods](docs/native_selenium.md)
|
|
46
|
-
- [List of actions](docs/actions.md).
|
|
47
|
-
|
|
48
|
-
## Tutorials
|
|
49
|
-
- [Testing ecommerce project using `vigilant-kit` and `pytest`](docs/tutorial_pytest.md)
|
|
50
|
-
|
|
51
|
-
## Install
|
|
52
|
-
```shell
|
|
53
|
-
pip install vigilant-kit
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Quick start
|
|
57
|
-
We will write our first test with `unittest` library. Also make sure that you installed
|
|
58
|
-
`vigilant-kit` library.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
### Configuration
|
|
62
|
-
Configuration can be done through environment variables. Make sure that your Selenium Server is up and running, if not -
|
|
63
|
-
[**Install Selenium server**](docs/selenium_install.md)
|
|
64
|
-
|
|
65
|
-
Create `.vigilant.env` file with next data:
|
|
66
|
-
```shell
|
|
67
|
-
# Selenium host URL
|
|
68
|
-
SELENIUM_HOST=http://127.0.0.1:4444/wd/hub
|
|
69
|
-
|
|
70
|
-
# Browser which will performing the tests
|
|
71
|
-
SELENIUM_BROWSER=firefox
|
|
72
|
-
|
|
73
|
-
# The root URL of the application under test.
|
|
74
|
-
BASE_URL=http://www.python.org
|
|
75
|
-
|
|
76
|
-
# Amount of time (in seconds) that a test will wait while loading a page or waiting for element
|
|
77
|
-
WAIT_TIMEOUT=10
|
|
78
|
-
|
|
79
|
-
# Log level
|
|
80
|
-
LOGGER_LEVEL=INFO
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Test
|
|
84
|
-
Create file `test_first.py` with same code as below. We will cover 3 simple cases for demo purposes.
|
|
85
|
-
```python
|
|
86
|
-
import unittest
|
|
87
|
-
|
|
88
|
-
from vigilant.driver.vigilant_driver import VigilantDriver
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class TestHomePage(unittest.TestCase):
|
|
92
|
-
|
|
93
|
-
@classmethod
|
|
94
|
-
def setUpClass(cls) -> None:
|
|
95
|
-
cls.act = VigilantDriver()
|
|
96
|
-
|
|
97
|
-
@classmethod
|
|
98
|
-
def tearDownClass(cls) -> None:
|
|
99
|
-
cls.act.quit()
|
|
100
|
-
|
|
101
|
-
def test_home_page(self):
|
|
102
|
-
# Case 1. Go to some page and assert page title
|
|
103
|
-
self.act.get_page('/') # Go to root page
|
|
104
|
-
self.act.assertions.see_in_title('Python') # Assert that page title contains 'Python' string
|
|
105
|
-
|
|
106
|
-
def test_text_block(self):
|
|
107
|
-
# Case 2. Scroll to some block and assert visible text
|
|
108
|
-
self.act.get_page('/') # Go to root page
|
|
109
|
-
self.act.scroll_to('//h2[text()="Success Stories"]') # Scroll to Success Stories block
|
|
110
|
-
self.act.assertions.see_text('Success Stories') # Assert that Success Stories string is visible
|
|
111
|
-
|
|
112
|
-
def test_search_page(self):
|
|
113
|
-
# Case 3. Fill in Search field with search key word, assert result in search result page.
|
|
114
|
-
self.act.get_page('/') # Go to root page
|
|
115
|
-
self.act.fill_field('//input[@name="q"]', 'python') # Fill search field
|
|
116
|
-
self.act.click('//button[@id="submit"]') # Click Search button
|
|
117
|
-
self.act.assertions.see_in_url(
|
|
118
|
-
'/search/?q=python') # See in URL that we are redirected to search result page
|
|
119
|
-
self.act.assertions.see_text('Results') # Assert visible Results text
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if __name__ == '__main__':
|
|
123
|
-
unittest.main()
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Now run our script:
|
|
127
|
-
```shell
|
|
128
|
-
python3 test_first.py
|
|
129
|
-
```
|
|
130
|
-
### Results
|
|
131
|
-
If you are running your Selenium Server locally - you can see how script interact with browser in real time. But in any
|
|
132
|
-
case you should have terminal output similar to this, due to LOGGER_LEVEL=INFO:
|
|
133
|
-
```text
|
|
134
|
-
[2022-11-02 16:34:26,452: INFO] Creating remote session.
|
|
135
|
-
Command executor: http://127.0.0.1:4444/wd/hub
|
|
136
|
-
Browser: firefox
|
|
137
|
-
[2022-11-02 16:34:26,452: INFO] Setting default browser options: firefox
|
|
138
|
-
[2022-11-02 16:34:27,890: INFO] Getting page: /
|
|
139
|
-
[2022-11-02 16:34:33,942: INFO] Assert: see string Python in current page title
|
|
140
|
-
[2022-11-02 16:34:33,956: INFO] Scrolling to element: //h2[text()="Success Stories"]
|
|
141
|
-
[2022-11-02 16:34:33,956: INFO] Execute JS script: arguments[0].scrollIntoView({block: "center"}) with arguments: <selenium.webdriver.remote.webelement.WebElement (session="3c63a627-1ffd-40ed-b008-78e671d82085", element="703e049a-3ab4-4bd5-814a-bb38dd64864a")>
|
|
142
|
-
[2022-11-02 16:34:33,980: INFO] Waiting for element with selector: //input[@name="q"] - to be visible.
|
|
143
|
-
[2022-11-02 16:34:33,991: INFO] Filling field: //input[@name="q"] with value: python
|
|
144
|
-
[2022-11-02 16:34:34,012: INFO] Waiting for element with selector: //button[@id="submit"] - to be visible.
|
|
145
|
-
[2022-11-02 16:34:34,026: INFO] Clicking on element: //button[@id="submit"]
|
|
146
|
-
[2022-11-02 16:34:34,411: INFO] Assert: see string /search/?q=python in current page URL
|
|
147
|
-
[2022-11-02 16:34:34,434: INFO] Quits the driver and closes every associated window
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
Congrats! You successfully created your first testing script using Vigilant Kit :)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|