Giter VIP home page Giter VIP logo

mobile-test's Introduction

Appium+groovy+cucumber framework for mobile test automation

This framework purpose is the implementation and execution of acceptance tests for android mobile application. It consists of predefined dependencies and API's that will help to describe the expected behaviour of mobile app.

Core dependencies

  • Appium - test automation framework for use with native, hybrid and mobile web apps
  • Cucumber - provides the natural Gherkin language used to describe application features, a basic API for binding that natural language to step definitions written in Groovy
  • PageObject - design pattern which helps you to encapsulate the expected structure and mechanics of your application's UI.
  • JUnit - for asserting expectations of scenario outcomes

Getting Started

Run "gradle clean" or "./gradlew clean" terminal command from project core directory to install dependencies.

Architecture

Framework is divided in such subsections:

  • properties
  • src/test/groovy/framework
  • src/test/groovy/locators
  • src/test/groovy/page_objects
  • src/test/groovy/steps
  • src/test/resources/features

properties - default configuration is loaded from "default.properties". It consists of various setups for Appium dirver instance like platform version, device name, Appium server url etc.

framework - core of the testing framework like abstract pageobject, hooks etc.

locators - locator storage, used inside of page objects to interact with page elements

page_objects - page object storage, classes with all the encapsulated logic of interaction with them

steps - step definitions written in Groovy which is mapped with real test cases written in Gherkin

features - feature files written in Gherkin language

Writing Test Cases

Acceptance TC are written in Gherkin language inside feature file which are stored in "features" directory and then mapped to a step implementation in Groovy inside step classes.

Running Test Cases

Precondition

Install Appium with all the mandatory dependencies like Android SDK etc. You can find how to do it on Appium official webpage - http://appium.io/

Execution
  1. Before executing tests you need to create an android emulator which will be used as a testing device or connect a real physical device to you machine. With existing config it should be an Android emulator with OS version 8.0
  2. Run the Android emulator you just created - "emulator -avd <emulator_name>"
  3. Run Appium server - "appium"
  4. Check for the correct data in your config file - default.properties. Appium server url should be you appium node instance host.
  5. To execute a test case run "gradle clean test" or "./gradlew clean test" commands. Specify tags to run in TestRunner file or through terminal with -Dcucumber.options="--tags @smoke" - "./gradlew clean test -Dcucumber.options="--tags @smoke""
  6. Results are stored in html format in "build/reports/tests/test/index.html" directory and cucumber report is in "build/cucumber/html/index.html"

mobile-test's People

Contributors

ljoshenjka avatar

Watchers

 avatar  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.