All Projects β†’ karimelkomy β†’ Python-Test-Automation-Framework

karimelkomy / Python-Test-Automation-Framework

Licence: other
Test Automation Framework using selenium and Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python-Test-Automation-Framework

MasterSeleniumFramework
Automation Testing | Web | Java | OOPS | Selenium WebDriver | TestNG | Maven | ExtentReport | Allure Reports | Java mail API | Design Patterns (Page Object Model, Singleton) | Jenkins | Data-Driven Testing using JSON file
Stars: ✭ 52 (+26.83%)
Mutual labels:  selenium, test-automation, page-object-model
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. πŸ§ πŸ’‘
Stars: ✭ 2,520 (+6046.34%)
Mutual labels:  selenium, test-automation, pytest
MasterAppiumFramework
Automation Testing | Mobile | Java | OOPS | Appium | TestNG | Maven | ExtentReport | Java mail API | Logging (Log4J2) | Design Patterns (Page Object Model, Singleton) | Page Factories | Jenkins | Data-Driven Testing using JSON file | Expected Data using XML file
Stars: ✭ 27 (-34.15%)
Mutual labels:  test-automation, page-object-model
screenpy
Screenplay pattern base for Python automated UI test suites.
Stars: ✭ 38 (-7.32%)
Mutual labels:  test-automation, allure
request-baskets
HTTP requests collector to test webhooks, notifications, REST clients and more ...
Stars: ✭ 149 (+263.41%)
Mutual labels:  qa, test-automation
python-appium-framework
Complete Python Appium framework in 360 degree
Stars: ✭ 43 (+4.88%)
Mutual labels:  selenium, pytest
pysys-test
PySys System Test Framework
Stars: ✭ 14 (-65.85%)
Mutual labels:  qa, test-automation
extensiveautomation-server
Extensive Automation server
Stars: ✭ 19 (-53.66%)
Mutual labels:  selenium, test-automation
Python-Studies
All studies about python
Stars: ✭ 56 (+36.59%)
Mutual labels:  selenium, pytest
EHX
Realtime Browser Element Verification Tool [Stable]
Stars: ✭ 29 (-29.27%)
Mutual labels:  selenium, test-automation
python-page-object
πŸ“” Page object design pattern implementation (python, pom, selenium, pytest, travisCI)
Stars: ✭ 41 (+0%)
Mutual labels:  pytest, page-object-model
page-modeller
βš™οΈ Browser DevTools extension for modelling web pages for automation.
Stars: ✭ 66 (+60.98%)
Mutual labels:  selenium, test-automation
frameworkium-examples
Sample project which utilises frameworkium-core, a framework for writing maintainable Selenium and REST API tests and facilitates reporting and integration to JIRA.
Stars: ✭ 52 (+26.83%)
Mutual labels:  selenium, allure
carina
Carina automation framework: Web, Mobile, API, DB etc testing...
Stars: ✭ 652 (+1490.24%)
Mutual labels:  selenium, test-automation
selenium-java
This is the sample repository that we use in the Complete Selenium WebDriver with Java Bootcamp
Stars: ✭ 45 (+9.76%)
Mutual labels:  selenium, test-automation
test junkie
Highly configurable testing framework for Python
Stars: ✭ 72 (+75.61%)
Mutual labels:  qa, test-automation
selenified
The Selenified Test Framework provides mechanisms for simply testing applications at multiple tiers while easily integrating into DevOps build environments. Selenified provides traceable reporting for both web and API testing, wraps and extends Selenium calls to more appropriately handle testing errors, and supports testing over multiple browser…
Stars: ✭ 38 (-7.32%)
Mutual labels:  selenium, test-automation
overhave
Web-framework for BDD: scalable, configurable, easy to use, based on Flask Admin and Pydantic.
Stars: ✭ 61 (+48.78%)
Mutual labels:  pytest, allure
elm-webdriver
A library for controlling a browser using Elm and selenium
Stars: ✭ 60 (+46.34%)
Mutual labels:  selenium, test-automation
Selenium-Foundation
Selenium Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium (WebDriver).
Stars: ✭ 51 (+24.39%)
Mutual labels:  selenium, page-object-model

Python-Test-Automation-Framework

Description

Test Automation Framework using selenium and Python with the below features:

  • Framework is based on page object model.
  • Reporting using Allure report.
  • Reading locators from JSON file.
  • Reading test data from JSON file.
  • Integrated with TestRail to update test cases status after each run.
  • Framework can integrate with CodeShip.

Install dependences

  • Install the depended packages in requirements.txt using pip install -r requirements.txt

Create new test case

In order to create a new test case using the Framework, you have to follow the below steps:

  • In locators module, create a new locator for the element you would like to use, as below:

      [{
          "pageName": "HomePage",
          "name": "link_login",
          "locateUsing": "xpath",
          "locator": "//a[contains(text(),'Log In')]"
      }]
    
  • In test data module, add the test data needed for your test case, as below:

      {
          "environment": "https://learn.letskodeit.com/",
          "browser": "firefox",
          "email": "[email protected]",
          "password": "abcabc"
      }
    
  • If the element exist in more than one page (Navigation element), use navigation module to create a script for that navigation bar and add your navigation action to that element, as below:

      def goToLoginPage(self):
          self.elementClick(*self.locator(self.homePage_locators, 'link_login'))
    
  • If the element exists in only one page, go to page module and create a new script for that page e.g: login_page.py and add all the actions in that page, as below:

      def login(self, email, password):
          self.sendKeys(email, *self.locator(self.loginPage_locators, 'input_email'))
          self.sendKeys(password, *self.locator(self.loginPage_locators, 'input_password'))
          self.elementClick(*self.locator(self.loginPage_locators, 'btn_login'))
    
  • Then, in test module, create a new script for your test case(s) e.g: test_login.py and add your test case, as below:

      @allure.story('epic_1') # story of the test case
      @allure.severity(allure.severity_level.MINOR) # severity of the test case
      @pytestrail.case('C48') # test case id on test rail
      def test_login_successfully(self):
      
          with allure.step('Navigate to login page'): # name of the test step
              self.homeNavigation.goToLoginPage()
              self.ts.markFinal(self.loginPage.isAt, "navigation to login page failed") # check if the navigation to login page occurs successfully
    
          with allure.step('Login'): # name of the test step
              self.loginPage.login(email=td.testData("email"), password=td.testData("password"))
              self.ts.markFinal(self.dashboardPage.isAt, "login failed") # check if login successfully
    

Notes:

  • use @allure.story('[epic name]') decorator before each test case to define the related epic / story.
  • use @allure.severity(allure.severity_level.[severity]) decorator before each test case to define the severity of the test case Minor/Major/Critical/Blocker.
  • use @pytestrail.case('[test case id on testrail]') decorator before each test case to defione the related test case id on test rail to make the script update run status on test rail.

Run the test case

In order to run the test case after creation, use on of the below commands:

  • To run the test case and create allure report but without update the status run on TestRail:

py.test --alluredir=allure_report tests/test_login.py

allure serve allure_report

  • To run the test case, create allure report and update the status of run on TestRail:

py.test --alluredir=allure_report tests/test_login.py --testrail

allure serve allure_report

Note:

  • There are other options of run that you can search for them, as running all the test cases for specific epic/story or with specific severity

Integration with TestRail

In order to setup the integration with TestRail, edit testrail.cfg with your testrail domain and credentials, as below:

    [API]
    url = https://[your testrail domain].testrail.io
    email = [testrail email]
    password = [testrail password]

    [TESTRUN]
    project_id = [project id]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].