-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad0fffd
commit bc5eb07
Showing
2 changed files
with
2 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1 @@ | ||
## 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 | ||
|
||
4. 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()); | ||
} | ||
``` | ||
|
||
5. run `flutter build apk` | ||
6. run `./gradlew app:assembleDebug -Ptarget=/Users/sselvarj/Documents/git/personal/flutter-learnings/counter_app/integration_test/appium_server.dart` (Replace the path) | ||
7. It will now generate a debug apk under `build/app/outputs/apk/debug/app-debug.apk` | ||
8. 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 | ||
} | ||
} | ||
``` | ||
|
||
9. adb forward tcp:8080 tcp:8888 | ||
10. From the browser hit `http://localhost:8080/tap` and it should click the counter (+) icon from the app | ||
11. 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` | ||
### For Usage please refer https://github.com/AppiumTestDistribution/appium-flutter-integration-driver?tab=readme-ov-file#how-to-use-appium-flutter-integration-driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters