ããã«ã¡ã¯ãã¡ã«ã«ãªã®QA-SETãã¼ã ã§èªååãã¶ãã¶ããã¦ãã tadashi0713 ã§ãã
ããã¾ã§ã¯ã¢ãã¤ã«ã¢ããªã»Webã¢ããªã®E2Eãã¹ããä¸å¿ã«èªååããã¦ãã¾ããããæè¿ã§ã¯ãããã¯ãé¨éã»ã«ã¹ã¿ãã¼ãµãã¼ãé¨éã»ã³ã¼ãã¬ã¼ãé¨éã®æ¥åèªååã«ãææ¦ãã¦ãã¾ãã
ä»åã¯Selenium WebDriver (ä»¥ä¸ Selenium) ã使ã£ã¦ç°¡åã«ã§ãããã©ã¦ã¶ä½æ¥èªååã«ã¤ãã¦ãç´¹ä»ãã¾ãã
10/25ã«GitHub Japanã§LTçºè¡¨ããè³æãããã¾ãã®ã§ãåããã¦ã覧ãã ããã
æå¤ã¨å¤ãããã©ã¦ã¶ã使ã£ãç¹°ãè¿ãä½æ¥
社å ã®è²ã ãªè·ç¨®ã»ãã¼ã ã®æ¹ã ã¨ã³ãã¥ãã±ã¼ã·ã§ã³ããã¦ããã¨ããã©ã¦ã¶ã使ã£ãç¹°ãè¿ãä½æ¥ãå¤ãæãã¾ããã
ä¾ãã°
- 社å ã§ä½¿ç¨ãã¦ããWebãµã¼ãã¹ã®ã¢ã«ã¦ã³ãã社å¡ã«ä»ä¸ãã
- Chartio(https://chartio.com)ã«ãã°ã¤ã³ãã¦ã°ã©ããè¦ãã»ã¹ã¯ãªã¼ã³ã·ã§ãããåã£ã¦Slackã«å ±æãã
- ãã¼ã¸ã«ã¢ã¯ã»ã¹ãã¦ãã¡ã¤ã«(PDFã»CSVãªã©)ããã¦ã³ãã¼ããã
- åãå 容ã®ãã©ã¼ã ãå®æçã«å ¥åãã
ãããã®ä½æ¥ãèªååããã¨ãªã£ãéãWebãµã¼ãã¹ããæä¾ããã¦ããAPIã使ã£ãããIFTTTãªã©ã®ãµã¼ãã¹ã使ãã®ããç°¡åãã¤ã¡ã³ããã³ã¹ãå°ãªãã¦è¯ããã¨æãã¾ãã
ããããªãããããããæä¾ããã¦ããããã©ã¦ã¶ãå®éã«æä½ããããæ¹æ³ããªãå ´åãããã¾ãã
ããã§ããã©ã¦ã¶æä½ãèªååã§ããSeleniumã®åºçªã§ãã
ãã©ã¦ã¶æä½ãèªååãããã¼ã«ç¾¤
ä»åãã©ã¦ã¶æä½ãèªååããä¸ã§ãä¸è¨ã®ãã¼ã«ã使ãã¾ããã
Selenium
ãã©ã¦ã¶ãèªåæä½ãããã¼ã«ã§ããWebã¢ããªã±ã¼ã·ã§ã³ã®E2Eãã¹ãã«ä¸»ã«ä½¿ç¨ããã¾ãã
æ§ã ãªè¨èªã«å¯¾å¿ãã¦ãã¾ãããä»åã¯Rubyã使ãã¾ãã
Chrome (ChromeDriver)
Seleniumã§ã¯ãåãã©ã¦ã¶ã®driverãæå®ãããã¨ã§ãChromeã»Firefoxã»Safariãªã©ã®ãã©ã¦ã¶ã§å®è¡ãããã¨ãã§ãã¾ãã
ä»åã¯ChromeDriverã使ãããããã¬ã¹ã¢ã¼ãã§å®è¡ããã¾ãã
CircleCI
å®æçã«å®è¡ãããããã®ç°å¢ã¨ãã¦ä»åã¯CircleCIã使ãã¾ãã
Chromeã®ãããã¬ã¹ã¢ã¼ãã使ã
Seleniumã使ã£ã¦ãã©ã¦ã¶ãèªåæä½ãããå ´åã«ã¯ãåºæ¬çã«ã¯è¡¨ç¤ºããããã£ã¹ãã¬ã¤ãå¿ è¦ã«ãªãã¾ãã
æå ã®PCã§ã®å®è¡ã§ããã°åé¡ããªãã®ã§ãããCircleCIãªã©ã®ãã£ã¹ãã¬ã¤ããªãç°å¢ã§ã¯ä»¥ä¸ã®æ¹æ³ãåãå¿ è¦ãããã¾ãã
-
ä»®æ³ãã£ã¹ãã¬ã¤(Xvfb, Xdummy)ã使ã
-
ãããã¬ã¹ãã©ã¦ã¶(PhantomJSãChrome 59ããã®ãããã¬ã¹ã¢ã¼ã)ã使ã
è¨å®ãç°¡åãã¤ãããã°ããããããã(--headless
ãªãã·ã§ã³ãåãæ¿ããã ã)ãä»åã¯Chromeã®ãããã¬ã¹ã¢ã¼ãã使ãã¾ãã
ChromeãSeleniumã§å®è¡ãããããã«ã¯ChromeDriverãå¿ è¦ã§ãã
åOSç¨ã®ChromeDriverãã¤ããªãåã£ã¦ãã¦ãã¹ãæå®ãããã¨ãã§ãã¾ãããRubyã®å ´åã«ã¯chromedriver-helperã¨ããRubyGemã使ãæ¹æ³ãããã¾ãã
Gemãã¤ã³ã¹ãã¼ã«ããã ãã§åOSã«åãããChromeDriverãåã£ã¦ãããã¨ãã§ãã¾ãã
gem 'chromedriver-helper'
ChromeDriverã®ãã¹ãæå®ããå¿ è¦ããªãããããã¨ã¯ãããã¬ã¹ã¢ã¼ãã§ãããã¨ãè¨è¿°ãã¦ãããã ãã§å®è¡ã§ãã¾ãã
options = Selenium::WebDriver::Chrome::Options.new options.add_argument('--headless') driver = Selenium::WebDriver.for :chrome, options: options
ãã©ã¦ã¶ãæä½ããã³ã¼ããæ¸ã
ãã¨ã¯å®éã«ãã©ã¦ã¶ãæä½ããã³ã¼ããæ¸ãã ãã§ãã
ããã§ã¯æ¸ãæ¹ã«ã¤ãã¦ã¯è¨è¿°ãã¾ããããä¸è¨ã®ãã¼ãã·ã¼ããåèã«ãªããã¨æãã¾ãã
CircleCIããå®è¡
ã³ã¼ããæ¸ãã¦æå ã§å®è¡ã§ããããã«ãªã£ãããCircleCIä¸ã§å®è¡ãã¦ã¿ã¾ãã
CircleCIãªã©ã®CIãµã¼ãã¹ã§ã¯GitHubã¬ãã¸ããªã®PRã»Pushã«å¯¾ããããªã¬ã¼ãåºæ¬ã«ãªãã¾ãããèªååã«ããã¦ã¯å¥ã®ããªã¬ã¼ãè¨å®ããªãã¦ã¯ããã¾ããã
å®æçã«å®è¡ãããããããªå ´åã«ã¯ãCircleCIã§ã¯æè¿cronãè¨å®ãã¦å®è¡ãããã¨ãã§ããããã«ãªãã¾ãã
ã¾ãAPIãæä¾ããã¦ãããããBotãSlackã®slash commandãªã©ããããªã¬ã¼ãããã¨ãã§ãã¾ãã
ãããã«
ç¾å¨å¼ç¤¾ã§ã¯ãä¸è¨ã®æ¹æ³ã使ã£ããã©ã¦ã¶æä½ç³»ã®èªååãä½åãåãã¦ãã¾ãã
ã¾ãã社å ã®ãã³ããã°ã©ãã¼åãã«å®æçã«åå¼·ä¼ãå®æ½ããä¸è¨ã®ãããªæ¥åèªååãèªåãã¡ã§ã§ããããã«ãããã¨ãã¦ãã¾ãã
ãé£ãæ¹ããæãããã¨ã«ãã£ã¦ãèªãã®æ¥åãèªååã§ããæ¹ã ãå¢ããçµæã¨ãã¦ç¤¾å å ¨ä½ã§ããèªååãé²ãã§ãããã°ã¨æãã¾ãã
ä»å¾ããã®ãããªèªååTipsãå®æçã«ç´¹ä»ãã¦ããããã¨æãã¾ãã
PSã»ã»ã»ãã¹ããèªååã®è©±ãã«ã¸ã¥ã¢ã«ã«ã§ããããã«Facebookã°ã«ã¼ã Agile Testing, Automation and QAã®ç¾å ´ ãä½ã£ã¦ã¿ã¾ããããããèå³ãããã°ããã²éã³ã«ãã¦ãã ããï¼