Skip to content

Commit

Permalink
conclude investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Oct 16, 2023
1 parent 555609d commit cd36905
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ class Automator private constructor() {
}

val identifiers = arrayOf(
"com.android.permissioncontroller:id/permission_allow_one_time_button" // API >= 30
"com.android.permissioncontroller:id/permission_allow_one_time_button", // API >= 30
"com.android.permissioncontroller:id/permission_allow_button" // API >30 for POST_NOTIFICATIONS
)

val uiObject = waitForUiObjectByResourceId(*identifiers, timeout = timeoutMillis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '../common.dart';

void main() {
patrol(
'taps on notification',
'taps on notification (permission when in use )',
($) async {
await createApp($);
await $('Open notifications screen').scrollTo().tap();
Expand All @@ -25,4 +25,29 @@ void main() {
await $('Tapped notification with ID: 1').waitUntilVisible();
},
);

patrol(
'taps on notification (permission only this time)',
($) async {
await createApp($);
await $('Open notifications screen').scrollTo().tap();

if (await $.native.isPermissionDialogVisible()) {
await $.native.grantPermissionOnlyThisTime();
}

await $('Show in a few seconds').tap();
await $.native.pressHome();
await $.native.openNotifications();

// wait for notification to show up
await Future<void>.delayed(const Duration(seconds: 5));

await $.native.tapOnNotificationBySelector(
Selector(textContains: 'Someone liked'),
);

await $('Tapped notification with ID: 1').waitUntilVisible();
},
);
}

0 comments on commit cd36905

Please sign in to comment.