It is Selenium - Cucumber (BDD) project will be used to automate web application. Project has Page Object model as its design pattern.
- Java8 or higher should be installed.
- Set JAVA_HOME
- Install maven and set MAVEN_HOME
- Add JAVA_HOME and MAVEN_HOME in your Path variable.
For Appium installation:
- NodeJS should be installed (Version - 6.4.1 or higher) NodeJS installation guide
- Install appium - npm install -g appium (I have used 1.13.0)
- Install appium npm install -g appium-doctor [to check paths are setup properly]
- Steps for Android sdk can be found in Android Libraries and SDK installation Guide
- Add ANDROID_HOME and other required values in path variable using Step 4.
- Windows CMD type appium-doctor to verify JAVA_HOME, ANDROID_HOME, adb , Bin dir for JAVA is set.
- While executing test in Chrome if issues come for chromedriver version run this command appium --allow-insecure chromedriver_autodownload
-
Project is a maven project.
-
Our framework code lies mainly in src/test folder.
-
Project has three layer approach or calling: feature -> stepdefinitions -> businessflows -> screens
-
feature -> It is test/resources. It will contain all feature files (.feature).
-
stepdefinitions -> This folder has java files which contains step definitions corresponding in feature file.
-
businessflows -> This folder has java files which contains which contains business logic or assertions
-
screens -> This folder has java files which perform actual actions on the web browser.
-
-
In resources there are couple of more files like .exe, .properties.
-
In CommonProperties.properties we are passing browser name it will have more keys as framework expands.
-
We have utilities package which contains utilities for driver, reporting and maintaing session state of objects(ThisRun.java)
-
Call flows are as follows:
-
run commands: a. mvn clean b. mvn install or mvn test
-
Now execution will begin
Call hierarchy are as follows:
Runcuckes -> Hooks: -> features -> stepdefinitions -> businessflows -> screens
-
- We should not call screens directly from stepdefinitions call hierarchy should be maintained (stepdefinitions -> businessflows -> screens).
- All assertions should be done in businessflows only
- Mutiple businessflows can be called from stepdefinitions
- Maven command to run is mvn clean test -DsuiteXmlFile=[testngfilename.xml].
- There are three XMLs for desktop, mobile and emulator respectively in test/resources.
- Each XML has parameters inside it if platform, subPlatform, browser, deviceId, tags.
- For testngForWeb.xml we should change only tags, we can comment out the "test" that we dont want to execute.
- For testngForMobile we need to change only deviceId, subPlatform, tags, we can comment out the "test" that we dont want to execute.
- For testngForMobile we need to change only deviceId, tags, we can comment out the "test" that we dont want to execute.
- Right now for testngForMobile.xml, "data-provider-thread-count" at first line at should be 1.