Skip to content

Commit ea176e9

Browse files
cortisikolegobeat
andauthored
test: Detox: add video recording on failure (#11987)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Right now, Detox does a good job of capturing screenshots when a test fails. But what we really need is the ability to provide engineers with video recordings that show exactly what happened leading up to a failure. This would give a clearer picture, making it easier to diagnose and fix issues by seeing the interactions and events in real-time, rather than trying to piece things together from a single snapshot. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** Recording of test failure on iOS https://github.com/user-attachments/assets/0efe7e3c-2366-4b89-bbaf-4eb4ad7e1cc7 Recording of test failure on android https://github.com/user-attachments/assets/261268aa-dda7-4977-9125-027ed9beb512 ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
1 parent 6a77e4b commit ea176e9

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.detoxrc.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
/** @type {Detox.DetoxConfig} */
22
module.exports = {
33
artifacts: {
4-
rootDir: "./artifacts/screenshots",
4+
rootDir: "./artifacts",
55
plugins: {
66
screenshot: {
77
shouldTakeAutomaticSnapshots: true,
88
keepOnlyFailedTestsArtifacts: true,
99
takeWhen: {
1010
testStart: false,
1111
testDone: false,
12-
}
12+
},
13+
},
14+
video: {
15+
enabled: true, // Enable video recording
16+
keepOnlyFailedTestsArtifacts: true, // Keep only failed tests' videos
1317
},
1418
},
1519
},
20+
1621
testRunner: {
1722
args: {
1823
$0: 'jest',

bitrise.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,15 +746,15 @@ workflows:
746746
- content: |-
747747
#!/usr/bin/env bash
748748
set -ex
749-
cp -r "$BITRISE_SOURCE_DIR/artifacts/screenshots" "$BITRISE_DEPLOY_DIR"
749+
cp -r "$BITRISE_SOURCE_DIR/artifacts" "$BITRISE_DEPLOY_DIR"
750750
- deploy-to-bitrise-io@2.3:
751751
title: Deploy test screenshots
752752
is_always_run: true
753753
run_if: .IsBuildFailed
754754
inputs:
755755
- deploy_path: $BITRISE_DEPLOY_DIR
756756
- is_compress: true
757-
- zip_name: E2E_Android_Failure_Screenshots
757+
- zip_name: E2E_Android_Failure_Artifacts
758758
meta:
759759
bitrise.io:
760760
machine_type_id: elite-xl
@@ -1004,15 +1004,15 @@ workflows:
10041004
- content: |-
10051005
#!/usr/bin/env bash
10061006
set -ex
1007-
cp -r "$BITRISE_SOURCE_DIR/artifacts/screenshots" "$BITRISE_DEPLOY_DIR"
1007+
cp -r "$BITRISE_SOURCE_DIR/artifacts" "$BITRISE_DEPLOY_DIR"
10081008
- deploy-to-bitrise-io@2.3:
10091009
is_always_run: true
10101010
run_if: .IsBuildFailed
10111011
title: Deploy test screenshots
10121012
inputs:
10131013
- deploy_path: $BITRISE_DEPLOY_DIR
10141014
- is_compress: true
1015-
- zip_name: 'E2E_IOS_Failure_Screenshots'
1015+
- zip_name: 'E2E_IOS_Failure_Artifacts'
10161016
start_e2e_tests:
10171017
steps:
10181018
- build-router-start@0:

0 commit comments

Comments
 (0)