-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add pumpAndTrySettle instead of pumpAndTry * Added support for drag and drop and also use pumpAndTrySettle
- Loading branch information
1 parent
2767ded
commit c49f37a
Showing
8 changed files
with
113 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:appium_flutter_server/src/handler/request/request_handler.dart'; | ||
import 'package:appium_flutter_server/src/models/api/appium_response.dart'; | ||
import 'package:appium_flutter_server/src/utils/element_helper.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:shelf_plus/shelf_plus.dart'; | ||
import 'package:appium_flutter_server/src/models/api/drag_drop.dart'; | ||
|
||
class DragAndDrop extends RequestHandler { | ||
DragAndDrop(super.route); | ||
|
||
@override | ||
Future<AppiumResponse> handle(Request request) async { | ||
var sessionId = getSessionId(request); | ||
DragAndDropModel model = | ||
DragAndDropModel.fromJson(await request.body.asJson); | ||
await ElementHelper.dragAndDrop(model); | ||
return AppiumResponse(sessionId, null); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:appium_flutter_server/src/models/api/find_element.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
import 'package:appium_flutter_server/src/models/api/element.dart'; | ||
|
||
part 'generated/drag_drop.g.dart'; | ||
|
||
@JsonSerializable() | ||
class DragAndDropModel { | ||
ElementModel source; | ||
ElementModel target; | ||
int? dragDuration; | ||
|
||
DragAndDropModel( | ||
{required this.source, | ||
required this.target, | ||
this.dragDuration}); | ||
|
||
factory DragAndDropModel.fromJson(Map<String, dynamic> json) => | ||
_$DragAndDropModelFromJson(json); | ||
|
||
Map<String, dynamic> toJson() => _$DragAndDropModelToJson(this); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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