qxf2 / qxf2-page-object-model

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.
https://qxf2.com
MIT License
256 stars 191 forks source link
appium automation automation-framework page-object python python3 qa selenium testrail

Python version GitHub Maintenance CircleCI BrowserStack Status GitHub stars GitHub forks GitHub repo size GitHub last commit Codacy Badge


A Pythonic Selenium, Appium and API test automation framework

You can use this test automation framework to write

  1. Selenium and Python automation scripts to test web applications

  2. Appium and Python scripts for mobile automation (Android and iOS)

  3. API automation scripts to test endpoints of your web/mobile applications

 

Qxf2 automation framework

 

This GUI and API test automation framework is developed and maintained by Qxf2 Services. This framework is written in Python and is based on the Page Object Model - a design pattern that makes it easy to maintain and develop robust tests. We have also included our API test automation framework based on the player-interface pattern in this repository. You can now write your API tests along with your Selenium and Appium tests.

We've implemented some version of this framework at several clients. In all cases, this framework helped us write automated tests within the first week of our engagement. We hope you find this framework useful too!

Looking for ways to automate your UI and API tests quickly and effectively? You've come to the right place. By harnessing AI and code auto-generation capabilities, we've developed solutions that significantly decrease the time needed to create a fully functional test suite. For further information, please refer to the following links.


Setup

The setup for our open-sourced Python test automation framework is fairly simple. We have documented the setup instructions in detail so even beginners can get started.

The setup has four parts:

  1. Prerequisites
  2. Setup for GUI/Selenium automation
  3. Setup for Mobile/Appium automation
  4. Setup for API automation

Above links redirects to our github wiki pages.

Optional steps for integrating with third-party tools:


Repository details

Directory structure of our current Templates

   ./

   |_ conf: For all configurations files

   |_ core_helpers: Contains our web app and mobile app helpers and DriverFactory  

   |_ endpoints: Contains our Base Mechanize, different End Points, API Player, API Interface

   |_ integrations: Contains cross-browsers (BrowserStack, SauceLabs, Lambdatest), reporting tools (TestRail, Tesults) and reporting channel integrations (Slack, Gmail) 

   |_ log: Log files for all tests

   |_ page_objects: Contains our PageFactory, different Page Objects examples

   |_ screenshots: For screenshots

   |_ tests: Put your tests here

   |_ utils: All utility modules (ssh_util, compare csv, compare images, Base Logger, etc) are kept in this folder

   |_ conftest.py: Configuration file to add different fixtures used in py.test

   |_ .env and .env.remote: For credential details. Refer env_conf and env_remote file and rename it to .env and .env_conf. 

For more details about the structure, refer our wiki page here


COMMANDS FOR RUNNING TESTS

a) General Command

python -m pytest [options]

Options

b) Specific Commands


ISSUES?

a) If Python complains about an "Import" exception, please 'pip3 install $module_name'

b) If you don't have drivers set up for the web browsers, you will see a helpful error from Selenium telling you where to go and get them

c) If your are using firefox 47 and above, you need to set up Geckodriver. Refer following link for setup: https://qxf2.com/blog/selenium-geckodriver-issue/

d) On Ubuntu, you may run into an issue installing the cryptography module. You need to sudo apt-get install libssl-dev and then run sudo pip install -r requirements.txt


Continuous Integration and Support

This project uses:

  1. BrowserStack for testing our web and mobile based tests on cloud across different platform and browsers.

  2. CircleCI for continuous integration.


NEED HELP?

Struggling to get your GUI automation going? You can hire Qxf2 Services to help. Contact us at mak@qxf2.com