2024/10/25-26 ã§æ±äº¬ã®ææã§éå¬ãããKaigi on Rails 2024ã§ç»å£çºè¡¨ãã¦ããã
ã¿ã¤ãã«ã¯ãCapybara+çæAIã§ã©ãã¾ã§æ¬å½ã«èªç¶è¨èªã®ãã¹ããæ¸ãããï¼ã kaigionrails.org
éå»ï¼åã¯
- 2021å¹´âRailsã®ã·ã¹ãã ãã¹ã解åå¦
- å é¨æ§é ãç¥ããã«Capybaraã使ã£ã¦ããããä¸å®å®ãªãã¹ããçã¿åºãããï¼
- 2023å¹´âE2E testing on Rails 2023
- Capybaraã®ãã¨ã¯ä¸æ¦å¿ãã¾ããããNode.jsãã¼ã¹ã®ãã¹ãã©ã³ãã¼ã§Railsã¢ããªã±ã¼ã·ã§ã³ããã¹ãããã«ã¯ï¼
ã¨ãã£ãå 容ã§ãã¾ãã¾ãã¢ã³ãCapybaraãªäººã¿ãããªå°è±¡ã¯æããã¦ããããªã¨ããã§ãä»åã¯ããã¦Capybaraãæ´»ç¨ãããããªãããã¯ã¨ããããã¨ã¯ã2023å¹´é ããæ¥éã«æ®åãã¦ããçæAIã®æ´»ç¨ã«ã¤ãã¦ãããã®ã¿ã¤ãã³ã°ã§è§¦ããªããã°ããæ¥å¹´ã«ã¯è³å³æéåãã§ãããï¼ã¨ããã®ããããã¦ãã¼ããèãã¦ãçµæçã«ãã ãã¶ããæãã®çºè¡¨ã¯ã§ããã¨æãã
ä»å¹´ã¯ä»äºã®ã»ãããã¸ã¯ã½å¿ãããã©ãèãã¦ãéå»ï¼åã»ã©ã®æºåæéã¯åãããããªãã£ãã®ã§ã15åã»ãã·ã§ã³ã§ããããããã¨èªç±ç 究ã«è¿ãçºè¡¨ã¨ãªã£ãããã¨ããèãã話ã ã¨ãã©ãããä»å¹´ã¯ãããã¼ãµã«ãï¼æ¬ã«ï¼æ¬ãããããæ¡æããã¦ããªãã£ãããã§ããããªãªãã§å²ã¨ã¿ã¤ã ãªã¼ãªãã®ãã¼ããæ¡æããã¦ãããä¸å®å ¨ãªé¨åãæ®ããªãããã¨ããããRailsã¨ã³ã¸ãã¢ãåã«å ã ã¨çºè¡¨ãããã¨ãã§ãã¦æ¬å½ã«è¯ãã£ããªã¨æãã
ãã¨ãä»å¹´ã¯å»å¹´ã«æ¯ã¹ãã¨ç¾å°åå è ãæ親ä¼åå è ãï¼ä½æã ãã©ï¼ï¼åãããã«å¢ãã¦ãã¨æãã2021å¹´ã®åå æããæãã¨ãæ¬å½ã«å¤§ããã«ã³ãã¡ã¬ã³ã¹ã«ãªã£ã¦ãããªã¼ã¨ããå°è±¡ãï¼å¹´å¾ãããã«ã¯Droidkaigiããã以ä¸ã®è¦æ¨¡ã«ãªã£ã¦ãããããªããã
ãããªããããã¯ããã¤ã¤ãã¨ããããå»å¹´ã®è¨äº (Kaigi on Rails 2023 現地参加して "E2E testing on Rails 2023" というお話をしてきた - YusukeIwakiのブログ)ã¨åæ§ãä»å¹´ãç»å£ã¾ã§ã«ãã£ããã¨ãå½æ¥ã®ãã¨ããªã©ãªã©ãå¿ããªãããã«æ¸ãçãã¦ãããã¨æãã
ç»å£ãã¿ã決ããã¾ã§
æ£ç´ãã£ã¦ããããã¼ãµã«ã®åéãå§ã¾ã£ãæç¹ã§ã¯ãã¿åãç¶æ ã ã£ããéå»ï¼åï¼ã¨ãã«2021ï¼ãæ¿åãªå 容ã§ã·ã¹ãã ãã¹ãã¾ããã®ä»çµã¿è§£èª¬ã«å¾¹ããæãã§ãã£ã¦ãããã©ãRailsã®ã·ã¹ãã ãã¹ãã®æè¡çãªé¨åã¨ããã®ã¯2021å¹´ã®çºè¡¨æç¹ãããããªã«å¤§ããå¤ãã£ã¦ããªãããPlaywrightã®æ©è½æ§ãå»å¹´ãããããªã«å¤§ããã¯å¤ãã£ã¦ããªãã
ãã£ã½ãã§ã2023å¹´é ããæµè¡ãã ãã¦ãããçæAIãã¨ãããã®ã«ã¤ãã¦ã¯ãã©ããRailsã¢ããªã±ã¼ã·ã§ã³éçºã§ã®æ´»ç¨ã¨ããã®ã¯ä»ã²ã¨ã¤ãã³ã¨ãã¦ããªãã
ã...ã¨ãªãã¨ãæè¡çãªé²æ©ããããªã«ãªããã¨ãéæã«åã£ã¦ãçæAIããã¡ããã¡ãæ´»ç¨ããèªåãã¹ãã£ã¦ããã®ãæå±ãã¦ã¿ãããããããããããï¼ï¼
ã£ã¦æãã§ãªãã¨ãªããããã¼ãµã«ãåºããã®ã§ãã£ããã¡ãªã¿ã«ãå½æã®ä¼ç¤¾ã§ã®ç¬ãè¨ãã£ãã«ã«ã¯ãã®ãããªãã¨ãæ¸ããã¦ããã
è¨æ¶ã¯ããã¾ãã ãã©ããã¶ãChatGPTãè£ã§ãã©ã¦ã¶ãåããã¦ãã¹ãã·ããªãªãèªå¾çã«å¤æã»å®è¡ãããããªãã©ã¤ããä½ããã¨ã ãã¯ãã®ã¨ããã決ãã¦ãã¦ãéã«ãã以å¤ã®ãã¨ã¯ä½ãèãã¦ããªãã£ãæ°ãããã
Details
2023å¹´ãããããChatGPTãã¯ããã¨ããçæAIãæ´»ç¨ããã³ã¼ãã£ã³ã°ã¯ãã¡ãã¡ã§äºä¾ãå ±æããã¦ãã¾ããããã¹ãã«é¢ãã¦ãããã¹ããã¼ã¿ãä½ãããããã¹ãã³ã¼ããæ¸ãããããªã©ãCopilotçãªäºä¾ã¯ããèãã¾ãã ã¨ããã§ãRailsã«ã¯ã·ã¹ãã ãã¹ãã¨ããWebãµã¼ãã¼ãå®éã«ç«ã¦ã¦ãã©ã¦ã¶ã¨å¯¾åããã¦è©¦é¨ããä»çµã¿ãããã¾ããã·ã¹ãã ãã¹ãã§ã¯Capybaraã使ãããããã¯ã¨ã³ãã«ã¯SeleniumãPlaywrightãªã©ããã©ã¦ã¶ãèªåæä½ããã¨ã³ã¸ã³ã使ããã¾ãããã¹ãã«ã¯DOMã»ã¬ã¯ã¿ãªã©æ©æ¢°çãªè¨èªãå ¥åè¨èªã¨ãã¦ä½¿ããã¾ãããããã»ã©çæAIãããããã§ããã®ãªããèªç¶è¨èªãå ¥åã¨ããOpenAIãããã¯ã¨ã³ãã¨ããCapybaraãã©ã¤ããä½ããã¯ãã§ã¯ãªãã§ããããï¼ã¨ãããã¨ã§ãå®éã«ä½ã£ã¦ã¿ã¾ãããCapybaraãã©ã¤ãã®å®è£ èªä½ã¯ããªãããããªè©±é¡ã«ã¯ãªããç人åãã§ãããã·ã¹ãã ãã¹ãã§èªç¶è¨èªã§è©¦é¨ãæ¸ããæªæ¥ãæãããã¨ã«ã¤ãã¦ã¯åãã¦ã®æ¹ã§ã楽ãããã®ã§ã¯ãªããã¨æããã¾ãã
Pitch
ã¾ãæ代çã«ãä»å¹´ã¯çæAIé¢é£ã®è©±é¡ã¯æ¬ ãããªãã ããã¨æãã¾ãããã®ãªãã§ããã åã«AIã«ä¸éæ§ã®ã³ã¼ãããã¹ããã¼ã¿ãä½ããããã¨ããã®ã¯ãã飽ãã¦ãã¾ãããããç¶ç¶çã«AIã«ä»äºããã¦ãããããããRailsã®ã·ã¹ãã ãã¹ãã¨èåããããã¨ããçºæ³ã®åãçµã¿ã¯ããã¾ã§ãã¾ãããã¦ããªãã£ãã®ã§ã¯ãªããã¨æãã¾ãã Kaigi on Railsã§Capybaraãã·ã¹ãã ãã¹ãã®è©±é¡ãç¶ãã¦ãã身ã¨ãã¦ãä»å¹´ã¯ãããã£ã¬ã³ã¸ã³ã°ãªæ¹åã§ã©ã¤ããã¼ã¯ããããã§ãã
ãããªå 容ã§æ¸ãã¦åºãã¦ã¾ããããã¾ãæ代çã«ãä»å¹´ã¯çæAIé¢é£ã®è©±é¡ã¯æ¬ ãããªãã ããã¨æãã¾ãããå²ã¨ãã¸ï¼æ¬å¿ï¼ãªã¨ããã§ãKaigi on Rails 2023ã«ã¤ã¥ãã2024ããã²çãä¸ãããã¦ããï¼ã¨æã«ä¼ãã¦ãã...ï½
ã¹ãã¼ãªã¼ãçµã¿ç«ã¦ã¦çºè¡¨å 容ã決ããã¾ã§
ããã«ãã£ã¦ãiPad+Apple Pencilã®åºçªw
人工ç¥è½ã«æ足ãæããã¦ãã©ã¦ã¶ãèªå¾çã«æä½ã§ããããã«ããï¼ã¨ããçæ³åã¯7ææ«æç¹ã§âã®ãããªçµµãæ¸ãã形跡ããããçµæçã«ã¯ã¹ã©ã¤ãã®ä¸ã«ãç»å ´ãããã¿ã ã
ãã ãä»å¹´ã¯æ¬å½ã«ã²ã©ãã¦ãæ·±å ããå§ããã®ã¯ãªãã¨10/11ã§çºè¡¨ã®ï¼é±éåã
ä¼ç¤¾ã®ãã£ããã®ç¬ãè¨ãã£ãã«ã«ã¯ãããªãã¨ãæ¸ãæ®ããã¦ãã...ãçºè¡¨ããããããã¾ãã§ããä»ã ããããè¨ãããã¨ã ããæ¬å½ã«ã²ã©ãç»å£é§åéçºã§ãããï¼é±éåã«ãªããæµç³ã«æéãåããªããã¨ãã¾ããã£ããã¨ã¯ "é湯ï¼ãµãã®æ¹¯ï¼ã«ãã£ã¦ä½æ¥ãã" ã¨ãããã¨ãããã§ä¸æ°ã«é²æããã
ããã¦ã³ã¼ããæ¸ããã¨ã§ã¯ãªãã¨ã«ããæ·±å ããææ¸ãã§ãããã¨ããå§ããã®ã¯ä¾å¹´ã®éããé åºã®åå¾ã¯ãã¨ããèãããã¨ã«ãã¦ãããããã®å 容ããã£ãããã¬ã¼ãºã£ã½ããã®ãªã©ã¯ã10/11ããããæ°æ¥ã§ç·´ãä¸ããã
ãããã®å 容ããæ¬çªã§çºè¡¨ããã¹ã©ã¤ãã«ã¯ï¼é åºã¯ã¾ã¡ã¾ã¡ã ãï¼ã»ã¼ã»ã¼ãã®ã¾ã¾ç»å ´ãã¦ããããã¯ãææ¸ãã§æ´çããã¨æ©ãã
æå¾ å¤èª¿æ´ï¼
ããã¯å®å ¨ã«èªåã®éå»ã®åã£ãçµé¨ã«åºã¥ãæªãã èªèãªãã ãã©ãAIã®åéã¨ããã®ã¯ãããããçºè¡¨ããã人ãå¤ãæ°ããã¦ããã
- ãã¾ãããé¨åã ãããã¢ã§è¦ãã¦
- 夢ãæããããã³ã³ã»ããã ã¼ãã¼ã§è£å®ãã¦å ±æãéã
- ã§ããå®éã«ã»ã¨ãã©ã®ã¦ã¼ã¹ã±ã¼ã¹ã§ã¯ä¹±æ°ã¨åç¨åº¦ãããã¯ãã以ä¸ã®ç²¾åº¦ããåºãªã
ã¿ãããªãã¤ã
Kaigi on Railsã¯åå¿è ããä¸ç´è ã¾ã§ãã£ãã楽ãããã«ã³ãã¡ã¬ã³ã¹ã¨ããªã·ã¼ã§æè¨ããã¦ããã®ã§ããã¾ããããªããã®ã¯ãã£ãããã¾ããããªãã¨ä¼ãã¦ã¿ããªã§è¯ããã¦ãããï¼ã¨ããæµããä½ã£ã¦ããããã¨ã絶対ã§ããã
ãããªã£ã¦ããã¨ãçæAIã«ã¯ã¬ãã£è¦ç´ ããããããã§ãé«ç¢ºçã§ãã¾ãããé¨åã¨ãã©ãã«ããã¾ããããªãé¨åã¨ããã®ã¯éç¨ãå«ãã¦å ¨é¨è¦ããã¨ã次ã«åããã¨ããã人ãåã失æãããã«æ¸ãã
çµæçã«ã¯ãã®è¾ºãã¯æ¬çªã¹ã©ã¤ãã§ãç¹ãè¾¼ãã§
- å®ç¨æ®µéã«ã¯ãªãï¼æ°æ¥½ã«èãã¦æ¥½ããã§ãããã¨åé ã§ä¼ãã
- ãã¢ã®åã«ãæ ¹åºã®è«çããå®é¨éç¨ãªã©ãé ããè¦ãã
- ãã¢ã¯ãããªã§ã¯ãªããå®éã«åãããã®ã«ãã
ã¨ããæ§æã§è¨ãã ã
ä¸è¬çãªãã¼ãã§ã¯ãã¢ã失æããã®ãæãã¦ãããªã«ããã¨ããããã¡ã ãã©ãä»åã¯éã§ãããããã¢ã¯å¤±æããå¯è½æ§ã®ã»ããé«ãã®ã§ãããã§ãã£ãã(å°æ¥æ§ããªã)ã¨ãªããªãããè¨è¨ããããã¨ãããã¨ã ã
ææç©ã®ç¨æ
å®è£ ãã§ã¼ãºã«ããã¦ã¯ããµãã®æ¹¯ã«ã¯ï¼ãï¼æ¥ã«ä¸åã¯è¡ã£ãw
ãCapybaraãã©ã¤ããæ¡å¼µãã¦å®è£ ããæ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ããã£ã¦è¨ã£ã¦ãã¾ã£ã¦ãã以ä¸ãCapybaraã®ãã©ã¤ãã¯æä½éä½ã£ã¦ãå½æ¥ã¾ã§ã«å ¬éã§ããããã«ããªããã°ãªããªãã
charai ã¨ããé©å½ãªååã®ã©ã¤ãã©ãªã«ãã¦ãä½ã£ãã
ãã©ã¦ã¶ãããããåããé¨åã¯ã Playwrightã§ãPuppeteerã§ãä½ã§ãããã£ããã ãã©ã Page.waitForSelector
ã¨ãæ°ã®å©ããæ©è½ã¯ä»åãããªãã®ã§ãåå¹´åãããã« WebDriver BiDiã§Firefoxãåãããµã³ãã«ã©ã¤ãã©ãª minibidi ãä½ã£ã¦ãã®ãã¡ããã©ãã£ãã®ã§ããããå
å
ããå½¢ã«ããã
ãã¢ã®ç¨æ
ãã¢ã®å 容ã¨ãããã·ããªãªã¯å½æ¥ã¾ã§ã«ä½åº¦ãå·®ãæ¿ããæ°ã¯ããã
- æåã¯ãCSSã»ã¬ã¯ã¿æ¸ããªãã¦ãAIã§ããã¾ã§ã§ãããã ãã¢ãã¼ã«ããããã¨ããã°ã¤ã³âããã¤ã¹ä¸è¦§ããããã¤ã¹ãé¸æâ詳細ã«ãã®ããã¤ã¹ã®IMEIãåºããã¨ããPlaywrightã§æ¸ãã¦ãçµæ§ã¨ã³ã¸ãã¢ãè¦å´ãããã¤ãé¡æã«ãã¦ããããAIã«ããããã¨30å以ä¸ãããã¦ãï¼åº¦ãæåããªã...ã
- ãã¿ã«æ¯ãåã£ã¦ããã®åçãè¦ã¦ãã±ã¦ãã£ã¦ã®ããã£ã¦ã¿ã¦ãæéçã«ã¯ã¡ããã©ããã£ããå 容ãé¢ç½ãã£ããããRailsã®ãã¹ããã¨ããæèããå¤ãããã¦ããã¾ãã«å®ç¨æ§ã¨ã¯ç¨é ãã¨ããå°è±¡ãä¸ãã¦ãã¾ãã
- æ°æ§ã§åãè¦ãç®ã§ãDOMæ§é ãå ¨ç¶éããã©ãæ°âæ§ã¸ã®ãã©ã¼ã«ããã¯ã®ã¹ããã追å ããã ããã£ã¦ãããã¢ã§ããã°ãæåã®æ¹ã§èª²é¡æã¨ãã¦ä¸ãã¦ãããDOMæ§é ãå¤ãã£ã¦ç§»è¡ãããã©ããã£ã¦è©±ã¨ãªã³ã¯ã§ãã¦ããããã
ã¨ããããã試ãã¦ãæå¾ã®ãã¤ã«ããã
ã¡ãªã¿ã«ãçºè¡¨ã§ã¯ç¹ã«è¨åããªãã£ããããã®ãã¢ã¯ã¨ã¦ããéãããã£ã¦ãã¦ã
åæã¯ï¼åæµãã®ã«400åãããð°ï¸ãé£ãã§ãã£ã¦ããããããéä¸ã§ãç»åã®ã¢ãããã¼ãéã調æ´ããã®ã§ãå°ãè½ã¡çããã...ã
ã§ãçµå±åºæ¥ä¸ãã£ãã®ã¯ãï¼é±éåãï¼ãªãããã®æç¹ã§è³æã¯0æï¼ï¼
æ¬çªã¾ã§
ãããã«ã¹ã©ã¤ãï¼æããï¼é±éã§ç·´ç¿ã¾ã§ãã£ã¦æ¬çªã«æã£ã¦è¡ãã«ã¯ãä»äºãããããã¨ãè¨ã£ã¦ããããªãã®ã§åä¼ãäºåº¦ã¨ãããµãã®æ¹¯ã«ã2度è¡ããä»ä¸ããã
æ¥ææ¥ã«ã¯0æã ã£ãã®ããç«ææ¥ã«ã¯20æã¡ãããæ°´ææ¥ã«ã¯94æã¾ã§ãµããã¾ãããã¨ã¯èª¿æ´ãã¦ç·´ç¿ãã¦æ¬çªã¸...ã
æ©éãé«ããã¹ããã¡ããã©10/23çºå£²ã ã£ãiPad mini第7ä¸ä»£ãç¡é§è²·ããã¦ãã©ãã§ã§ãç·´ç¿ã§ãããã¼ï¼ã¨ã¤ãã£ã¦ãå½æ¥ã®æã®é£è¡æ©å ã§ãç·´ç¿ãã¾ãã£ã¦ãæ¬çªã¸ã
ã¡ããã¡ããã»ãªãèªä½ã¯å¿ãããã®ã®ãå ¨ä½ã®æµãã¨ãã¯ããã¨è¦ãã¦ãã®ã§ãããããã¨åããããªã¨æãã
memo
çºè¡¨è³æï¼å ¬éç¨ï¼
å½æ¥ã®åå¿
ã¾ã¨ã
ãµãã®æ¹¯ã¯ã¨ã¦ãããã£ãã
ã ãã¶å¤§è¦æ¨¡ãªã¤ãã³ãã«ãªã£ã¦ãã¦ããããæ¥å¹´ãå æ°ãããã°åºãï¼éw