From 3da74213a4d563ca612f276edf7359830a932dec Mon Sep 17 00:00:00 2001 From: Tiago Marques <42008628+tiagomar@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:13:29 -0300 Subject: [PATCH 1/2] Add network mocks for related posts and likes --- .../rest_sites_106707880_posts_439_likes.json | 14 +++++++ ...est_sites_106707880_posts_439_related.json | 42 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_likes.json create mode 100644 API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_related.json diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_likes.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_likes.json new file mode 100644 index 000000000000..e3c988485939 --- /dev/null +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_likes.json @@ -0,0 +1,14 @@ +{ + "request": { + "method": "GET", + "urlPath": "/rest/v1.2/sites/106707880/posts/439/likes" + }, + "response": { + "status": 200, + "jsonBody": { + "found": 0, + "i_like": false, + "likes": [] + } + } +} diff --git a/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_related.json b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_related.json new file mode 100644 index 000000000000..933caf371ad2 --- /dev/null +++ b/API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/posts/rest_sites_106707880_posts_439_related.json @@ -0,0 +1,42 @@ +{ + "request": { + "method": "GET", + "urlPath": "/rest/v1.2/read/site/106707880/post/439/related" + }, + "response": { + "status": 200, + "jsonBody": { + "algorithm_local": "read:related:posts:local/7", + "algorithm_global": "read:related:posts:global/1", + "posts": [ + { + "ID": 974, + "site_ID": 80511, + "author": { + "ID": 29043, + "login": "test", + "email": false, + "name": "Test User", + "first_name": "Test", + "last_name": "User", + "site_ID": 80511 + }, + "date": "2024-03-07T23:00:40+00:00", + "modified": "2024-03-07T23:00:40+00:00", + "title": "title-a", + "URL": "https://example.wordpress.com/2024/03/07/hello-974", + "content": "content-a", + "excerpt": "content-a", + "slug": "hello-974", + "status": "draft", + "sticky": false, + "password": "", + "parent": false, + "type": "post", + "featured_image": "", + "format": "standard" + } + ] + } + } +} From 2c8fa6e65d079377a7e0c0b02335c7bab6abe71f Mon Sep 17 00:00:00 2001 From: Tiago Marques <42008628+tiagomar@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:47:18 -0300 Subject: [PATCH 2/2] Increase post content loading timeout --- Modules/Sources/UITestsFoundation/Screens/ReaderScreen.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Sources/UITestsFoundation/Screens/ReaderScreen.swift b/Modules/Sources/UITestsFoundation/Screens/ReaderScreen.swift index d37f96a24ccb..2e05f4764862 100644 --- a/Modules/Sources/UITestsFoundation/Screens/ReaderScreen.swift +++ b/Modules/Sources/UITestsFoundation/Screens/ReaderScreen.swift @@ -64,7 +64,7 @@ public class ReaderScreen: ScreenObject { private func postContentEquals(_ expected: String) -> Bool { let equalsPostContent = NSPredicate(format: "label == %@", expected) - let isPostContentEqual = app.staticTexts.element(matching: equalsPostContent).waitForIsHittable(timeout: 3) + let isPostContentEqual = app.staticTexts.element(matching: equalsPostContent).waitForIsHittable(timeout: 15) return isPostContentEqual }