Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOSシミュレータでのUIテストの様子を録画してみよう

Kenta Kase
December 05, 2017

 iOSシミュレータでのUIテストの様子を録画してみよう

iOS Test Night #6のLT発表資料です

Kenta Kase

December 05, 2017
Tweet

More Decks by Kenta Kase

Other Decks in Technology

Transcript

  1. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. iOS Test Night

    #6
 2017/12/05(Tue) Ճ੉݈ଠ@DeNA iOSγϛϡϨʔλͰͷ
 UIςετͷ༷ࢠΛ࿥ըͯ͠ΈΑ͏ 1
  2. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࣗݾ঺հ w Ճ੉݈ଠʢ!,FTJOʣ

    ⁃ ॴଐ • %F/"48&5άϧʔϓςετج൫νʔϜ ⁃ ܦྺ • ϞόΠϧήʔϜ։ൃʢαʔόʔαΠυʣ • ೥݄͔Β48&5άϧʔϓ 2
  3. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ςετམͪͨͱ͖ʹεΫγϣݟͯ΋Α͘෼͔Βͳ͍ 5 w

    ݁ہςετ͕࣮ߦ͞ΕΔ༷ࢠΛ؍࡯͢Δඞཁ͕͋Δ ࣮ࡍ ຊདྷظ଴͢Δ΋ͷ ͳ͔ͥϑΥʔϜ͕දࣔ͞Ε͍ͯͳ͍
  4. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 2VJDL5JNFͰ࿥ը 7 w

    ҰԠՄೳͰ͸͋Δ͕ w $6*͔Β࢖͑ͳ͍ͷͰෆศ
  5. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. recordVideo w xcrun

    simctl io booted recordVideo ./test.mov w ىಈ͍ͯ͠ΔγϛϡϨʔλͷը໘Λ࿥ըͯ͘͠ΕΔ w $USM DͰ࿥ըऴྃ w ෳࡶͳ͜ͱ͸Ͱ͖ͳ͍
 w ςετͷ։࢝ͱऴྃʹ߹ΘͤͯίϚϯυΛ࣮ߦ͢Ε͹
 ࣗಈԽͰ͖ͦ͏ 9 ಈ࡞֬ೝ͸Xcode 9.1 XcodeͷϦϦʔεϊʔτʹΑΔͱ8.2͔Β௥Ճ͞ΕͨΑ͏Ͱ͢ h-ps://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/IntroducDon.html#//apple_ref/doc/uid/ TP40001051-CH1-SW9
  6. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ॻ͍ͯΈ·ͨ͠ w ςετ։࢝લʹrecordVideoΛόοΫάϥ΢ϯυͰ࣮ߦ

    w ϓϩηε*%Λอଘ͓ͯ͘͠ w ςετऴྃޙʹ4*(*/5ʢDUSM DʣΛ࣮ߦͯ͠࿥ըऴྃ 10 # recordVideoΛόοΫάϥ΢ϯυͰ࣮ߦ xcrun simctl io booted recordVideo screenshots/test.mov & # ϓϩηεIDΛอଘ PID=`echo $!` # ςετ࣮ߦ bundle exec rspec spec/scenario_test.rb # όοΫάϥ΢ϯυͷrecordVideoʹSIGINTγάφϧΛૹ৴ kill -2 $PID
  7. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΋ͬͱศརʹ͍ͨ͠ w γϛϡϨʔλͷσόΠε΍J04ͷόʔδϣϯΛࢦఆ͍ͨ͠

    ⁃ xcrun simctl io booted recordVideo ./test.mov ⁃ booted͸ىಈ͍ͯ͠ΔγϛϡϨʔλͱ͍͏ҙຯ ⁃ ෳ਺ͷγϛϡϨʔλ͕ىಈ͍ͯ͠Δ৔߹ʹ࿥ը͢ΔγϛϡϨʔλΛࢦ ఆ͍ͨ͠ w ςετέʔεຖʹಈըΛ෼ׂ͍ͨ͠ w ࣦഊͨ͠ςετέʔε͚ͩಈըΛ࢒͍ͨ͠ 12
  8. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ॻ͍ͯΈ·ͨ͠WFS̎ w HJTU

    ⁃ HPPHM;6W/4 ⁃ "QQJVN SVCZ STQFDΛ૝ఆ
 w ࿥ը͢ΔγϛϡϨʔλΛ୺຤ɺJ04όʔδϣϯͰࢦఆ ⁃ capabilityͷdeviceName, platformVersion ⁃ xcrun simctl listͰγϛϡϨʔλͷ6%*%Λಛఆ w before(:each) after(:each)Ͱ࿥ըͷ։࢝ɺऴྃ w ࣦഊͨ͠৔߹͚ͩಈըΛ࢒͢ 13
  9. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ w γϛϡϨʔλͰͷ6*ςετͷ༷ࢠΛ࿥ը͢Δํ๏Λ঺հ

    ⁃ xcrun simctl io booted recordVideoศར ⁃ recordVideoࣗମ͸Appium΍rubyʹґଘ͍ͯ͠ͳ͍ͷͰɺ
 ৭ʑͳ࢖͍ํ͕Ͱ͖ͦ͏ w HJTU ⁃ HPPHM;6W/4 15