Coder Social home page Coder Social logo

robot-appium-tests's Introduction

Robot Framework and Appium Tests

Robot + Appium mobile tests with SauceLabs integration

This is a study project using Robot Framework + Appium for mobile tests in Android and iOS devices. This project can be run via SauceLabs as long as you have an apk configured in SauceLabs and an Ondemand URL for your account.

Getting Started

These instructions will get you a copy of the project up and running on your SauceLabs account for development and testing purposes.

Prerequisites

  • Git
  • Python 3.x
  • Pip
  • Appium

Installing

  1. Clone the repository
  2. Install the dependencies with pip install -r requirements.txt

Running the tests via SauceLabs

  1. Upload the app used in the tests of this project located at app/android/demo-saucelabs.apk and app/ios/demo-saucelabs.ipa to your SauceLabs account on https://app.saucelabs.com/app-management.
  2. Change the value of the ${SAUCELABS_REMOTE_URL} variable in the resources/android/variables/base_variables.robot and resources/ios/variables/base_variables.robot files to your Ondemand URL.
  3. Run the tests through the command robot --outputdir results tests

Capabilities

Capabilities is the name used to define the parameters used to start an Appium Session. If you want to change some of them, here is the Capabilities I used for the tests, both Android and iOS have their own base_variables.robot with their own properties.

${REMOTE_URL} - Used to establish connection with your application, e.g., http://localhost:4723/wd/hub to localhost or your Ondemand URL to connect to SauceLabs.

${PLATFORM_NAME} - The type of platform hosting the app or browser, e.g., Android or iOS

${PLATFORM_VERSION} - The version of a platform, e.g., for iOS, 16.0

${DEVICE_NAME} - The name of a particular device to automate, e.g., iPhone 14

${APP} - The path to an installable application, e.g., C:\\Users\\samska\\Desktop\\robot-appium-tests\\app\\android\\demo-saucelabs.apk

${AUTOMATION_NAME} - The name of the Appium driver to use, e.g., UiAutomator2 for Android or XCUITest for iOS

${JOB_NAME} - The name of your test, used in SauceLabs, e.g., Robot Framework Appium Tests

Continuous integration

This project has continuous integration with GitHub Actions. The configuration file is located at the path .github/workflows/robot.yml. The pipeline is scheduled to run at 00:00 every monday. With each execution, an artifact is generated with the test results and saved in that execution, as well as the results are published on the gh-pages and are available for consultation on this page.

Folder structure

robot-appium-tests/                     
 ├── .github/                               
 │    ├── workflows/                        
 │        ├── robot.yml                     # Configuration for the tests on CI
 ├── app/                                   # The app used in the tests
 │    ├── android/                          
 │        ├── demo-saucelabs.apk            # Application file for Android
 │    ├── ios/                              
 │        ├── demo-saucelabs.ipa            # Application file for iOS
 ├── config/                               
 │    ├── requirements.txt                  # Required dependencies for the tests
 │    ├── settings.robot                    # Libraries used in the tests
 ├── resources/                             # Resources like keywords and variables sorted by device type
 │    ├── android/                          
 │        ├── keywords/                     
 │          ├── setup_keywords.robot        # Keywords for setup such before and after tests
 │          ├── login_keywords.robot        # Keywords from a specific feature
 │        ├── variables/                    
 │          ├── base_variables.robot        # Base variables for integration in SauceLabs with Android
 │          ├── login_variables.robot       # Login feature elements mapped to variables
 │    ├── ios/                              
 │        ├── keywords/                     
 │          ├── setup_keywords.robot        # Keywords for setup such before and after tests
 │          ├── login_keywords.robot        # Keywords from a specific feature
 │        ├── variables/                    
 │          ├── base_variables.robot        # Base variables for integration in SauceLabs with iOS
 │          ├── login_variables.robot       # Login feature elements mapped to variables
 ├── results/                               # Test results generated by the Robot
 │    ├── log.html
 │    ├── output.xml    
 │    ├── report.html
 ├── tests/                                 # Project tests separated by device type folder                                        
 │     ├── android/                         
 |        ├── login.robot                   # Test script for login Android                                         
 │     ├── ios/                             
 |        ├── login.robot                   # Test script for login iOS                                                                         
 ├── .gitignore                             # Untracked folder and files
 ├── README.md                              # README with project overview and instructions

robot-appium-tests's People

Contributors

samska avatar

Stargazers

 avatar

Watchers

 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.