A tool that can mock out an existing Appium session, supports both Java and Kotlin.

Overview

appium-mocker

A tool that can mock out an existing Appium session, supports both Java and Kotlin.

How to install latest appium-mocker Beta/Snapshots


   
    
    
     com.github.lzx
    
    
    
     appium-mocker
    
    
    
     latest commit ID from master branch
    

   

Mock(Attach) a appium session

It is very simple to use, but the premise of using it is that there is already an existing session somewhere.

If not, we can create one via command line or desktop or something else.

e.g. create a appium session via curl command

curl -X POST "http://{ip_address}:{port}/wd/hub/session/" -H 'content-type: application/json' -d '{"desiredCapabilities": {"platformName":"iOS","deviceName": "iPhone 8","udid": "{udid}","automationName": "XCUITest","noReset":"true","newCommandTimeout":"60000","NoReset":"true"}}'

get session info from response

{"value":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"iOS","deviceName":"iPhone 8","udid":"00008020-000304302699002E","automationName":"XCUITest","noReset":true,"newCommandTimeout":6000000,"NoReset":"true"},"sessionId":"fdddff85-0c28-4885-9b72-b38905e86c9c","status":0}

Just provide basic information, appium mocker will help you mock out an appium driver for testing

Simple example in Kotlin

    val capabilities= BaseCapabilities(ip = host, port = port, sessionId = sessionId, platform = platform)
    val appiumDriver = AppiumMocker.mock(baseCapabilities = capabilities) as AndroidDriver
    logger.info(appiumDriver.pageSource)

Simple example in Java

    BaseCapabilities capabilities = new BaseCapabilities(host,port,sessionId,platform);
    AndroidDriver androidDriver = (AndroidDriver) AppiumMocker.INSTANCE.mock(capabilities);
    logger.info(androidDriver.getPageSource());
You might also like...
Utility - The cross-platform native Kotlin command line tool template

Utility The cross-platform native Kotlin command line tool template. Usage Make

Modifold - Kotlin CLI tool for moving curseforge mods to modrinth
Modifold - Kotlin CLI tool for moving curseforge mods to modrinth

Modifold Modifold is a Kotlin CLI utility that allows you to transfer mods from

The Klutter CLI tool gives access to all tasks to create and manage a Klutter project.

Klutter CLI The Klutter CLI tool gives access to all tasks to create and manage a Klutter project. Gettings started Download the tool. Unzip the file.

AndroRAT is a tool designed to give the control of the android system remotely and retrieve informations from it.
AndroRAT is a tool designed to give the control of the android system remotely and retrieve informations from it.

AndroRAT is a tool designed to give the control of the android system remotely and retrieve informations from it. Androrat is a client/server application developed in Java Android for the client side and the Server is in Python.

A powerful tool (iOS & Android) that focuses on mobile operation behavior!
A powerful tool (iOS & Android) that focuses on mobile operation behavior!

DiDiPrism,中文名:小桔棱镜,是一款专注于移动端操作行为的工具,涵盖APP操作回放、操作检测、以及数据可视化能力。我们在整个方案的实现过程中沉淀出了一套技术框架,希望可以逐步开源出来帮助更多人,同时也希望棱镜在大家的合力下能够更快的成长。 它有哪些亮点? 零入侵 业务代码无需任何适配。 高可

An tool to help developer to use Retrofit elegantly while using kotlinx.coroutines.

one An tool to help developer to use Retrofit elegantly while using kotlinx.coroutines. Feature Transform different data structs to one. {errorCode, d

ViaBackwardsTranslator - A tool to translate ViaBackwards mapping locale

ViaBackwardsTranslator A tool to translate ViaBackwards mapping locale. How to O

A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports
A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports

A CLI tool to convert multi-module Jetpack Compose compiler metrics into beautiful HTML reports 1. What are Jetpack Compose compiler metrics? The Comp

StaticLog - super lightweight static logging for Kotlin, Java and Android
StaticLog - super lightweight static logging for Kotlin, Java and Android

StaticLog StaticLog is a super lightweight logging library implemented in pure Kotlin (https://kotlinlang.org). It is designed to be used in Kotlin, J

Owner
aaronLLL
aaronLLL
A beautiful Fashion Store like Android App Mock built on Jetpack Compose with compose navigation, hilt, dark theme support and google's app architecture found on uplabs Here

A beautiful Fashion Store like Android App Mock built on Jetpack Compose with compose navigation, hilt, dark theme support and google's app architecture found on uplabs Here

Puncz 87 Nov 30, 2022
A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell)

Fabric-Scala-Kotlin-template A template that utilizes both Scala and Kotlin because why not (And also because I endorse programming hell) I don't care

null 1 Dec 25, 2021
Kotlin Multiplatform is an SDK for cross-platform mobile development, which enables teams to use the same business logic in both Android and iOS client applications.

Kotlin Multiplatform is an SDK for cross-platform mobile development, which enables teams to use the same business logic in both Android and iOS client applications.

Chris Russell 1 Feb 11, 2022
A mindustry mod that shuffles both the texture atlas and bundle

ohno amogus Total chaos Mindustry mod that shuffles both the texture atlas and the current bundle, providing an unforgettable gaming experience Comes

Мнемотехник 4 Sep 3, 2022
Modern Calendar View Supporting Both Hijri and Gregorian Calendars but in highly dynamic way

KCalendar-View Modern calendar view supporting both Hijri and Gregorian calendar

Ahmed Ibrahim 8 Oct 29, 2022
An amazing expense tracker app, with great features and beautiful UI. Check it out!

My Expense Tracker Expense tracker app to keep your finances in order. Built entirely in Kotlin using modern architecture components. Build ??️ My Exp

Ken Ali 7 Oct 26, 2022
A Kotlin Multiplatform Project using TMDB Api. Currently supports Android,iOS,Desktop and web platforms

A Kotlin Multiplatform Project using TMDB Api(https://www.themoviedb.org/). Currently this project is implemented in following platforms Andr

Jackson E J 11 Nov 10, 2022
Download tool based on kotlin and coroutine.

DownloadX A multi-threaded download tool written with Coroutine and Kotlin Read this in other languages: 中文, English, Changelog Prepare Add jitpack re

Season 138 Dec 22, 2022
An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

An experimental tool for building console UI in Kotlin using the Jetpack Compose compiler/runtime

Jake Wharton 1.4k Dec 28, 2022