-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[UI Tests] Added a UI Test for "Pages" dashboard card navigation. #20788
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3a0fff
Added `testPagesCardHeaderNavigation` MK1
pachlava 3351220
Added `testActivityLogCardHeaderNavigation`.
pachlava 865dd41
Minor refactoring in Pages card test area.
pachlava cd980c4
Adjusted static texts that are asserted.
pachlava a9e2df1
Added an assertion for Pages Screen content
pachlava c824165
Added a check for activity log screen content too.
pachlava c7c3b30
Removed an extra line.
pachlava b440c3d
Merge pull request #20796 from wordpress-mobile/add-recent-activity-c…
pachlava File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
697 changes: 42 additions & 655 deletions
697
.../WordPressMocks/src/main/assets/mocks/mappings/wpcom/activity/wpcom_v2_site_activity.json
Large diffs are not rendered by default.
Oops, something went wrong.
183 changes: 159 additions & 24 deletions
183
API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/dashboard/dashboard.json
This file contains hidden or 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,30 +1,165 @@ | ||
| { | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPath": "/wpcom/v2/sites/106707880/dashboard/cards-data/", | ||
| "queryParameters": { | ||
| "_locale": { | ||
| "matches": "(.*)" | ||
| }, | ||
| "cards": { | ||
| "equalTo": "todays_stats,posts" | ||
| } | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPath": "/wpcom/v2/sites/106707880/dashboard/cards-data/", | ||
| "queryParameters": { | ||
| "_locale": { | ||
| "matches": "(.*)" | ||
| }, | ||
| "cards": { | ||
| "equalTo": "todays_stats,posts,pages,activity" | ||
| } | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "jsonBody": { | ||
| "todays_stats": { | ||
| "views": 56, | ||
| "visitors": 44, | ||
| "likes": 19, | ||
| "comments": 0 | ||
| } | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "jsonBody": { | ||
| "todays_stats": { | ||
| "views": 56, | ||
| "visitors": 44, | ||
| "likes": 19, | ||
| "comments": 0 | ||
| }, | ||
| "posts": { | ||
| "has_published": true, | ||
| "draft": [], | ||
| "scheduled": [] | ||
| }, | ||
| "pages": [ | ||
| { | ||
| "id": 51, | ||
| "title": "Blog", | ||
| "content": "Introduce yourself and your blog My Latest Posts • • • • • •", | ||
| "status": "publish", | ||
| "modified": "2023-05-18 10:33:38", | ||
| "date": "2023-05-18 10:33:38" | ||
| }, | ||
| "posts": { | ||
| "has_published": true, | ||
| "draft": [], | ||
| "scheduled": [] | ||
| { | ||
| "id": 30, | ||
| "title": "Cart", | ||
| "content": "", | ||
| "status": "publish", | ||
| "modified": "2023-02-03 09:46:32", | ||
| "date": "2023-02-03 09:46:32" | ||
| }, | ||
| { | ||
| "id": 31, | ||
| "title": "Checkout", | ||
| "content": "", | ||
| "status": "publish", | ||
| "modified": "2023-02-03 09:46:32", | ||
| "date": "2023-02-03 09:46:32" | ||
| } | ||
| ], | ||
|
|
||
| "activity": { | ||
| "@context": "https://www.w3.org/ns/activitystreams", | ||
| "summary": "Activity log", | ||
| "type": "OrderedCollection", | ||
| "totalItems": 3, | ||
| "page": 1, | ||
| "totalPages": 1, | ||
| "itemsPerPage": 5, | ||
| "id": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity", | ||
| "oldestItemTs": 1654043700542, | ||
| "first": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity?page=1", | ||
| "last": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity?page=1", | ||
| "current": { | ||
| "type": "OrderedCollectionPage", | ||
| "id": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity", | ||
| "totalItems": 1, | ||
| "orderedItems": [ | ||
| { | ||
| "summary": "Setting changed", | ||
| "content": { | ||
| "text": "Enabled Jetpack Social for automatic social sharing" | ||
| }, | ||
| "name": "setting__changed_jetpack_module_publicize", | ||
| "actor": { | ||
| "type": "Person", | ||
| "name": "demo", | ||
| "external_user_id": 1, | ||
| "wpcom_user_id": 195654479, | ||
| "icon": { | ||
| "type": "Image", | ||
| "url": "https://secure.gravatar.com/avatar/eea057209f5e29d6ca4103bc165d645b?s=96&d=mm&r=g", | ||
| "width": 96, | ||
| "height": 96 | ||
| }, | ||
| "role": "administrator" | ||
| }, | ||
| "type": "Announce", | ||
| "published": "2023-04-04T10:33:09.300+00:00", | ||
| "generator": { | ||
| "jetpack_version": 0, | ||
| "blog_id": 106707880 | ||
| }, | ||
| "is_rewindable": false, | ||
| "rewind_id": "1680604388.4567", | ||
| "gridicon": "cog", | ||
| "status": null, | ||
| "activity_id": "6gjTS4cBfytF4jpL6MFT", | ||
| "is_discarded": false | ||
| }, | ||
| { | ||
| "summary": "Site owner connected", | ||
| "content": { | ||
| "text": "The Jetpack connection is now complete. Welcome!" | ||
| }, | ||
| "name": "jetpack__site_owner_connected", | ||
| "actor": { | ||
| "type": "Person", | ||
| "name": "Kevin Jorge", | ||
| "external_user_id": 1, | ||
| "wpcom_user_id": 11111111, | ||
| "icon": { | ||
| "type": "Image", | ||
| "url": "https://secure.gravatar.com/avatar/eea057209f5e29d6ca4103bc165d645b?s=96&d=mm&r=g", | ||
| "width": 96, | ||
| "height": 96 | ||
| }, | ||
| "role": "administrator" | ||
| }, | ||
| "type": "Announce", | ||
| "published": "2023-04-04T10:33:05.614+00:00", | ||
| "generator": { | ||
| "jetpack_version": 0, | ||
| "blog_id": 106707880 | ||
| }, | ||
| "is_rewindable": false, | ||
| "rewind_id": "1680604385.6144", | ||
| "gridicon": "plans", | ||
| "status": "success", | ||
| "activity_id": "avfTS4cB98Gh8vy65ZU4", | ||
| "is_discarded": false | ||
| }, | ||
| { | ||
| "summary": "Site connected", | ||
| "content": { | ||
| "text": "This site is connected to Jetpack." | ||
| }, | ||
| "name": "jetpack__site_connected", | ||
| "actor": { | ||
| "type": "Application", | ||
| "name": "Jetpack" | ||
| }, | ||
| "type": "Announce", | ||
| "published": "2023-04-04T10:32:54.647+00:00", | ||
| "generator": { | ||
| "jetpack_version": 0, | ||
| "blog_id": 106707880 | ||
| }, | ||
| "is_rewindable": false, | ||
| "rewind_id": "1680604374.6466", | ||
| "gridicon": "plans", | ||
| "status": "success", | ||
| "activity_id": "XvfTS4cB98Gh8vy6sI2-", | ||
| "is_discarded": false | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } | ||
| } | ||
| } | ||
87 changes: 87 additions & 0 deletions
87
API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/dashboard/publisize.json
This file contains hidden or 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,87 @@ | ||
| { | ||
| "request": { | ||
| "method": "GET", | ||
| "urlPathPattern": "/wpcom/v2/sites/106707880/external-services", | ||
| "queryParameters": { | ||
| "locale": { | ||
| "matches": "(.*)" | ||
| }, | ||
| "type": { | ||
| "equalTo": "publicize" | ||
| } | ||
| } | ||
| }, | ||
| "response": { | ||
| "status": 200, | ||
| "jsonBody": { | ||
|
|
||
| "services": { | ||
| "facebook": { | ||
| "ID": "facebook", | ||
| "label": "Facebook", | ||
| "type": "publicize", | ||
| "description": "Publish your posts to your Facebook timeline or page.", | ||
| "genericon": { | ||
| "class": "facebook-alt", | ||
| "unicode": "\\f203" | ||
| }, | ||
| "icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-fb-2x.png", | ||
| "connect_URL": "https://public-api.wordpress.com/connect/?action=request&kr_nonce=c98be927cc&nonce=31e8eb987b&for=connect&service=facebook&blog=215224204&kr_blog_nonce=3d5d1f5eff&magic=keyring", | ||
| "multiple_external_user_ID_support": true, | ||
| "external_users_only": true, | ||
| "jetpack_support": true, | ||
| "jetpack_module_required": "publicize" | ||
| }, | ||
| "twitter": { | ||
| "ID": "twitter", | ||
| "label": "Twitter", | ||
| "type": "publicize", | ||
| "description": "Publish your posts to your Twitter account.", | ||
| "genericon": { | ||
| "class": "twitter", | ||
| "unicode": "\\f202" | ||
| }, | ||
| "icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-twitter-2x.png", | ||
| "connect_URL": "https://public-api.wordpress.com/connect/?action=request&kr_nonce=c98be927cc&nonce=49e6f85e72&for=connect&service=twitter&blog=215224204&kr_blog_nonce=3d5d1f5eff&magic=keyring", | ||
| "multiple_external_user_ID_support": false, | ||
| "external_users_only": false, | ||
| "jetpack_support": true, | ||
| "jetpack_module_required": "publicize", | ||
| "status": "unsupported" | ||
| }, | ||
| "linkedin": { | ||
| "ID": "linkedin", | ||
| "label": "LinkedIn", | ||
| "type": "publicize", | ||
| "description": "Publish your posts to your LinkedIn profile.", | ||
| "genericon": { | ||
| "class": "linkedin", | ||
| "unicode": "\\f207" | ||
| }, | ||
| "icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-linkedin-2x.png", | ||
| "connect_URL": "https://public-api.wordpress.com/connect/?action=request&kr_nonce=c98be927cc&nonce=9ed430da6c&for=connect&service=linkedin&blog=215224204&kr_blog_nonce=3d5d1f5eff&magic=keyring", | ||
| "multiple_external_user_ID_support": false, | ||
| "external_users_only": false, | ||
| "jetpack_support": true, | ||
| "jetpack_module_required": "publicize" | ||
| }, | ||
| "tumblr": { | ||
| "ID": "tumblr", | ||
| "label": "Tumblr", | ||
| "type": "publicize", | ||
| "description": "Publish your posts to your Tumblr blog.", | ||
| "genericon": { | ||
| "class": "tumblr", | ||
| "unicode": "\\f214" | ||
| }, | ||
| "icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-tumblr-2x.png", | ||
| "multiple_external_user_ID_support": true, | ||
| "external_users_only": false, | ||
| "connect_URL": "https://public-api.wordpress.com/connect/?action=request&kr_nonce=c98be927cc&nonce=99d8ed4fcc&for=connect&service=tumblr&blog=215224204&kr_blog_nonce=3d5d1f5eff&magic=keyring", | ||
| "jetpack_support": true, | ||
| "jetpack_module_required": "publicize" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've seen in some mocks where the date value is set to today's date. would having this (and other dates in this response) hardcoded cause any issues in the future? (e.g. page not appearing because it's an old page or something like that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this is not something time sensitive (not stats / messages / reviews / posts), the pages should be still shown in the card regardless of creation time 🤔. I haven't heard of any requirements for this card not to show the pages of a certain age. So if the card stops showing them, this would be an issue.