Name | pybehave-selenium-test-framework JSON |
Version |
1.0.5
JSON |
| download |
home_page | None |
Summary | A powerful test automation framework designed to provide a comprehensive solution for testing user interfaces and APIs |
upload_time | 2025-01-13 15:33:49 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
keywords |
behave
selenium
|
VCS |
 |
bugtrack_url |
|
requirements |
allure-behave
allure-python-commons
art
attrs
azure-cli
azure-identity
azure-keyvault
azure-keyvault-secrets
behave
behavex
black
ddt
elementpath
Faker
iniconfig
Jinja2
numpy
packaging
panda
paramiko
parse
parse-type
pdfminer.six
pillow
pluggy
pre-commit
py
pyautogui
pygount
PyHamcrest
pylint
pyodbc
pyparsing
pytest
pyupgrade
requests
ruff
selenium
Selenium-Screenshot
setuptools
shortuuid
six
testresources
toml
typing-extensions
urllib3
wily
xmltodict
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## **PyBehave Selenium Test Automation Framework**






```
____ ____ _ ____ _ _
| _ \ _ _ | __ ) ___ | |__ __ _ __ __ ___ / ___| ___ | | ___ _ __ (_) _ _ _ __ ___
| |_) || | | || _ \ / _ \| '_ \ / _` |\ \ / / / _ \ _____ \___ \ / _ \| | / _ \| '_ \ | || | | || '_ ` _ \
| __/ | |_| || |_) || __/| | | || (_| | \ V / | __/|_____| ___) || __/| || __/| | | || || |_| || | | | | |
|_| \__, ||____/ \___||_| |_| \__,_| \_/ \___| |____/ \___||_| \___||_| |_||_| \__,_||_| |_| |_|
|___/
```
**PyBehave-Selenium-Test-Framework** is a powerful test automation framework designed to provide a comprehensive solution for testing user interfaces and APIs. It leverages the power of `Behave` framework, `Python` programming language and `Selenium` `WebDriver` to allow the creation robust and maintainable automated tests.
### Highlights
1. **Behaviour-Driven Development (BDD) Support** - allows testers to write tests in a human-readable format using `Gherkin` syntax, making it easier to collaborate with stakeholders and ensure test coverage.
2. **UI and API Testing** - supports testing both UIs and APIs, using `Selenium` `WebDriver` to interact with web browsers and `Python` `requests` library to send API requests and validate responses.
3. **Robustness** - when user interfaces are not 100% reliable, sometimes laggy, rendering speed varies, the core test logic will identify if elements are not present or clickable, back-off and attempt to retry a configurable number of times, and even perform browser refreshes if configured, to ensure the best attempt to execute the behaviour is performed.
4. **Cross-browser Support** - compatible with various web browsers, including Chrome and Edge; allowing tests to run across multiple browsers ensuring application compatibility and consistent behaviour. Note: the version of the web driver used must be compatible with the browser version installed.
5. **Test Data Management** - supports data-driven testing, allowing tests to read test data from external `template` files and use `Jinja2` templating engine to substitute in test specific data.
6. **Test Reporting and Logging** - support generating `allure` and `behavex` test reports to provide insight into test failures, captures screenshots of test failures for analysis; outputs clear log messages for every test action to aid debugging and troubleshooting.
7. **Extensibility and Customisation** - designed to be extensible and provides a simple, but flexible design for further customisation and integration of further third-party libraries.
### Design Overview
The design is split into two sections - **Test Suite** and **Framework Layer**.
* Test Suite - where the Gherkin style features are written with supporting step definitions calling down to page actions which orchestrate the test behaviour. This is where most business behaviour will be developed, making use of the framework layer.
* Framework Layer - contains the common re-usable functionality which drives the browser, contains common libs, provides logging and reporting.
<img src="overview.png" alt="drawing" style="width:400px;"/>
### Directory Structure
| Directory / File | Description |
|-----------|-------------|
| **features** | The `Gherkin` style feature files for defining BDD tests |
| **features/steps** | The step definitions backing the `Gherkin` tests |
| **features/environment.py** | Default test environment, can be overridden and customised |
| **support/facades** | Test logic facade actions potentially interacting across one or more pages |
| **support/pageactions** | The specific page actions, inheriting common actions from the `BasePage` |
| **support/core** | The core `ElementAction` which performs all the lower level selenium functionality |
| **support/locators** | Locator descriptors and types used for identifying web elements |
| **support/builder** | The templating builders to create supporting test data |
| **support/test-settings.json** | Default test settings, can be overridden and customised |
| **drivers** | The web drivers for supported browsers |
| **reports** | The json files generated with Allure reports |
| **screenshots** | The screenshots taken from failed tests |
| **requirements.txt** | File containing all the Python package dependencies |
## **Running the Tests**
### Pre-requisites
Install the required system dependencies. `sudo apt-get install requirements.system`.
Install the required Python module dependencies. `sudo pip install -r requirements.txt`.
Install the latest stable version of the web drivers you wish to use in `drivers`.
### Running the Example Test
An example test `login.feature` has been created to demonstrate a simple working test. It provides a username and password to login to a website, verifies the login and attempts to log the user out.
`behave features/example/login.feature`
Note: A compatible web driver will need to be available in the `drivers` folder and configured in the `test-settings.json` file.
The example login highlights the test suite and framework layers - a user defined `Gherkin` test with backing test logic; interacting with the web browser through the framework `BasePage`.
+---------------+ +---------------+ +----------------+ +--------------+ +------------------+
| login.feature | <-> | loginsteps.py | <-> | loginaction.py | <-> | loginpage.py | -> | loginlocators.py |
+---------------+ +---------------+ +----------------+ +--------------+ +------------------+
|
+-------------+ +------------------+ +-------------+
| basepage.py | <-> | elementaction.py | <-> | Web Browser |
+-------------+ +------------------+ +-------------+
There are also example tests for `database` connectivity and `API` requests.
### Logging Output
When running tests each step is logged in a format to assist with understanding the execution and with debugging issues.
```
Feature: Example Login # features/example/login.feature:4
2024-02-14 18:17:13 INFO Scenario <Scenario "Login to demo site"> - starting
2024-02-14 18:17:13 INFO Edge browser
2024-02-14 18:17:13 INFO Web driver: drivers/msedgedriver
Scenario: Login to demo site # features/example/login.feature:6
Given I have navigated to url "https://demo.applitools.com" # features/steps/example/login_steps.py:9 0.342s
When I enter username "Operator" and password "Password" # features/steps/example/login_steps.py:16
2024-02-14 18:17:20 INFO Login user Operator - start
2024-02-14 18:17:20 INFO Checking element '//input[@id='username']' (XPATH) is clickable
2024-02-14 18:17:20 INFO Clicked on element 'XPATH, //input[@id='username']'
2024-02-14 18:17:22 INFO Typed text Operator on element XPATH, //input[@id='username']
2024-02-14 18:17:22 INFO Checking element '//input[@id='password']' (XPATH) is clickable
2024-02-14 18:17:22 INFO Clicked on element 'XPATH, //input[@id='password']'
2024-02-14 18:17:24 INFO Typed text ***** on element XPATH, //input[@id='password']
2024-02-14 18:17:24 INFO Checking element '//a[@id='log-in']' (XPATH) is clickable
2024-02-14 18:17:24 INFO Clicked on element 'XPATH, //a[@id='log-in']'
2024-02-14 18:17:25 INFO Login user Operator - complete
2024-02-14 18:17:25 INFO Repeat until locator 'XPATH, //div[@class='logged-user-w']' is displayed
2024-02-14 18:17:25 INFO Locator 'XPATH, //div[@class='logged-user-w']' displayed
Then I can verify the items are present # features/steps/example/login_steps.py:23 0.134s
| item | Get text returned Financial Overview for element XPATH, //h6[@class='element-header']
| Financial Overview | Completed step <then "I can verify the items are present">
And I logout # features/steps/example/login_steps.py:31
2024-02-14 18:17:26 INFO Checking element '//a[@id='log-out']' (XPATH) is clickable
2024-02-14 18:17:31 WARNING Unable to click on element 'XPATH, //a[@id='log-out']'
2024-02-14 18:17:31 INFO Pausing for 5 seconds
2024-02-14 18:17:36 INFO Retry clicking on element 'XPATH, //a[@id='log-out']'
2024-02-14 18:17:41 WARNING Unable to click on element 'XPATH, //a[@id='log-out']'
2024-02-14 18:17:42 INFO Scenario <Scenario "Login to demo site"> - complete
1 feature passed, 0 failed, 0 skipped
1 scenario passed, 0 failed, 0 skipped
4 steps passed, 0 failed, 0 skipped, 0 undefined
Took 0m22.608s
```
## Pre-commit checks
Runs hooks on every commit to automatically point out issues in code. Run ` $ pre-commit install` to setup the git hook scripts
https://pre-commit.com/
### black
Black is the uncompromising Python code formatter. Run `black **/*.py`
https://pypi.org/project/black/
### pylint
Pylint is a static code analyser for Python. Run `pylint *.py`
https://pypi.org/project/pylint/
### Run example test without allure reporting
`behave features/example/login.feature`
### Run example test with allure reporting
`behave -f allure_behave.formatter:AllureFormatter -o reports/ features/example/login.feature`
## **Running the Tests from Docker**
Build the docker image: `docker build -t [IMAGE_NAME]:[IMAGE_TAG] .`
To execute tests in a docker container, run the following. `docker run -it -v /tmp/reports:/src/reports [IMAGE_NAME]:[IMAGE_TAG] behave features/example/login.feature`
### View Test Reports
To view Allure test reports, run the command: `allure serve /tmp/reports`.
Note: You will need to install Allure Report from https://allurereport.org/.
## Selenium Grid (currently not fully implemented)
Selenium Grid will be used with Azure Kubernetes Service (AKS) to auto-scale when running the tests. Using AKS and KEDA (Kubernetes Event-driven Autoscaling) will monitor the Selenium test queue and scale nodes accordingly.
<img src="selenium-grid-overview.png" alt="drawing" style="width:600px;"/>
### Running tests against Selenium Grid
To run tests against Selenium Grid you need to be able to access the Hub UI. At the moment this has to be done using Kubernetes port-forwarding but in the future can be updated to expose the hub via a load balancer. Run `kubectl -n selenium port-forward svc/selenium-hub 4444` to port forward the Hub to localhost:4444
To use Selenium Grid update the settings.json to use the 'GRID' test runner by setting the property `"test_runner": "GRID"`. Once this has been set, the tests will try and run against a remote browser. You'll also need to set `"selenium_grid_endpoint": "http://localhost:4444/wd/hub"` to tell it where the Hub is.
To run the tests, you can run the exact same commands as described in the previous section. This won't however make use of the multiple worker feature of Selenium Grid. To run the tests in parallel, run the below command.
## Future Feature Enhancements
- [ ] Support concurrent running against multiple browser types
- [ ] Selenium Grid
- [ ] Integration with Azure keyvault
## References
https://behave.readthedocs.io/en/stable/
https://www.selenium.dev/documentation/webdriver/
https://github.com/Azure-Samples/selenium-grid-aks-keda
https://allurereport.org/
Raw data
{
"_id": null,
"home_page": null,
"name": "pybehave-selenium-test-framework",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "behave, selenium",
"author": null,
"author_email": "Argo DevOps <enquiry@argodevops.co.uk>",
"download_url": "https://files.pythonhosted.org/packages/a3/4e/e6872d814a07007a4dcb325035563c93f28c024c28664d030f2f6e7dc33e/pybehave_selenium_test_framework-1.0.5.tar.gz",
"platform": null,
"description": "## **PyBehave Selenium Test Automation Framework**\n\n\n\n\n\n\n\n\n```\n ____ ____ _ ____ _ _\n| _ \\ _ _ | __ ) ___ | |__ __ _ __ __ ___ / ___| ___ | | ___ _ __ (_) _ _ _ __ ___\n| |_) || | | || _ \\ / _ \\| '_ \\ / _` |\\ \\ / / / _ \\ _____ \\___ \\ / _ \\| | / _ \\| '_ \\ | || | | || '_ ` _ \\\n| __/ | |_| || |_) || __/| | | || (_| | \\ V / | __/|_____| ___) || __/| || __/| | | || || |_| || | | | | |\n|_| \\__, ||____/ \\___||_| |_| \\__,_| \\_/ \\___| |____/ \\___||_| \\___||_| |_||_| \\__,_||_| |_| |_|\n |___/\n```\n\n**PyBehave-Selenium-Test-Framework** is a powerful test automation framework designed to provide a comprehensive solution for testing user interfaces and APIs. It leverages the power of `Behave` framework, `Python` programming language and `Selenium` `WebDriver` to allow the creation robust and maintainable automated tests.\n\n### Highlights\n1. **Behaviour-Driven Development (BDD) Support** - allows testers to write tests in a human-readable format using `Gherkin` syntax, making it easier to collaborate with stakeholders and ensure test coverage.\n\n2. **UI and API Testing** - supports testing both UIs and APIs, using `Selenium` `WebDriver` to interact with web browsers and `Python` `requests` library to send API requests and validate responses.\n\n3. **Robustness** - when user interfaces are not 100% reliable, sometimes laggy, rendering speed varies, the core test logic will identify if elements are not present or clickable, back-off and attempt to retry a configurable number of times, and even perform browser refreshes if configured, to ensure the best attempt to execute the behaviour is performed.\n\n4. **Cross-browser Support** - compatible with various web browsers, including Chrome and Edge; allowing tests to run across multiple browsers ensuring application compatibility and consistent behaviour. Note: the version of the web driver used must be compatible with the browser version installed.\n\n5. **Test Data Management** - supports data-driven testing, allowing tests to read test data from external `template` files and use `Jinja2` templating engine to substitute in test specific data.\n\n6. **Test Reporting and Logging** - support generating `allure` and `behavex` test reports to provide insight into test failures, captures screenshots of test failures for analysis; outputs clear log messages for every test action to aid debugging and troubleshooting.\n\n7. **Extensibility and Customisation** - designed to be extensible and provides a simple, but flexible design for further customisation and integration of further third-party libraries.\n\n### Design Overview\n\nThe design is split into two sections - **Test Suite** and **Framework Layer**.\n\n* Test Suite - where the Gherkin style features are written with supporting step definitions calling down to page actions which orchestrate the test behaviour. This is where most business behaviour will be developed, making use of the framework layer.\n* Framework Layer - contains the common re-usable functionality which drives the browser, contains common libs, provides logging and reporting.\n\n<img src=\"overview.png\" alt=\"drawing\" style=\"width:400px;\"/>\n\n### Directory Structure\n\n| Directory / File | Description |\n|-----------|-------------|\n| **features** | The `Gherkin` style feature files for defining BDD tests |\n| **features/steps** | The step definitions backing the `Gherkin` tests |\n| **features/environment.py** | Default test environment, can be overridden and customised |\n| **support/facades** | Test logic facade actions potentially interacting across one or more pages |\n| **support/pageactions** | The specific page actions, inheriting common actions from the `BasePage` |\n| **support/core** | The core `ElementAction` which performs all the lower level selenium functionality |\n| **support/locators** | Locator descriptors and types used for identifying web elements |\n| **support/builder** | The templating builders to create supporting test data |\n| **support/test-settings.json** | Default test settings, can be overridden and customised |\n| **drivers** | The web drivers for supported browsers |\n| **reports** | The json files generated with Allure reports |\n| **screenshots** | The screenshots taken from failed tests |\n| **requirements.txt** | File containing all the Python package dependencies |\n\n## **Running the Tests**\n\n### Pre-requisites\n\nInstall the required system dependencies. `sudo apt-get install requirements.system`.\n\nInstall the required Python module dependencies. `sudo pip install -r requirements.txt`.\n\nInstall the latest stable version of the web drivers you wish to use in `drivers`.\n\n### Running the Example Test\n\nAn example test `login.feature` has been created to demonstrate a simple working test. It provides a username and password to login to a website, verifies the login and attempts to log the user out.\n\n`behave features/example/login.feature`\n\nNote: A compatible web driver will need to be available in the `drivers` folder and configured in the `test-settings.json` file.\n\nThe example login highlights the test suite and framework layers - a user defined `Gherkin` test with backing test logic; interacting with the web browser through the framework `BasePage`.\n\n +---------------+ +---------------+ +----------------+ +--------------+ +------------------+\n | login.feature | <-> | loginsteps.py | <-> | loginaction.py | <-> | loginpage.py | -> | loginlocators.py |\n +---------------+ +---------------+ +----------------+ +--------------+ +------------------+\n |\n +-------------+ +------------------+ +-------------+\n | basepage.py | <-> | elementaction.py | <-> | Web Browser |\n +-------------+ +------------------+ +-------------+\n\nThere are also example tests for `database` connectivity and `API` requests.\n\n### Logging Output\n\nWhen running tests each step is logged in a format to assist with understanding the execution and with debugging issues.\n\n```\nFeature: Example Login # features/example/login.feature:4\n2024-02-14 18:17:13 INFO Scenario <Scenario \"Login to demo site\"> - starting\n2024-02-14 18:17:13 INFO Edge browser\n2024-02-14 18:17:13 INFO Web driver: drivers/msedgedriver\n\n Scenario: Login to demo site # features/example/login.feature:6\n Given I have navigated to url \"https://demo.applitools.com\" # features/steps/example/login_steps.py:9 0.342s\n When I enter username \"Operator\" and password \"Password\" # features/steps/example/login_steps.py:16\n2024-02-14 18:17:20 INFO Login user Operator - start\n2024-02-14 18:17:20 INFO Checking element '//input[@id='username']' (XPATH) is clickable\n2024-02-14 18:17:20 INFO Clicked on element 'XPATH, //input[@id='username']'\n2024-02-14 18:17:22 INFO Typed text Operator on element XPATH, //input[@id='username']\n2024-02-14 18:17:22 INFO Checking element '//input[@id='password']' (XPATH) is clickable\n2024-02-14 18:17:22 INFO Clicked on element 'XPATH, //input[@id='password']'\n2024-02-14 18:17:24 INFO Typed text ***** on element XPATH, //input[@id='password']\n2024-02-14 18:17:24 INFO Checking element '//a[@id='log-in']' (XPATH) is clickable\n2024-02-14 18:17:24 INFO Clicked on element 'XPATH, //a[@id='log-in']'\n2024-02-14 18:17:25 INFO Login user Operator - complete\n2024-02-14 18:17:25 INFO Repeat until locator 'XPATH, //div[@class='logged-user-w']' is displayed\n2024-02-14 18:17:25 INFO Locator 'XPATH, //div[@class='logged-user-w']' displayed\n Then I can verify the items are present # features/steps/example/login_steps.py:23 0.134s\n | item | Get text returned Financial Overview for element XPATH, //h6[@class='element-header']\n | Financial Overview | Completed step <then \"I can verify the items are present\">\n And I logout # features/steps/example/login_steps.py:31\n2024-02-14 18:17:26 INFO Checking element '//a[@id='log-out']' (XPATH) is clickable\n2024-02-14 18:17:31 WARNING Unable to click on element 'XPATH, //a[@id='log-out']'\n2024-02-14 18:17:31 INFO Pausing for 5 seconds\n2024-02-14 18:17:36 INFO Retry clicking on element 'XPATH, //a[@id='log-out']'\n2024-02-14 18:17:41 WARNING Unable to click on element 'XPATH, //a[@id='log-out']'\n2024-02-14 18:17:42 INFO Scenario <Scenario \"Login to demo site\"> - complete\n\n1 feature passed, 0 failed, 0 skipped\n1 scenario passed, 0 failed, 0 skipped\n4 steps passed, 0 failed, 0 skipped, 0 undefined\nTook 0m22.608s\n```\n\n## Pre-commit checks\n\nRuns hooks on every commit to automatically point out issues in code. Run ` $ pre-commit install` to setup the git hook scripts\n\nhttps://pre-commit.com/\n\n### black\n\nBlack is the uncompromising Python code formatter. Run `black **/*.py`\n\nhttps://pypi.org/project/black/\n\n### pylint\n\nPylint is a static code analyser for Python. Run `pylint *.py`\n\nhttps://pypi.org/project/pylint/\n\n### Run example test without allure reporting\n`behave features/example/login.feature`\n\n### Run example test with allure reporting\n`behave -f allure_behave.formatter:AllureFormatter -o reports/ features/example/login.feature`\n\n## **Running the Tests from Docker**\n\nBuild the docker image: `docker build -t [IMAGE_NAME]:[IMAGE_TAG] .`\n\nTo execute tests in a docker container, run the following. `docker run -it -v /tmp/reports:/src/reports [IMAGE_NAME]:[IMAGE_TAG] behave features/example/login.feature`\n\n### View Test Reports\nTo view Allure test reports, run the command: `allure serve /tmp/reports`.\n\nNote: You will need to install Allure Report from https://allurereport.org/.\n\n## Selenium Grid (currently not fully implemented)\n\nSelenium Grid will be used with Azure Kubernetes Service (AKS) to auto-scale when running the tests. Using AKS and KEDA (Kubernetes Event-driven Autoscaling) will monitor the Selenium test queue and scale nodes accordingly.\n\n<img src=\"selenium-grid-overview.png\" alt=\"drawing\" style=\"width:600px;\"/>\n\n### Running tests against Selenium Grid\nTo run tests against Selenium Grid you need to be able to access the Hub UI. At the moment this has to be done using Kubernetes port-forwarding but in the future can be updated to expose the hub via a load balancer. Run `kubectl -n selenium port-forward svc/selenium-hub 4444` to port forward the Hub to localhost:4444\n\nTo use Selenium Grid update the settings.json to use the 'GRID' test runner by setting the property `\"test_runner\": \"GRID\"`. Once this has been set, the tests will try and run against a remote browser. You'll also need to set `\"selenium_grid_endpoint\": \"http://localhost:4444/wd/hub\"` to tell it where the Hub is.\n\nTo run the tests, you can run the exact same commands as described in the previous section. This won't however make use of the multiple worker feature of Selenium Grid. To run the tests in parallel, run the below command.\n\n## Future Feature Enhancements\n\n- [ ] Support concurrent running against multiple browser types\n- [ ] Selenium Grid\n- [ ] Integration with Azure keyvault\n\n## References\n\nhttps://behave.readthedocs.io/en/stable/\n\nhttps://www.selenium.dev/documentation/webdriver/\n\nhttps://github.com/Azure-Samples/selenium-grid-aks-keda\n\nhttps://allurereport.org/\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License. \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\" \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
"summary": "A powerful test automation framework designed to provide a comprehensive solution for testing user interfaces and APIs",
"version": "1.0.5",
"project_urls": {
"Homepage": "https://github.com/argodevops/pytest-behave",
"Issues": "https://github.com/argodevops/pytest-behave/issues"
},
"split_keywords": [
"behave",
" selenium"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf0dc866cda351dfbd829d40cd9063bf601c11ad851ed4728ed32672749e2975",
"md5": "ac7b31a0b79032e6ef06af4c5d924a56",
"sha256": "755d258b390c565205f62459e023ee447f5e59bda57e8ce3424617c6cc57aa04"
},
"downloads": -1,
"filename": "pybehave_selenium_test_framework-1.0.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ac7b31a0b79032e6ef06af4c5d924a56",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 17547790,
"upload_time": "2025-01-13T15:33:44",
"upload_time_iso_8601": "2025-01-13T15:33:44.653952Z",
"url": "https://files.pythonhosted.org/packages/bf/0d/c866cda351dfbd829d40cd9063bf601c11ad851ed4728ed32672749e2975/pybehave_selenium_test_framework-1.0.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a34ee6872d814a07007a4dcb325035563c93f28c024c28664d030f2f6e7dc33e",
"md5": "0890ee883ed90a2cfd15acdd4b35345f",
"sha256": "961b544653729124ede43cc8a6d180b7033491d5106a1b208b9a14d8e9f68ce8"
},
"downloads": -1,
"filename": "pybehave_selenium_test_framework-1.0.5.tar.gz",
"has_sig": false,
"md5_digest": "0890ee883ed90a2cfd15acdd4b35345f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 17548189,
"upload_time": "2025-01-13T15:33:49",
"upload_time_iso_8601": "2025-01-13T15:33:49.337570Z",
"url": "https://files.pythonhosted.org/packages/a3/4e/e6872d814a07007a4dcb325035563c93f28c024c28664d030f2f6e7dc33e/pybehave_selenium_test_framework-1.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-13 15:33:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "argodevops",
"github_project": "pytest-behave",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "allure-behave",
"specs": [
[
">=",
"2.13.2"
]
]
},
{
"name": "allure-python-commons",
"specs": [
[
">=",
"2.13.2"
]
]
},
{
"name": "art",
"specs": [
[
">=",
"6.1"
]
]
},
{
"name": "attrs",
"specs": [
[
">=",
"23.1.0"
]
]
},
{
"name": "azure-cli",
"specs": [
[
">=",
"2.53.1"
]
]
},
{
"name": "azure-identity",
"specs": [
[
">=",
"1.16.1"
]
]
},
{
"name": "azure-keyvault",
"specs": [
[
">=",
"4.2.0"
]
]
},
{
"name": "azure-keyvault-secrets",
"specs": [
[
">=",
"4.7.0"
]
]
},
{
"name": "behave",
"specs": [
[
">=",
"1.2.6"
]
]
},
{
"name": "behavex",
"specs": [
[
">=",
"2.0.1"
]
]
},
{
"name": "black",
"specs": [
[
">=",
"24.3.0"
]
]
},
{
"name": "ddt",
"specs": [
[
">=",
"1.6.0"
]
]
},
{
"name": "elementpath",
"specs": [
[
">=",
"4.1.4"
]
]
},
{
"name": "Faker",
"specs": [
[
">=",
"19.1.0"
]
]
},
{
"name": "iniconfig",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "Jinja2",
"specs": [
[
">=",
"3.1.5"
]
]
},
{
"name": "numpy",
"specs": [
[
">=",
"1.22.2"
]
]
},
{
"name": "packaging",
"specs": [
[
">=",
"23.1"
]
]
},
{
"name": "panda",
"specs": [
[
">=",
"0.3.1"
]
]
},
{
"name": "paramiko",
"specs": [
[
">=",
"3.4.0"
]
]
},
{
"name": "parse",
"specs": [
[
">=",
"1.19.1"
]
]
},
{
"name": "parse-type",
"specs": [
[
">=",
"0.6.2"
]
]
},
{
"name": "pdfminer.six",
"specs": [
[
">=",
"20240706"
]
]
},
{
"name": "pillow",
"specs": [
[
">=",
"10.3.0"
]
]
},
{
"name": "pluggy",
"specs": [
[
">=",
"1.2.0"
]
]
},
{
"name": "pre-commit",
"specs": [
[
">=",
"3.3.3"
]
]
},
{
"name": "py",
"specs": [
[
">=",
"1.11.0"
]
]
},
{
"name": "pyautogui",
"specs": [
[
">=",
"0.9.54"
]
]
},
{
"name": "pygount",
"specs": [
[
">=",
"1.2.4"
]
]
},
{
"name": "PyHamcrest",
"specs": [
[
">=",
"2.1.0"
]
]
},
{
"name": "pylint",
"specs": [
[
">=",
"2.17.4"
]
]
},
{
"name": "pyodbc",
"specs": [
[
">=",
"4.0.39"
]
]
},
{
"name": "pyparsing",
"specs": [
[
">=",
"3.1.0"
]
]
},
{
"name": "pytest",
"specs": [
[
">=",
"7.4.0"
]
]
},
{
"name": "pyupgrade",
"specs": [
[
">=",
"3.15.0"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.32.0"
]
]
},
{
"name": "ruff",
"specs": [
[
">=",
"0.2.1"
]
]
},
{
"name": "selenium",
"specs": [
[
">=",
"4.15.2"
]
]
},
{
"name": "Selenium-Screenshot",
"specs": [
[
">=",
"2.1.0"
]
]
},
{
"name": "setuptools",
"specs": [
[
">=",
"65.5.1"
]
]
},
{
"name": "shortuuid",
"specs": [
[
">=",
"1.0.11"
]
]
},
{
"name": "six",
"specs": [
[
">=",
"1.16.0"
]
]
},
{
"name": "testresources",
"specs": [
[
">=",
"2.0.1"
]
]
},
{
"name": "toml",
"specs": [
[
">=",
"0.10.2"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
">=",
"4.7.1"
]
]
},
{
"name": "urllib3",
"specs": [
[
">=",
"2.2.2"
]
]
},
{
"name": "wily",
"specs": [
[
">=",
"1.24.2"
]
]
},
{
"name": "xmltodict",
"specs": [
[
">=",
"0.13.0"
]
]
}
],
"lcname": "pybehave-selenium-test-framework"
}