Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open link e2e test #2058

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions e2e/workspaces/demo_app/open_link.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
appId: com.example.example
tags:
- passing
---
- launchApp:
appId: com.android.chrome
clearState: true
optional: true

- launchApp:
clearState: true

- openLink: 'https://maestro.mobile.dev'
- assertVisible:
id: 'signin_fre_dismiss_button|send_report_checkbox|terms_accept'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this asserting? I'm unclear why this isn't the docs.
On that point, is it worth a comment for future people maintaining this test?


- openLink:
link: 'https://maestro.mobile.dev'
browser: true
- assertVisible:
id: 'signin_fre_dismiss_button|send_report_checkbox|terms_accept'

- openLink:
link: 'https://maestro.mobile.dev'
browser: true
autoVerify: true
- assertVisible: 'Maestro Documentation'

- openLink:
link: 'https://maestro.mobile.dev'
autoVerify: true
- assertVisible: 'Flutter Demo Home Page'
9 changes: 9 additions & 0 deletions maestro-client/src/main/java/maestro/drivers/AndroidDriver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class AndroidDriver(
}

shell("pm clear $appId")
shell("pm reset-app-links --user 0 $appId")
}

override fun clearKeychain() {
Expand Down Expand Up @@ -578,6 +579,14 @@ class AndroidDriver(
// Welcome to Chrome screen "Add account to device"
filterById("$chrome:id/signin_fre_dismiss_button")?.let { tap(it.bounds.center()) }
waitForAppToSettle(null, null)
// Ad privacy feature
filterById("$chrome:id/more_button")?.let { tap(it.bounds.center()) }
filterById("$chrome:id/no_button")?.let { tap(it.bounds.center()) }
waitForAppToSettle(null, null)
// Other ad privacy feature
filterById("$chrome:id/more_button")?.let { tap(it.bounds.center()) }
filterById("$chrome:id/ack_button")?.let { tap(it.bounds.center()) }
waitForAppToSettle(null, null)
// Turn on Sync screen
filterById("$chrome:id/negative_button")?.let { tap(it.bounds.center()) }
waitForAppToSettle(null, null)
Expand Down
Loading