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

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

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

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

9bcd328daf60fe29dc9970f6cfc26730?s=128

Kenta Kase

March 20, 2018
Tweet

Transcript

  1. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. UIςετʹ࠷దͳ
 ςετϦϙʔλʔΛٻΊͯ 1

    Android Test Night #3
 2018/03/19 Ճ੉݈ଠ@DeNA
  2. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ࣗݾ঺հ w Ճ੉݈ଠʢ!,FTJOʣ

    ⁃ ॴଐ • %F/"48&5άϧʔϓςετج൫νʔϜ ⁃ ۀ຿ • ϞόΠϧςετͷௐࠪɺ஌ݟͷڞ༗ • ଞࣄۀ෦ͷۀ຿ޮ཰Խαϙʔτ ⁃ झຯͰ3FBDU/BUJWFࢼͨ͠Γ 2
  3. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ςετॻ͍ͯΔਓʁ 3

  4. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 6*ςετॻ͍ͯΔਓʁ 4 Espresso?

    Appium?
  5. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. $*Ͱ6*ςετಈ͔ͯ͠Δਓʁ 5

  6. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. $*Ͱ6*ςετམͪͨͱ͖ w ϩά͔Βࣦഊͨ͠ݪҼΛ୳͢ͷ͸େม

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

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

  9. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ཧ૝ͷ6*ςετϦϙʔλʔʢ͔ͳΓཉ͍͠ʣ w ςετέʔεຖʹ෼ׂ͞Εͨಈը

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

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

    w ಈը͋Ε͹ෆཁ͚ͩͲ͋ͬͯ΋͍͍͔΋͠Εͳ͍ w σόΠεϩάɺ"QQJVNαʔόʔͷϩά w ຊ౰͸ཉ͍͕͠ɺࠓճ͸͜͜·ͰͰ͖ͳ͔ͬͨ 11
  12. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ৭ʑͳςετϦϙʔλʔΛௐ΂ͯΈ·ͨ͠ w ࠓճ͸"QQJVN

    34QFD SVCZ  w %SPJE,BJHJͷΞϓϦʹ6*ςετΛॻ͍࣮ͯݧ 12
  13. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. 34QFDඪ४ʢGPSNBUIUNMʣ 13 w

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

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

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

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

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

    εΫϦʔϯγϣοτ
  19. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ΤϥʔϝοηʔδͳͲ w ͪΐͬͱ੯͍͠

    ⁃ ελοΫτϨʔε˓ ⁃ Τϥʔߦº ⁃ पลίʔυº 19
  20. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ςετέʔε࣮ߦ࣌ؒɺλΠϜϥΠϯ w ςετέʔεຖʹ࣮ߦ࣌ؒ

    w λΠϜϥΠϯͰͲͷςετ͕ͲΕ͚͔͔ͩ࣌ؒͬͯΔ͔ՄࢹԽ 20
  21. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. ϑΟϧλϦϯάɺιʔτ w εςʔλεͰϑΟϧλϦϯά

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

    ͖Δ w աڈʹ'BJM͍ͯ͠Δͱ1BTTͯ͠΋'MBLZ 6OTUBCMF ൑ఆ w ৄ͍͠৚݅͸υΩϡϝϯτݟͯ΋ෆ໌ w 'MBLZ͕ղআ͞ΕΔ͜ͱ͕͋ΔͷͩΖ͏͔ʁ 22
  23. 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
  24. Copyright (C) DeNA Co.,Ltd. All Rights Reserved. "MMVSFͷ࢖͍ํ •$ brew

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

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

    w "MMVSF͕ສೳͰศར w खܰ͞Ͱ͸STQFD@IUNM@SFQPSUFS w ෆ҆ఆͳ6*ςετʹΊ͛ͣʹؤு͍͖ͬͯ·͠ΐ͏ 26
  27. 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
  28. 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࣌ʹϨϙʔτʹఴ෇