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

UIテストに最適なテストリポーターを求めて

 UIテストに最適なテストリポーターを求めて

Android Test Night #3 発表資料
https://testnight.connpass.com/event/78507/

Kenta Kase

March 20, 2018
Tweet

More Decks by Kenta Kase

Other Decks in Programming

Transcript

  1. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࣗݾ঺հ w Ճ੉݈ଠʢ!,FTJOʣ

    ⁃ ॴଐ • %F/"48&5άϧʔϓςετج൫νʔϜ ⁃ ۀ຿ • ϞόΠϧςετͷௐࠪɺ஌ݟͷڞ༗ • ଞࣄۀ෦ͷۀ຿ޮ཰Խαϙʔτ ⁃ झຯͰ3FBDU/BUJWFࢼͨ͠Γ 2
  2. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. $*Ͱ6*ςετམͪͨͱ͖ w ϩά͔Βࣦഊͨ͠ݪҼΛ୳͢ͷ͸େม

    w མͪͨςετέʔεɺΤϥʔϝοηʔδ͙Β͍͔͠ώϯτ͕ ͳ͍ w εΫγϣ࢒࣮͢૷ʹͳ͍ͬͯΔͱخ͍͠ ⁃ ͱ͸͍͑εΫγϣ͚ͩͰ͸෼͔Βͳ͍͜ͱͷํ͕ଟ͍ͱࢥ͏ w ݁ہɺͳࣦͥഊͨ͠ͷ͔Α͘෼͔Βͳ͍͜ͱ͕ଟ͍ w ϩʔΧϧͰ࠶ݱͤͯ͞໨ࢹ֬ೝ͢Δͷ΋ճͷςετʹ͕࣌ؒ ͔͔ΔͷͰΊΜͲ͍͘͞ w ͨ·ʹ+FOLJOTͰ͔͠࠶ݱ͠ͳ͍͜ͱ΋͋Γඇৗʹਏ͍ 6
  3. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. σόΠεϑΝʔϜͰ6*ςετΛߦ͍ͬͯΔ৔߹ w 'JSFCBTF5FTU-BC

    w 6*ςετͷ༷ࢠͷಈըΛอଘͯ͘͠ΕΔ w ಈը͸ςετέʔεຖʹ෼͔Ε͍ͯͳ͍ͷͰɺམͪͨՕॴΛ ୳͢ͷ͕େม 7 DroidKaigi 2018ͷΞϓϦͷUIςετͷ༷ࢠʢFail͢ΔΑ͏ʹมߋͯ͠·͢ʣ
  4. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ཧ૝ͷ6*ςετϦϙʔλʔʢ͔ͳΓཉ͍͠ʣ w ςετέʔεຖʹ෼ׂ͞Εͨಈը

    w ࣦഊͨ͠ςετ͚ͩΤϥʔͷݪҼͱซͤͯ֬ೝ͍ͨ͠ w Τϥʔߦ w ݪҼͱͳͬͨίʔυΛ͙͢ʹ୳͍ͨ͠ w पลίʔυ w ΤσΟλΛ։͔ͣʹΤϥʔݪҼͷࢳޱΛݟ͚͍ͭͨ w ελοΫτϨʔε w σόοάʹඞਢϨϕϧ 9
  5. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ཧ૝ͷ6*ςετϦϙʔλʔʢ·͊·͊ཉ͍͠ʣ w ςετέʔεຖͷ࣮ߦ࣌ؒ

    w ۃ୺ʹ͕͔͔࣌ؒͬͯΔςετ͕ͳ͍͔֬ೝ͍ͨ͠ w ಋೖ͕؆୯ w ςετ࣮ߦίϚϯυʹҾ਺౉͚͕ͩ͢ཧ૝ w ΍΍͍͜͠Πϯετʔϧ΍ɺઃఆϑΝΠϧ͸࠷খݶ w ϑΟϧλϦϯά w མͪͨςετέʔε͚ͩ֬ೝ͍ͨ͠ w ιʔτ w ࣮ߦ࣌ؒͰιʔτ͍ͨ͠ 10
  6. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ཧ૝ͷ6*ςετϦϙʔλʔʢ͋Ε͹خ͍͠ʣ w εΫγϣ

    w ಈը͋Ε͹ෆཁ͚ͩͲ͋ͬͯ΋͍͍͔΋͠Εͳ͍ w σόΠεϩάɺ"QQJVNαʔόʔͷϩά w ຊ౰͸ཉ͍͕͠ɺࠓճ͸͜͜·ͰͰ͖ͳ͔ͬͨ 11
  7. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 34QFDඪ४ʢGPSNBUIUNMʣ 13 w

    34QFDʹ͸ඪ४Ͱ)5.-Λੜ੒͢Δػೳ͕ଘࡏ͢Δ w γϯϓϧ͕ͩϑΟϧλϦϯά΋ՄೳͰҙ֎ͱߴػೳ ಈը º εΫϦʔϯγϣοτ º Τϥʔߦ ˕ पลίʔυ ˓ ֯ ελοΫτϨʔε ˓ ςετέʔε࣮ߦ࣌ؒ ˚ ಋೖ͕؆୯ ˕ ϑΟϧλϦϯά ˓ ιʔτ º
  8. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. STQFD@ZBI@GPSNBUUFS 14 w

    STQFD@SFQPSUT@GPSNBUUFSͷGPSL w ը૾͕෇͚ΒΕΔɻTFMFOJVN΍ DBQJCBSBͰͷར༻Λҙ͍ࣝͯ͠Δ ಈը º εΫϦʔϯγϣοτ ˓ Τϥʔߦ º पลίʔυ ˚ ελοΫτϨʔε º ςετέʔε࣮ߦ࣌ؒ ˓ ಋೖ͕؆୯ ˓ ϑΟϧλϦϯά º ιʔτ º
  9. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. STQFD@IUNM@SFQPSUFS 15 w

    STQFD@SFQPSUT@GPSNBUUFSͷGPSL w ಈըͱը૾͕෇͚ΒΕΔɻBQQJVNͰͷར༻Λҙ͍ࣝͯ͠Δ w STQFDͱBECͰಈըͱεΫγϣΛऔΔαϯϓϧ͕಺ଂ͞Εͯ ͍Δ ಈը ˓ εΫϦʔϯγϣοτ ˓ Τϥʔߦ ˓ पลίʔυ ˓ ελοΫτϨʔε º ςετέʔε࣮ߦ࣌ؒ ˓ ಋೖ͕؆୯ ˓ ϑΟϧλϦϯά º ιʔτ º
  10. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. "MMVSF 16 w

    ݴޠඇґଘͷςετϦϙʔλʔ w ͔ͳΓଟػೳͰ༗๬ ಈը ˓ εΫϦʔϯγϣοτ ˓ Τϥʔߦ º पลίʔυ º ελοΫτϨʔε ˓ ςετέʔε࣮ߦ࣌ؒ ˕ ಋೖ͕؆୯ º ϑΟϧλϦϯά ˓ ιʔτ ˓
  11. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. "MMVSF w IUUQTHJUIVCDPNBMMVSFGSBNFXPSL

    w ຊମ͸"MMVSFͱ͍͏ϦϙδτϦ w ެࣜͷ৮ΕΔσϞαΠτ ⁃ IUUQTDJRBNFUBJOKPCBMMVSFKPCNBTUFS%FNP@3FQPSU w ֤ݴޠͷ༗໊ͳςετϑϨʔϜϫʔΫຖʹBEBQUFS͕ଘࡏ͢Δ ⁃ ࠓճ͸BMMVSFSTQFDΛ࢖༻ ⁃ IUUQTHJUIVCDPNBMMVSFGSBNFXPSLBMMVSFSTQFD 17
  12. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΤϥʔϝοηʔδͳͲ w ͪΐͬͱ੯͍͠

    ⁃ ελοΫτϨʔε˓ ⁃ Τϥʔߦº ⁃ पลίʔυº 19
  13. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϑΟϧλϦϯάɺιʔτ w εςʔλεͰϑΟϧλϦϯά

    w ࣮ߦ࣌ؒͰιʔτ 21 Passͷςετ͸
 ඇදࣔ ࣮ߦ࣌ؒͰιʔτ
  14. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ςετཤྺɺ'MBLZ൑ఆ w ϨϙʔτͷσΟϨΫτϦΛ࡟আ͠ͳ͚Ε͹աڈͷ݁Ռ΋ࢀরͰ

    ͖Δ w աڈʹ'BJM͍ͯ͠Δͱ1BTTͯ͠΋'MBLZ 6OTUBCMF ൑ఆ w ৄ͍͠৚݅͸υΩϡϝϯτݟͯ΋ෆ໌ w 'MBLZ͕ղআ͞ΕΔ͜ͱ͕͋ΔͷͩΖ͏͔ʁ 22
  15. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 34QFD͔Β"MMVSFΛ࢖͏ w BMMVSFSTQFD

    w ࠷ۙϝϯς͞Ε͍ͯͳ͍งғؾ͕ͩɺ࠷৽ͷ34QFDͰ໰୊ͳ ͘ಈ͍ͨ w TQFD@IFMQFSSCͷઃఆ w ޙड़ʢ࣌ؒ͋Ε͹ʣ w εΫγϣͱಈըͷอଘͷํ๏ w STQFD@IUNM@SFQPSUFSͷαϯϓϧ͕ࢀߟʹͳΓ·͢ w IUUQTHJUIVCDPNWCBOUIJBSTQFD@IUNM@SFQPSUFSUSFFNBTUFSFYBNQMFTBOESPJE w ΋ͬͱ࢖͍΍͍͢΋ͷΛϓϥΠϕʔτͰ։ൃத w IUUQTHJUIVCDPN,FTJONPCJMFFNVMBUPSTDSFFODBQUVSF 23
  16. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. "MMVSFͷ࢖͍ํ •$ brew

    install allure ⁃ Πϯετʔϧ ⁃ υΩϡϝϯτʹ-JOVYʢ%FCJBOܥʣ΋هड़͋Γ •$ allure generate ⁃ Ϩϙʔτ࡞੒ •$ allure open ⁃ ϩʔΧϧʹαʔόʔཱͯͯϨϙʔτ։͘ ϒϥ΢βىಈ •$ allure serve ⁃ HFOFSBUF PQFO 24
  17. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. "MMVSF w +BWB͸ʁ

    ⁃ ࠓճ͸ௐࠪͰ͖͍ͯͳ͍Ͱ͢ ⁃ "MMVSFຊମ͸+BWB KT ⁃ +6OJUͱ͔ʹ࢖͑ΔBMMVSFKBWB͕ଞݴޠʹൺ΂ͯ࠷΋׆ൃʹݟ͑Δ w +FOLJOTϓϥάΠϯ͸ʁ ⁃ ެࣜυΩϡϝϯτʹ࢖͍ํͷهड़͋Γ ⁃ ࠓճ͸ௐࠪͰ͖͍ͯͳ͍Ͱ͢ ⁃ ͍ۙ͏ͪʹࢼ͍ͨ͠ 25
  18. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ·ͱΊ w "QQJVNͰ6*ςετ͢Δͱ͖ͷςετϨϙʔτΛൺֱ͠·ͨ͠

    w "MMVSF͕ສೳͰศར w खܰ͞Ͱ͸STQFD@IUNM@SFQPSUFS w ෆ҆ఆͳ6*ςετʹΊ͛ͣʹؤு͍͖ͬͯ·͠ΐ͏ 26
  19. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ಈըͱεΫγϣͷࡱΓํʢ͓·͚ʣ w STQFD@IUNM@SFQPSUFSͷαϯϓϧΛࢀߟ

    ⁃ IUUQTHJUIVCDPNWCBOUIJBSTQFD@IUNM@SFQPSUFSCMPCNBTUFSFYBNQMFTBOESPJETQFDTQFD@IFMQFSSC ⁃ BECTDSFFOSFDPSEʢ࿥ը։࢝ʣ ⁃ BECQVMM BECTIFMMSNʢ"OESPJE͔ΒϩʔΧϧʹίϐʔʣ ⁃ ESJWFSTDSFFOTIPUʢεΫϦʔϯγϣοτʣ w STQFDͷDPOpHCFGPSF DPOpOHBGUFSͰεΫγϣࡱͬͨΓ࿥ ըͷ։࢝ऴྃΛߦ͏ w JGFYBNQMFFYDFQUJPOͰGBJMͷͱ͖͚ͩςετϨϙʔτʹอଘ ͢Δ w "MMVSFͷ৔߹͸FYBNQMFNFUBEFUB<>ͷ୅ΘΓʹ FYBNQMFBUUBDI@pMF ͰςετϨϙʔτʹอଘ 27
  20. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. TQFD@IFMQFSSCʢ͓·͚ʣ 28 config.include

    AllureRSpec::Adaptor config.add_formatter('progress') AllureRSpec.configure do |c| c.output_dir = './allure-results' c.clean_dir = false c.logging_level = Logger::INFO end config.before do @driver = Appium::Driver.new(capability, false) @driver.start_driver start_screenrecord end config.after do |example| stop_screenrecord screenrecord_path = pull_screenrecord screenshot_path = take_screenshot(@driver) # attach file to allure report if example.exception example.attach_file(screenrecord_path, File.open(screenrecord_path)) example.attach_file(screenshot_path, File.open(screenshot_path)) end end Allureͷઃఆ before eachͰ࿥ը։࢝ a?er eachͰ࿥ըऴྃ
 Fail࣌ʹϨϙʔτʹఴ෇