Coder Social home page Coder Social logo

veenadevi / bdd_appium_framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nelsonblo/bdd_appium_framework

0.0 0.0 0.0 10 KB

This testing framework is developed for mobile application testing, utilizing Python, Behave, Allure Reporting, and Appium with the Page Object Model (POM) design principles. It has two features that were automated to test the James Rider app. Due to time restrictions, this framework only supports Android devices.

Python 92.73% Gherkin 7.27%

bdd_appium_framework's Introduction

Mobile Automation Testing Framework (BDD)

This testing framework is developed for mobile application testing, utilizing Python, Behave, Allure Reporting, and Appium with the Page Object Model (POM) design principles.

It's designed to provide a pretty simple, scalable, and easy-to-maintain testing solution for mobile applications.

It has two features that were automated to test the James Rider app. Due to time restrictions, this framework only supports Android devices.

It's highly not recommended to test apps on emulated devices, but for practical and time reasons, and only for demo, these instructions are made to run project Tests on emulators.

Project Pre-requisites

  • Python >= 3.x installed
  • Node/npm installed
  • Java installed with JAVA_HOME added to PATH (Java 8-202 is recommended for this project)
  • Android Studio installed with ANDROID_HOME added to PATH
  • Appium installed
  • UIAutomator2 driver installed
  • Allure Report installed
  • Mobile device must have installed the James Rider application version 1.22.0 (3416)
  • User must be logged once to the James Rider application. App can be closed if needed.

Setup Instructions

  1. Clone repository to your local system.

  2. Navigate to the project directory.

  3. Run this command in order to install all project python dependencies:

     pip install -r requirements.txt

    It's highly recommended to use python virtual environments

  4. Connect to your machine the mobile device with the James Rider app installed on it. You can use en Android Studio Emulator to load an emulated device. App can be closed if needed.

  5. Run this command to get the emulated device name:

    emulator -list-avds
  6. Modify appium:deviceName": "Pixel_3a" in /src/features/environment.py according to your device name.

  7. Run this command to load device:

    emulator @'device_name' -no-snapshot-load

Creating Tests

  • Add app page elements and methods under pages directory. Use classes.
  • Add BDD features under features/. The steps corresponding to these features must be located under /steps folder.
  • Ensure python naming standards are followed.

Tests made as example

There are 2 features already automated for the James Rider app.

  • Profile Changes
  • Logout

On Profile Changes there are 2 scenarios (Test Cases). One of them uses the Examples Table. On Logout there is only 1 scenario.

Both features were tagged with @android tag since these scripts were only developed for this platform.

Running Tests

Behave supports several ways to run tests.

  • Be sure to locate under /src directory.
  • Run all features at the automation project:
    behave ./features
  • Run only a specific feature:
      behave ./features/profile_change_profile.feature
  • Run tagged features or scenarios:
      behave  --tags="@names"
    In this case just one scenario will be executed.

Test Report

This framework uses Allure Report library to produce an HTML Test Report.

  • Run features with any of the previous commands.
  • Run this command to process the test results and save an HTML report into the allure-report directory.
    allure generate --clean
  • Run this command to view Test Report in system default browser:
    allure open

Project Structure

  • allure-report: Stores the test run report (index.html) and related files and directories.
  • allure-results: Stores result artifacts in json format used to generate the Allure report.
  • data: Centralized storage for test data.
  • features: Contains test definitions in Gherkin language features.
  • features/steps: Contains test steps.
  • features/environment: Contains configuration for the Appium driver.
  • pages: Central repository for all page objects of the application.
  • resources: Stores the application under test.
  • utils: Holds custom actions.
  • behave.ini: Behave-specific configuration.
  • requirements.txt: Framework dependencies.

bdd_appium_framework's People

Contributors

nelsonblo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.