This is the complete project framework.
- Utilises a General Store app.
- Hardwired to run on an emulator called "Demo".
- No manual invocation of the emulator or appium server needed. Happens programmatically.
- Cucumber & Maven are used to develop the framework.
- Can run as a maven test through command prompt.
- Object Repository as properties file is implemented.
- Logging has been implemented.
- Data Driven with Data Tables, Excel and Regular Expressions.
- Multiple feature files with multiple scenarios
- Gestures like clicking, scrolling, entering text, checkboxes, switching context, slider, alert boxes, drag n drop have been implemented.
- Reporting has been implemented through webpages with the help of pretty plugin.
- Download and install Java Explain me how, JDK8
- Configure Java environment variables Explain me how
- Download and install Android Studio Explain me how
- Configure Android environment variables Explain me how
- Configure Anroid emulator and name it DemoExplain me how
- Download and install Node.js Explain me how
- Configure npm environment variables Explain me how
- Download and install Appium Explain me how
- You'll need an IDE. We suggest downloading and installing Eclipse. Explain me how
- Configure Maven for Eclipse Explain me how
- Configure Cucumber for Eclipse Explain me how
- Java: Read about me
- Appium: Read about me
- BDD: Read about me
- Cucumber: Read about me
- Maven: Read about me
- Android Studio: Read about me
- Download the repository UseMe and unzip it, ideally in eclipse-workspace .
- Make sure the GeneralStore.apk present in Automation folder is installed in the emulator.
- To directly run the tests (from command propmpt), open Automation folder and run either of three .bat files.
- To manually run the tests from command prompt, move inside the project location through cd command. Run
i: mvn test: Runs all feature files
ii: mvn test -Dcucumber.options="src/test/java/features/XYZ.feature": Substitute 'XYZ' with the name of the feature file to run that specific feature file - To manually run as a Maven project, first import it. Explain me how
- To run, Automation->src/test/java->runner. Right click LogRunTest.java and select Run As, left click JUnit test.
Log.java: Initialises log4j instance and houses different kinds of logging methods.
Reader.java: Responsible for reading the contents of the Object Repository.
Utilities.java: Houses methods for different gestures, called upon by classes in stepDefs package.
repo.properties: Holds the locators and their XPaths as key-value pairs. Needs reading from.
DataHelper.java: Reads the contents of the Excel file and arranges as Hashmaps.
ExlUtils.java: Has methods for reading Excel data directly called upon by DataHelper class.
data.xlsx: Stores the data required for the app, like Name, Country, Gender etc.
Data.feature: Houses detailed scenario for navigation through the app. Data held in Examples datatable.
Excel.feature: Performs the same actions as Data.feature albeit using data from an Excel file.
Gesture.feature: More focused towards displaying web gestures, eg alerts, slider, drag-drop. Cuts down on steps for app navigation.
LogRunTest.java: Responsible for running tests as Cucumber. Holds plugin for generating reports.
ExcelLogIn.java: Handles step definitions for Excel.feature which converts data to Hashmaps. Mainly intended for LogIn page.
Hook.java: Starts the appium server and the emulator. Initialises device capabilities. Closes the appium server and driver.
LogIn.java: Handles step definitions for Data.feature which converts data to 2D Lists. Mainly intended for LogIn page.
Products.java: Handles step definitions for Products page.
Web.java: Handles step definitions for Webpages in webview.
Defines the configuration for the logging used.
General-Store.apk: The app tested
RunFeatureData.bat: Runs and tests the Data.feature in command prompt.
RunFeatureExcel.bat: Runs and tests the Excel.feature in command prompt.
RunFeatureGesture.bat: Runs and tests the Gesture.feature in command prompt.
log4j.log: Everything gets logged in this file.
pom.xml: Heart of the maven project. Houses all dependancies and external plugins.