ns_bvs
February 28, 2019, 10:31am
1
Hey. I am using React native with detox for e2e testing on iOS. I wanted to record a video cast during tests. When I use this feature localy, it works fine and increase build time a bit. When I use this feature on bitrise then build takes more than 90 minutes.
detox test --configuration ios.sim.release --record-videos all --cleanup
Without this feature build takes about 30 minute on bitrise.
detox test --configuration ios.sim.release --cleanup
Here’s my bitrise.yaml section:
_detox_tests:
before_run: []
after_run: []
steps:
- npm:
inputs:
- command: install -g detox-cli
title: Install Detox CLI
- npm:
inputs:
- command: install -g react-native-cli
title: Install React Native CLI
- script:
inputs:
- content: "#!/bin/bash\nls \nbrew tap wix/brew\nbrew install applesimutils"
title: Install Detox Utils
- script:
inputs:
- is_debug: yes$BITRIS$BITRISE_BUILD_STATUSE_SOURCE_DIR
- content: |-
#!/bin/bash
detox build --configuration ios.sim.release
title: Detox - Build Release App (iOS)
- script:
inputs:
- content: |-
#!/bin/bash
detox test --configuration ios.sim.release --record-videos all --cleanup
title: Detox - Run E2E Tests
Could you clarify why this is happening?
Hi!
It seems, it is not possible to run a video recording without hardware acceleration.
---
id: APIRef.Artifacts
title: Artifacts
---
Artifacts are various recordings during tests including, but not limited to, device logs, device screenshots and screen recordings (videos).
## Enabling artifacts
Artifacts are disabled by default. Two things are required to enable them:
1. **Call `detox.beforeEach` and `detox.afterEach` before/after each test**:
In order for artifacts to work, you have to call `detox.beforeEach(testSummary)` / `detox.afterEach(testSummary)` before / after each test. Their respective signatures are described in [detox object](APIRef.DetoxObjectAPI.md) documentation. As the interface (typing) of `testSummary` may change over the time, and in cases with some test runners it is not trivial to implement test title and status extraction (like with Jest), you are encouraged to use Detox adapter functions like in these examples: [mocha](/examples/demo-react-native/e2e/init.js), [jest](/examples/demo-react-native-jest/e2e/init.js).
2. Specify via launch arguments which types of artifacts you want to record:
* To record `.log` files, add `--record-logs all` (or `--record-logs failing`, if you want to keep logs only for failing tests).
* To record `.mp4` test run videos, add `--record-videos all` (or `--record-videos failing`, if you want to keep video recordings only for failing tests).
* To record `.png` screenshots before and after each test, add `--take-screenshots all` (or `--take-screenshots failing`, if you want to keep only screenshots of failing tests).
* To change artifacts root directory location (by default it is `./artifacts`), add `--artifacts-location <path>`.
This file has been truncated. show original
You need to know that this machines (where the virtual machine runs) don’t have physical GPU, only a simulated one by the CPU. This is why you can’t enable the hardware acceleration.
ns_bvs
February 28, 2019, 3:09pm
3
Thanks for response. Is there a way to how I can run detox e2e tests on the real device with video recording on bitrise?
Hy @ns_bvs ,
you will only be able to run the tests on emulators
as far as I know you should be able to record videos, for screenshots can be taken as well.
system
Closed
April 3, 2019, 9:06am
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.