This is a collection of example Appium TestNG tests written for the AWS Device Farm Android sample app. Please use these tests as a reference for your own AWS Device Farm Appium TestNG tests.
This test suite uses the Appium page model in order to separate the tests from the logic.
Getting Started
Creating a new Java Appium Test Project Using Maven
Running Your Tests Locally
First, make sure that you have followed all the steps in the Appium getting started guide.
Use the script start-appium-android.sh to run the Appium server locally. Once the server has started, run the TestNG tests within your IDE.
For example, if your package name is com.appium.example, your main activity name is .Activities.MainActivity, and the absolute filepath to your APK is ~/Desktop/appium/app.apk, you would run the following command.
Running Your Tests on AWS Device FarmStep 1: Verify the Project Set-up
First Read the Device Farm documentation. Ensure that all the steps are completed and that your project and POM file are set up correctly.
Step 2: Go into your Maven Appium Directory
Go into your Appium Maven project directory in the terminal or command prompt.
Step 3: Package the Test Content
Run the following Maven command to package the test content.
Step 4: Locate the zip-with-dependencies.zip file
Once the Maven command above is finished it will produce a 'zip-with-dependencies.zip' file in your target folder. You will upload this file when creating a run on AWS Device Farm.
Examples For AndroidExamples for Testing Specific Scenarios
Strategies for Native Features
Examples for Testing Inputs
Examples for Automated Navigation
Tips and TricksDriver Configuration
Remember to set up your Appium driver correctly. AWS Device Farm takes care of the configuration for you, and you don't need to set any of the DesiredCapabilities when creating the driver. Refer to this example.
This is a sample native Android app that contains many of the stock Android components and elements, along with example Appium, Calabash, and Espresso tests. You can use the app and example tests as a reference for your own AWS Device Farm test scripts.
Notes
This project uses Butterknife in order to create Android views and view listeners through annotations.
Getting Started
In order to run this app on Device Farm, you will first need to create a local copy of this repository, open the project, and then build the APK from the source.
Examples for Testing Specific Scenarios
Examples for Native Features
Examples for Inputs
Examples for Navigation
Android Tips and Tricks
Setting Up and Running Espresso TestsIf you're just getting started, first read this guide.Configuring Android Studio to Run Espresso Locally
You must set a custom Instrumentation run configuration to run your Espresso tests locally. You need to set the instrumentation runner to 'android.support.test.runner.AndroidJUnitRunner'
Building the App and Test APK to Run on Device Farm
You will need two APKs: the app apk and the Espresso (Instrumentation) test apk.
Step 1: Go to your project directory
Open your terminal/command prompt and change your directory to your project folder.
Step 2: Build the project
Linux and OSX
Enter the following command inside the terminal prompt to build the project and test apks:
Windows
Enter the following command inside the command prompt to build the project and test apks:
Step 3: Find the APKS
The app APK is called app-debug.apk and the test apk is app-debug-androidTest-unaligned.apk.
Follow the Device Farm Directions for Instrumentation in order to upload the APKs into the console and perform a test.
Waiting for ElementsMobile Test Device Farm Management Cloud Aws Login
Smart defrag 6,0 serial keys 2019. Use Idling Resources in order to wait for elements within Espresso.
Examples of custom Idling Resources used within the Espresso tests:
Custom Matchers
Use custom matchers in order to match your views to custom elements within your tests.
Examples of custom Matchers used within the Espresso tests:
Tips
Using Espresso RecorderPre-Requisites
Steps:
Aws Cloud Management Tools
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |