Skip to content

pavithran-mm/appium-flutter-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup:

  1. Clone the repository
  2. Create new flutter application or clone any exiting flutter application
  3. Add below dependency in pubspec.yaml file of the flutter application
dev_dependencies:
appium_flutter_server:
    path: /Users/sselvarj/Documents/git/personal/appium_flutter_server

NOTE: Update the path with cloned driver repository

  1. create a new folder integration_test and create a new file appium_server.dart with below content
import 'package:appium_flutter_server/appium_flutter_server.dart';
import 'package:counter_app/main.dart';

void main() async {
  initializeTest(app: const MyApp());
}
  1. run flutter build apk
  2. run ./gradlew app:assembleDebug -Ptarget=/Users/sselvarj/Documents/git/personal/flutter-learnings/counter_app/integration_test/appium_server.dart (Replace the path)
  3. It will now generate a debug apk under build/app/outputs/apk/debug/app-debug.apk
  4. Start appium server with uiautomator2 driver with below capabilities
{
  "capabilities": {
    "alwaysMatch": {
      "platformName": "Android",
      "appium:orientation": "PORTRAIT",
      "appium:automationName": "uiautomator2",
      "appium:app": "/Users/sselvarj/Documents/git/personal/flutter-learnings/counter_app/build/app/outputs/apk/debug/app-debug.apk",
      "appium:newCommandTimeout": 240,
      "appium:intercept": true,
      "appium:noReset": false,
      "appium:fullReset": true
    },
    "firstMatch": [
      {}
    ]
  },
  "desiredCapabilities": {
   "platformName": "Android",
      "appium:orientation": "PORTRAIT",
      "appium:automationName": "uiautomator2",
      "appium:app": "/Users/sselvarj/Documents/git/personal/flutter-learnings/counter_app/build/app/outputs/apk/debug/app-debug.apk",
      "appium:newCommandTimeout": 240,
      "appium:intercept": true,
       "appium:noReset": false,
      "appium:fullReset": true
  }
}
  1. adb forward tcp:8080 tcp:8888
  2. From the browser hit http://localhost:8080/tap and it should click the counter (+) icon from the app
  3. From the browser hit http://localhost:8080/screenshot and it will return base64 screenshot image

Ios simulator

  1. flutter build ios integration_test/appium_server.dart --simulator
  2. App path flutter-learnings/counter_app/build/ios/iphonesimulator/Runner.app
  3. Simulator logs xcrun simctl spawn booted log stream | grep flutter

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 70.4%
  • C++ 13.1%
  • CMake 10.9%
  • Ruby 2.4%
  • Swift 1.5%
  • C 0.8%
  • Other 0.9%