react-native-navigation的迁移库

test.e2e.ios.js 783B

123456789101112131415161718192021222324252627
  1. const _ = require('lodash');
  2. const exec = require('shell-utils').exec;
  3. const release = _.includes(process.argv, '--release');
  4. run();
  5. function run() {
  6. try {
  7. startRecording();
  8. const conf = release ? `release` : `debug`;
  9. exec.execSync(`detox build --configuration ios.sim.${conf} && detox test --configuration ios.sim.${conf} ${process.env.CI ? '--cleanup' : ''}`);
  10. } finally {
  11. stopRecording();
  12. }
  13. }
  14. function startRecording() {
  15. const screenId = exec.execSyncRead(`ffmpeg -f avfoundation -list_devices true -i "" 2>&1 | grep "Capture screen 0" | sed -e "s/.*\\[//" -e "s/\\].*//"`);
  16. exec.execAsync(`ffmpeg -f avfoundation -i "${screenId}:none" out.avi`);
  17. }
  18. function stopRecording() {
  19. exec.execSync(`killall ffmpeg`);
  20. exec.execSync(`npm run release`);
  21. }