diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/consent_granted_sr_test_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/consent_granted_sr_test_payload.json index b78f67378f..5f9bcf76b1 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/consent_granted_sr_test_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/consent_granted_sr_test_payload.json @@ -45,6 +45,13 @@ } } }, + { + "width": 88, + "height": 48, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 88, "height": 48, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_allow_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_allow_payload.json new file mode 100644 index 0000000000..1a481f9944 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_allow_payload.json @@ -0,0 +1,75 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_payload.json new file mode 100644 index 0000000000..1a481f9944 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_payload.json @@ -0,0 +1,75 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_user_input_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_user_input_payload.json new file mode 100644 index 0000000000..1a481f9944 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_image_buttons_mask_user_input_payload.json @@ -0,0 +1,75 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 80, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 75, + "height": 80, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_allow_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_allow_payload.json new file mode 100644 index 0000000000..6fa037ebd4 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_allow_payload.json @@ -0,0 +1,51 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_payload.json new file mode 100644 index 0000000000..6fa037ebd4 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_payload.json @@ -0,0 +1,51 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_user_input_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_user_input_payload.json new file mode 100644 index 0000000000..6fa037ebd4 --- /dev/null +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_images_mask_user_input_payload.json @@ -0,0 +1,51 @@ +[{ + "type": 4, + "data": { + "width": 411, + "height": 914 + } +}, { + "type": 6, + "data": { + "has_focus": true + } +}, { + "type": 10, + "data": { + "wireframes": [ + { + "width": 411, + "height": 914, + "shapeStyle": { + "backgroundColor": "#303030ff", + "opacity": 1.0 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 80, + "height": 80, + "border": { + "color": "#000000ff", + "width": 1 + }, + "type": "shape" + }, + { + "width": 411, + "height": 56, + "type": "placeholder", + "label": "Toolbar" + } + ] + } +}] \ No newline at end of file diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_allow_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_allow_payload.json index 385b8a1dd8..3984003d76 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_allow_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_allow_payload.json @@ -22,6 +22,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -54,6 +61,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -86,6 +100,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -118,6 +139,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -150,6 +178,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -182,6 +217,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -214,6 +256,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_payload.json index 385b8a1dd8..3984003d76 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_payload.json @@ -22,6 +22,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -54,6 +61,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -86,6 +100,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -118,6 +139,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -150,6 +178,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -182,6 +217,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -214,6 +256,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_user_input_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_user_input_payload.json index 385b8a1dd8..3984003d76 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_user_input_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_sensitive_fields_mask_user_input_payload.json @@ -22,6 +22,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -54,6 +61,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -86,6 +100,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -118,6 +139,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -150,6 +178,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -182,6 +217,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -214,6 +256,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_allow_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_allow_payload.json index 8268950d95..2d5906ecbe 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_allow_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_allow_payload.json @@ -91,6 +91,13 @@ } } }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -123,6 +130,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -155,6 +169,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -187,6 +208,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -219,6 +247,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_payload.json index b331e595d5..50d7a232c5 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_payload.json @@ -91,6 +91,13 @@ } } }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -123,6 +130,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -155,6 +169,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -187,6 +208,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -219,6 +247,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_user_input_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_user_input_payload.json index d46a8b5923..fde3a14e05 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_user_input_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_mask_user_input_payload.json @@ -91,6 +91,13 @@ } } }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -123,6 +130,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -155,6 +169,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -187,6 +208,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -219,6 +247,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_with_input_mask_user_input_payload.json b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_with_input_mask_user_input_payload.json index 770fc32211..e4881d7058 100644 --- a/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_with_input_mask_user_input_payload.json +++ b/instrumented/integration/src/androidTest/assets/session_replay_payloads/sr_text_fields_with_input_mask_user_input_payload.json @@ -91,6 +91,13 @@ } } }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -123,6 +130,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -155,6 +169,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -187,6 +208,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, @@ -219,6 +247,13 @@ }, "type": "shape" }, + { + "width": 395, + "height": 44, + "type": "image", + "mimeType": "image/webp", + "isEmpty": false + }, { "width": 395, "height": 44, diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/BaseSessionReplayTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/BaseSessionReplayTest.kt index 8f020d0f3a..73375d3970 100644 --- a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/BaseSessionReplayTest.kt +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/BaseSessionReplayTest.kt @@ -245,10 +245,8 @@ internal abstract class BaseSessionReplayTest { // will be executed in Bitrise and currently Bitrise does not own a specific model for the // API 33. They only have a standard emulator for this API with the required screen size and // X,Y positions are different from the ones we have in our local emulator. - - // TODO: RUM-0000 The image wireframes where removed from the payload assertion because - // of a bug in the base64 logic making the snapshot inconsistent. We need to add this back - // and fix the base64 logic. + // Also the base64 encoded images values are inconsistent from one run to another so will + // be removed from the payload. return this.asJsonObject.apply { remove("timestamp") @@ -256,16 +254,12 @@ internal abstract class BaseSessionReplayTest { dataObject.get("wireframes")?.asJsonArray ?.mapNotNull { wireframe -> val wireframeJson = wireframe.asJsonObject - if (wireframeJson.get("type").asString == "image") { - null - } else { - wireframeJson.remove("id") - wireframeJson.remove("x") - wireframeJson.remove("y") - wireframeJson - } - } - ?.fold(JsonArray()) { acc, jsonObject -> + wireframeJson.remove("id") + wireframeJson.remove("x") + wireframeJson.remove("y") + wireframeJson.remove("base64") + wireframeJson + }?.fold(JsonArray()) { acc, jsonObject -> acc.add(jsonObject) acc }?.let { sanitizedWireframes -> diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentNotGrantedSrTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentNotGrantedSrTest.kt index 7d4b6cc580..c6c29cdd48 100644 --- a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentNotGrantedSrTest.kt +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentNotGrantedSrTest.kt @@ -14,6 +14,7 @@ import com.datadog.tools.unit.ConditionWatcher import org.assertj.core.api.Assertions.assertThat import org.junit.Rule import org.junit.Test + internal class ConsentNotGrantedSrTest : BaseSessionReplayTest() { @get:Rule diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentPendingSrTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentPendingSrTest.kt index a8f7c36b4e..7f2a5b209f 100644 --- a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentPendingSrTest.kt +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/ConsentPendingSrTest.kt @@ -14,6 +14,7 @@ import com.datadog.tools.unit.ConditionWatcher import org.assertj.core.api.Assertions.assertThat import org.junit.Rule import org.junit.Test + internal class ConsentPendingSrTest : BaseSessionReplayTest() { @get:Rule diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsAllowTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsAllowTest.kt new file mode 100644 index 0000000000..abc5726b56 --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsAllowTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.imagebuttons + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImageButtonsAllowTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImageButtonsActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_image_buttons_allow_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskTest.kt new file mode 100644 index 0000000000..8fb6b86b2f --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.imagebuttons + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImageButtonsMaskTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImageButtonsActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_image_buttons_mask_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskUserInputTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskUserInputTest.kt new file mode 100644 index 0000000000..4e646177fe --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/imagebuttons/SrImageButtonsMaskUserInputTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.imagebuttons + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImageButtonsActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImageButtonsMaskUserInputTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImageButtonsActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_image_buttons_mask_user_input_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesAllowTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesAllowTest.kt new file mode 100644 index 0000000000..48943d423e --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesAllowTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.images + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImagesAllowTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImagesActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.ALLOW) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_images_allow_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskTest.kt new file mode 100644 index 0000000000..a31d4e6ea6 --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.images + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImagesMaskTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImagesActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_images_mask_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskUserInputTest.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskUserInputTest.kt new file mode 100644 index 0000000000..a6b399e208 --- /dev/null +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/integration/sessionreplay/images/SrImagesMaskUserInputTest.kt @@ -0,0 +1,37 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2016-Present Datadog, Inc. + */ + +package com.datadog.android.sdk.integration.sessionreplay.images + +import com.datadog.android.privacy.TrackingConsent +import com.datadog.android.sdk.integration.sessionreplay.BaseSessionReplayTest +import com.datadog.android.sdk.integration.sessionreplay.SessionReplayImagesActivity +import com.datadog.android.sdk.rules.SessionReplayTestRule +import com.datadog.android.sdk.utils.SR_PRIVACY_LEVEL +import com.datadog.android.sessionreplay.SessionReplayPrivacy +import org.junit.Rule +import org.junit.Test + +internal class SrImagesMaskUserInputTest : + BaseSessionReplayTest() { + + @get:Rule + val rule = SessionReplayTestRule( + SessionReplayImagesActivity::class.java, + trackingConsent = TrackingConsent.GRANTED, + keepRequests = true, + intentExtras = mapOf(SR_PRIVACY_LEVEL to SessionReplayPrivacy.MASK_USER_INPUT) + ) + + @Test + fun assessRecordedScreenPayload() { + runInstrumentationScenario() + assessSrPayload(EXPECTED_PAYLOAD_FILE_NAME, rule) + } + companion object { + const val EXPECTED_PAYLOAD_FILE_NAME = "sr_images_mask_user_input_payload.json" + } +} diff --git a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/rules/SessionReplayTestRule.kt b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/rules/SessionReplayTestRule.kt index 6f020cfd34..ec46b27eeb 100644 --- a/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/rules/SessionReplayTestRule.kt +++ b/instrumented/integration/src/androidTest/kotlin/com/datadog/android/sdk/rules/SessionReplayTestRule.kt @@ -21,6 +21,12 @@ internal open class SessionReplayTestRule( // region ActivityTestRule override fun beforeActivityLaunched() { + // give time to remove the previous activity. Espresso seems to have moments + // when it tries to launch the new activity while the previous one is still somehow + // in the process of being removed. This creates an issue with our SR recorder which + // calls the WindowInspector.getGlobalWindowViews() which can return the previous window + + // the current window and alters the tests. + Thread.sleep(2000) removeCallbacks(listOf(Class.forName(SESSION_REPLAY_LIFECYCLE_CALLBACK_CLASS_NAME))) super.beforeActivityLaunched() } diff --git a/instrumented/integration/src/main/AndroidManifest.xml b/instrumented/integration/src/main/AndroidManifest.xml index 6dbf77171b..d73870187c 100644 --- a/instrumented/integration/src/main/AndroidManifest.xml +++ b/instrumented/integration/src/main/AndroidManifest.xml @@ -69,6 +69,14 @@ android:name=".sessionreplay.SessionReplayTextFieldsWithInputActivity" android:label="@string/session_replay_text_fields_end_to_end" android:windowSoftInputMode="adjustResize"/> + + + + + + diff --git a/instrumented/integration/src/main/res/drawable/ic_dd_icon_rgb.png b/instrumented/integration/src/main/res/drawable/ic_dd_icon_rgb.png new file mode 100644 index 0000000000..62baf9983b Binary files /dev/null and b/instrumented/integration/src/main/res/drawable/ic_dd_icon_rgb.png differ diff --git a/instrumented/integration/src/main/res/drawable/ic_dd_icon_white.xml b/instrumented/integration/src/main/res/drawable/ic_dd_icon_white.xml new file mode 100644 index 0000000000..953c4004d2 --- /dev/null +++ b/instrumented/integration/src/main/res/drawable/ic_dd_icon_white.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/instrumented/integration/src/main/res/drawable/ic_dd_shape_oval.xml b/instrumented/integration/src/main/res/drawable/ic_dd_shape_oval.xml new file mode 100644 index 0000000000..da83159d60 --- /dev/null +++ b/instrumented/integration/src/main/res/drawable/ic_dd_shape_oval.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/instrumented/integration/src/main/res/drawable/ic_dd_shape_rect.xml b/instrumented/integration/src/main/res/drawable/ic_dd_shape_rect.xml new file mode 100644 index 0000000000..97797206e5 --- /dev/null +++ b/instrumented/integration/src/main/res/drawable/ic_dd_shape_rect.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/instrumented/integration/src/main/res/drawable/ic_dd_statelist.xml b/instrumented/integration/src/main/res/drawable/ic_dd_statelist.xml new file mode 100644 index 0000000000..4963c27cdf --- /dev/null +++ b/instrumented/integration/src/main/res/drawable/ic_dd_statelist.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/instrumented/integration/src/main/res/layout/sr_image_buttons_layout.xml b/instrumented/integration/src/main/res/layout/sr_image_buttons_layout.xml new file mode 100644 index 0000000000..106bfb404a --- /dev/null +++ b/instrumented/integration/src/main/res/layout/sr_image_buttons_layout.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/instrumented/integration/src/main/res/layout/sr_images_layout.xml b/instrumented/integration/src/main/res/layout/sr_images_layout.xml new file mode 100644 index 0000000000..1da23f7847 --- /dev/null +++ b/instrumented/integration/src/main/res/layout/sr_images_layout.xml @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/instrumented/integration/src/main/res/values/strings.xml b/instrumented/integration/src/main/res/values/strings.xml index a5a4ce3cda..e642b15558 100644 --- a/instrumented/integration/src/main/res/values/strings.xml +++ b/instrumented/integration/src/main/res/values/strings.xml @@ -65,6 +65,13 @@ App Compat Spinner App Compat Switch Material Switch + default image button bundled + default image button + app compat image button + Session Replay Image Buttons (End to End) + Session Replay Images (End to End) + image view + app compat image view \ No newline at end of file