[go: nahoru, domu]

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

[UI Tests] Added a UI test for "Activity Log" dashboard card navigation. #18582

Merged
merged 3 commits into from
Jun 8, 2023

Conversation

pachlava
Copy link
Contributor
@pachlava pachlava commented Jun 7, 2023

Description

Following its iOS counterpart, this PR adds a UI test for the Activity Log dashboard card:

Screenshot 2023-06-07 at 20 15 53

What the test does:

@Test
fun e2eActivityLogCardNavigation() {
    MySitesPage()
        .scrollToActivityLogCard()
        .assertActivityLogCard()
        .assertActivityLogCardHasActivity("Enabled Jetpack Social")
        .assertActivityLogCardHasActivity("The Jetpack connection")
        .assertActivityLogCardHasActivity("This site is connected to")
        .tapActivity("The Jetpack connection")
        .assertEventScreenLoaded()
        .assertEventScreenHasActivity("The Jetpack connection is now complete. Welcome!")
}

Note that for Android, the test taps an individual activity and checks that Event screen is loaded. For iOS, the test tapped the card header (similar to tapping View all activity link on Android), and checked that Activity Log screen is loaded.

Firstly, I tried the same for Android. But I experienced weird flakiness when the test tapped View all activity. Every second time or so, the Activity Log screen failed to load the activities (but there were no unmatched requests warnings from WireMock). So, after trying to fix this with no success for too long, I decided to tap the individual activity and check the redirect to Event screen instead. This was reproducible only when using mocked API.

Since I added all the things (screen file, mocks) for Activity Log screen first, I ended up leaving them here, even though it's not used in this test. However, they might come handy later.

To test

  • All tests are green on CI, including the new e2eActivityLogCardNavigation

Regression Notes

I'm not filling the regression notes since the PR adds a UI test, it does not change the app behaviour in any way.

@pachlava pachlava requested a review from a team as a code owner June 7, 2023 12:20
@pachlava pachlava marked this pull request as draft June 7, 2023 12:20
@pachlava pachlava added the UI Tests Anything related to automated UI Tests. label Jun 7, 2023
@pachlava pachlava added this to the Future milestone Jun 7, 2023
@pachlava pachlava force-pushed the add-recent-activity-card-ui-test branch from be05acd to 80acf41 Compare June 7, 2023 12:31
@wpmobilebot
Copy link
Contributor
wpmobilebot commented Jun 7, 2023
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr18582-e925b8d
Commite925b8d
Direct Downloadjetpack-prototype-build-pr18582-e925b8d.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor
wpmobilebot commented Jun 7, 2023
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr18582-e925b8d
Commite925b8d
Direct Downloadwordpress-prototype-build-pr18582-e925b8d.apk
Note: Google Login is not supported on these builds.

@pachlava pachlava changed the title [UI Tests] Added e2eActivityLogCardNavigation iteration 1 [UI Tests] Added a UI test for "Activity Log" dashboard card navigation. Jun 7, 2023
@pachlava pachlava force-pushed the add-recent-activity-card-ui-test branch from a6813f6 to c806e3b Compare June 7, 2023 17:55
@peril-wordpress-mobile
Copy link
Warnings
⚠️ PR has more than 300 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@pachlava pachlava force-pushed the add-recent-activity-card-ui-test branch from c806e3b to 88d7878 Compare June 7, 2023 18:01
Copy link
Contributor Author
@pachlava pachlava Jun 7, 2023

Choose a reason for hiding this comment

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

This file ended up being unused, but I think it still makes sense to keep it.

@pachlava pachlava marked this pull request as ready for review June 7, 2023 18:45
Copy link
Contributor
@jostnes jostnes left a comment

Choose a reason for hiding this comment

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

thanks for working on the Android equivalent so quickly! test works well locally and CI is 🟢

i added a comment that i think should be updated before merging (looks like a typo) and i trust that you'll make the change before merging so approving to not block you later

@@ -1,17 +1,10 @@
{
"request": {
"method": "GET",
"urlPath": "/wpcom/v2/sites/181977606/rewind/downloads/"
"urlPath": "/wpcom/v2/sites/106707880/rewind/downloads/"
Copy link
Contributor

Choose a reason for hiding this comment

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

the site number on the urlPath no longer matches the site number on the file name after this change. looks like a typo to me or is this expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this @jostnes 🆒 I renamed both files with e925b8d.

@@ -1,7 +1,7 @@
{
"request": {
"method": "GET",
"urlPath": "/wpcom/v2/sites/181977606/rewind/"
"urlPath": "/wpcom/v2/sites/106707880/rewind/"
Copy link
Contributor

Choose a reason for hiding this comment

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

same for this

@pachlava
Copy link
Contributor Author
pachlava commented Jun 8, 2023

Thank you for the review @jostnes! I renamed the files and waiting for the 🟢 CI 🤞.

@pachlava pachlava merged commit 4796946 into trunk Jun 8, 2023
2 checks passed
@pachlava pachlava deleted the add-recent-activity-card-ui-test branch June 8, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI Tests Anything related to automated UI Tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants