Skip to content

Commit 67b0494

Browse files
authored
Merge pull request #20788 from wordpress-mobile/add-pages-card-ui-test
[UI Tests] Added a UI Test for "Pages" dashboard card navigation.
2 parents ed29319 + b440c3d commit 67b0494

File tree

14 files changed

+864
-685
lines changed

14 files changed

+864
-685
lines changed

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/activity/wpcom_v2_site_activity.json

Lines changed: 42 additions & 655 deletions
Large diffs are not rendered by default.
Lines changed: 159 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,165 @@
11
{
2-
"request": {
3-
"method": "GET",
4-
"urlPath": "/wpcom/v2/sites/106707880/dashboard/cards-data/",
5-
"queryParameters": {
6-
"_locale": {
7-
"matches": "(.*)"
8-
},
9-
"cards": {
10-
"equalTo": "todays_stats,posts"
11-
}
2+
"request": {
3+
"method": "GET",
4+
"urlPath": "/wpcom/v2/sites/106707880/dashboard/cards-data/",
5+
"queryParameters": {
6+
"_locale": {
7+
"matches": "(.*)"
8+
},
9+
"cards": {
10+
"equalTo": "todays_stats,posts,pages,activity"
1211
}
13-
},
14-
"response": {
15-
"status": 200,
16-
"jsonBody": {
17-
"todays_stats": {
18-
"views": 56,
19-
"visitors": 44,
20-
"likes": 19,
21-
"comments": 0
12+
}
13+
},
14+
"response": {
15+
"status": 200,
16+
"jsonBody": {
17+
"todays_stats": {
18+
"views": 56,
19+
"visitors": 44,
20+
"likes": 19,
21+
"comments": 0
22+
},
23+
"posts": {
24+
"has_published": true,
25+
"draft": [],
26+
"scheduled": []
27+
},
28+
"pages": [
29+
{
30+
"id": 51,
31+
"title": "Blog",
32+
"content": "Introduce yourself and your blog My Latest Posts • • • • • •",
33+
"status": "publish",
34+
"modified": "2023-05-18 10:33:38",
35+
"date": "2023-05-18 10:33:38"
2236
},
23-
"posts": {
24-
"has_published": true,
25-
"draft": [],
26-
"scheduled": []
37+
{
38+
"id": 30,
39+
"title": "Cart",
40+
"content": "",
41+
"status": "publish",
42+
"modified": "2023-02-03 09:46:32",
43+
"date": "2023-02-03 09:46:32"
44+
},
45+
{
46+
"id": 31,
47+
"title": "Checkout",
48+
"content": "",
49+
"status": "publish",
50+
"modified": "2023-02-03 09:46:32",
51+
"date": "2023-02-03 09:46:32"
52+
}
53+
],
54+
55+
"activity": {
56+
"@context": "https://www.w3.org/ns/activitystreams",
57+
"summary": "Activity log",
58+
"type": "OrderedCollection",
59+
"totalItems": 3,
60+
"page": 1,
61+
"totalPages": 1,
62+
"itemsPerPage": 5,
63+
"id": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity",
64+
"oldestItemTs": 1654043700542,
65+
"first": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity?page=1",
66+
"last": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity?page=1",
67+
"current": {
68+
"type": "OrderedCollectionPage",
69+
"id": "https://public-api.wordpress.com/wpcom/v2/sites/106707880/activity",
70+
"totalItems": 1,
71+
"orderedItems": [
72+
{
73+
"summary": "Setting changed",
74+
"content": {
75+
"text": "Enabled Jetpack Social for automatic social sharing"
76+
},
77+
"name": "setting__changed_jetpack_module_publicize",
78+
"actor": {
79+
"type": "Person",
80+
"name": "demo",
81+
"external_user_id": 1,
82+
"wpcom_user_id": 195654479,
83+
"icon": {
84+
"type": "Image",
85+
"url": "https://secure.gravatar.com/avatar/eea057209f5e29d6ca4103bc165d645b?s=96&d=mm&r=g",
86+
"width": 96,
87+
"height": 96
88+
},
89+
"role": "administrator"
90+
},
91+
"type": "Announce",
92+
"published": "2023-04-04T10:33:09.300+00:00",
93+
"generator": {
94+
"jetpack_version": 0,
95+
"blog_id": 106707880
96+
},
97+
"is_rewindable": false,
98+
"rewind_id": "1680604388.4567",
99+
"gridicon": "cog",
100+
"status": null,
101+
"activity_id": "6gjTS4cBfytF4jpL6MFT",
102+
"is_discarded": false
103+
},
104+
{
105+
"summary": "Site owner connected",
106+
"content": {
107+
"text": "The Jetpack connection is now complete. Welcome!"
108+
},
109+
"name": "jetpack__site_owner_connected",
110+
"actor": {
111+
"type": "Person",
112+
"name": "Kevin Jorge",
113+
"external_user_id": 1,
114+
"wpcom_user_id": 11111111,
115+
"icon": {
116+
"type": "Image",
117+
"url": "https://secure.gravatar.com/avatar/eea057209f5e29d6ca4103bc165d645b?s=96&d=mm&r=g",
118+
"width": 96,
119+
"height": 96
120+
},
121+
"role": "administrator"
122+
},
123+
"type": "Announce",
124+
"published": "2023-04-04T10:33:05.614+00:00",
125+
"generator": {
126+
"jetpack_version": 0,
127+
"blog_id": 106707880
128+
},
129+
"is_rewindable": false,
130+
"rewind_id": "1680604385.6144",
131+
"gridicon": "plans",
132+
"status": "success",
133+
"activity_id": "avfTS4cB98Gh8vy65ZU4",
134+
"is_discarded": false
135+
},
136+
{
137+
"summary": "Site connected",
138+
"content": {
139+
"text": "This site is connected to Jetpack."
140+
},
141+
"name": "jetpack__site_connected",
142+
"actor": {
143+
"type": "Application",
144+
"name": "Jetpack"
145+
},
146+
"type": "Announce",
147+
"published": "2023-04-04T10:32:54.647+00:00",
148+
"generator": {
149+
"jetpack_version": 0,
150+
"blog_id": 106707880
151+
},
152+
"is_rewindable": false,
153+
"rewind_id": "1680604374.6466",
154+
"gridicon": "plans",
155+
"status": "success",
156+
"activity_id": "XvfTS4cB98Gh8vy6sI2-",
157+
"is_discarded": false
158+
}
159+
]
27160
}
28161
}
162+
29163
}
30-
}
164+
}
165+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"request": {
3+
"method": "GET",
4+
"urlPathPattern": "/wpcom/v2/sites/106707880/external-services",
5+
"queryParameters": {
6+
"locale": {
7+
"matches": "(.*)"
8+
},
9+
"type": {
10+
"equalTo": "publicize"
11+
}
12+
}
13+
},
14+
"response": {
15+
"status": 200,
16+
"jsonBody": {
17+
18+
"services": {
19+
"facebook": {
20+
"ID": "facebook",
21+
"label": "Facebook",
22+
"type": "publicize",
23+
"description": "Publish your posts to your Facebook timeline or page.",
24+
"genericon": {
25+
"class": "facebook-alt",
26+
"unicode": "\\f203"
27+
},
28+
"icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-fb-2x.png",
29+
"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",
30+
"multiple_external_user_ID_support": true,
31+
"external_users_only": true,
32+
"jetpack_support": true,
33+
"jetpack_module_required": "publicize"
34+
},
35+
"twitter": {
36+
"ID": "twitter",
37+
"label": "Twitter",
38+
"type": "publicize",
39+
"description": "Publish your posts to your Twitter account.",
40+
"genericon": {
41+
"class": "twitter",
42+
"unicode": "\\f202"
43+
},
44+
"icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-twitter-2x.png",
45+
"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",
46+
"multiple_external_user_ID_support": false,
47+
"external_users_only": false,
48+
"jetpack_support": true,
49+
"jetpack_module_required": "publicize",
50+
"status": "unsupported"
51+
},
52+
"linkedin": {
53+
"ID": "linkedin",
54+
"label": "LinkedIn",
55+
"type": "publicize",
56+
"description": "Publish your posts to your LinkedIn profile.",
57+
"genericon": {
58+
"class": "linkedin",
59+
"unicode": "\\f207"
60+
},
61+
"icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-linkedin-2x.png",
62+
"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",
63+
"multiple_external_user_ID_support": false,
64+
"external_users_only": false,
65+
"jetpack_support": true,
66+
"jetpack_module_required": "publicize"
67+
},
68+
"tumblr": {
69+
"ID": "tumblr",
70+
"label": "Tumblr",
71+
"type": "publicize",
72+
"description": "Publish your posts to your Tumblr blog.",
73+
"genericon": {
74+
"class": "tumblr",
75+
"unicode": "\\f214"
76+
},
77+
"icon": "http://i.wordpress.com/wp-content/admin-plugins/publicize/assets/publicize-tumblr-2x.png",
78+
"multiple_external_user_ID_support": true,
79+
"external_users_only": false,
80+
"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",
81+
"jetpack_support": true,
82+
"jetpack_module_required": "publicize"
83+
}
84+
}
85+
}
86+
}
87+
}

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/feature-flags.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
"response": {
1212
"status": 200,
1313
"jsonBody": {
14+
"dashboard_card_activity_log": true,
1415
"dashboard_card_domain": false,
15-
"dashboard_card_free_to_paid_plans": true
16+
"dashboard_card_free_to_paid_plans": true,
17+
"dashboard_card_pages": true
1618
}
1719
}
1820
}

0 commit comments

Comments
 (0)