Write Selenium and Appium tests in Python using the Page Object pattern. This Pythonic GUI and API test automation framework will help you get started with QA automation quickly. It comes with many useful integrations like - email, BrowserStack, Slack, TestRail, etc. This repository is developed and maintained by Qxf2 Services.
Split the code in driverfactory.py to two other files 'page_objects/drivers/remote_options.py' and 'page_objects/drivers/local_browsers.py'
Created a new file 'conf/ports_conf.py' to store the port number to run the test against locally. Importing this port into driverfactory.py
Changed the instances of 'DriverFactory.py' to 'driverfactory.py' in 'conf/copy_framework_template_conf.py', 'page_objects/Base_Page.py'and 'page_objects/Mobile_Base_Page.py'
Created a file page_objects/drivers/init.py to facilitate importing of files in that directory
Fixed most of the pylint issues that were possible to resolve.
How to test
Run the selenium tests locally , testing with different browsers using the command:
pytest tests/test_example_form.py --browser=firefox
Run the selenium tests remotely by setting the BrowserStack or Saucelabs credentials in 'remote_credentials.py' file and using the command:
python -m pytest -k example_form --browser firefox --ver 77 --os_name windows --os_version 10 --remote_flag y
Run the mobile tests by setting the BrowserStack or Saucelab credentials in 'remote_credentials.py' file and using command:
python -m pytest -s -v -k mobile_bitcoin_price --mobile_os_version 8.0 --device_name "Samsung Galaxy S9" --app_path "D:\bitcoin\bitcoin-info-master\bitcoin-info-master\app" --app_name "Bitcoin Info_com.dudam.rohan.bitcoininfo.apk" --remote_flag Y
In this PR I have refactored the Driverfactory code.
Files changed
What has been changed?
Refactored the DriverFactory.py file with reference to issue https://github.com/qxf2/qxf2-page-object-model/issues/213
Renamed 'DriverFactory.py' to 'driverfactory.py'
Split the code in driverfactory.py to two other files 'page_objects/drivers/remote_options.py' and 'page_objects/drivers/local_browsers.py'
Created a new file 'conf/ports_conf.py' to store the port number to run the test against locally. Importing this port into driverfactory.py
Changed the instances of 'DriverFactory.py' to 'driverfactory.py' in 'conf/copy_framework_template_conf.py', 'page_objects/Base_Page.py'and 'page_objects/Mobile_Base_Page.py'
Created a file page_objects/drivers/init.py to facilitate importing of files in that directory
Fixed most of the pylint issues that were possible to resolve.
How to test
Run the selenium tests locally , testing with different browsers using the command:
pytest tests/test_example_form.py --browser=firefox
Run the selenium tests remotely by setting the BrowserStack or Saucelabs credentials in 'remote_credentials.py' file and using the command:
python -m pytest -k example_form --browser firefox --ver 77 --os_name windows --os_version 10 --remote_flag y
Run the mobile tests by setting the BrowserStack or Saucelab credentials in 'remote_credentials.py' file and using command:
python -m pytest -s -v -k mobile_bitcoin_price --mobile_os_version 8.0 --device_name "Samsung Galaxy S9" --app_path "D:\bitcoin\bitcoin-info-master\bitcoin-info-master\app" --app_name "Bitcoin Info_com.dudam.rohan.bitcoininfo.apk" --remote_flag Y
The CircleCI test results can be found here: https://app.circleci.com/pipelines/github/qxf2/qxf2-page-object-model/229/workflows/b294884c-1978-450b-909b-5c992aafe454/jobs/1045