-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement native scrollTo for iOS and use it in webview_leancode_test…
….dart
- Loading branch information
piotruela
committed
Sep 20, 2024
1 parent
13c3927
commit 2a786cf
Showing
20 changed files
with
406 additions
and
36 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,27 +1,8 @@ | ||
import 'dart:io' as io; | ||
|
||
import 'common.dart'; | ||
|
||
void main() { | ||
patrol('interacts with the LeanCode website in a webview', ($) async { | ||
await createApp($); | ||
|
||
await $('Open webview (LeanCode)').scrollTo().tap(); | ||
await $.pump(Duration(seconds: 8)); | ||
|
||
try { | ||
await $.native.tap(Selector(text: 'Accept cookies')); | ||
} on PatrolActionException catch (_) { | ||
// ignore | ||
} | ||
await $.pumpAndSettle(); | ||
|
||
await $.native.enterTextByIndex( | ||
'[email protected]', | ||
index: 0, | ||
keyboardBehavior: KeyboardBehavior.showAndDismiss, | ||
); | ||
await $.native.tap(Selector(text: 'Subscribe')); | ||
}); | ||
|
||
patrol('interacts with the LeanCode website in a webview native2', ($) async { | ||
await createApp($); | ||
|
||
|
@@ -32,20 +13,36 @@ void main() { | |
try { | ||
await $.native2.tap( | ||
NativeSelector( | ||
android: AndroidSelector(text: 'Accept cookies'), | ||
ios: IOSSelector(label: 'Accept cookies'), | ||
android: AndroidSelector(text: 'ACCEPT ALL COOKIES'), | ||
ios: IOSSelector(label: 'ACCEPT ALL COOKIES'), | ||
), | ||
); | ||
} on PatrolActionException catch (_) { | ||
// ignore | ||
} | ||
await $.pumpAndSettle(); | ||
|
||
await $.native2.enterTextByIndex( | ||
'[email protected]', | ||
index: 0, | ||
if (io.Platform.isIOS) { | ||
await $.native2.scrollTo( | ||
NativeSelector( | ||
ios: IOSSelector(placeholderValue: 'Type your email'), | ||
), | ||
maxScrolls: 20, | ||
); | ||
} | ||
|
||
await $.pump(Duration(seconds: 5)); | ||
|
||
await $.native2.enterText( | ||
NativeSelector( | ||
android: AndroidSelector(className: 'android.widget.EditText'), | ||
ios: IOSSelector(placeholderValue: 'Type your email'), | ||
), | ||
text: '[email protected]', | ||
keyboardBehavior: KeyboardBehavior.showAndDismiss, | ||
tapLocation: Offset(0.5, 0.5), | ||
); | ||
|
||
await $.native2.tap( | ||
NativeSelector( | ||
android: AndroidSelector(text: 'Subscribe'), | ||
|
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
24 changes: 24 additions & 0 deletions
24
packages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/Contracts.kt
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...ages/patrol/android/src/main/kotlin/pl/leancode/patrol/contracts/NativeAutomatorServer.kt
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
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
Oops, something went wrong.