{"id":675,"date":"2019-03-04T04:24:10","date_gmt":"2019-03-03T19:24:10","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=675"},"modified":"2019-03-04T04:24:34","modified_gmt":"2019-03-03T19:24:34","slug":"post-675","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=675","title":{"rendered":"\u3010Nightwatch.js\u3011\u74b0\u5883\u69cb\u7bc9\u65b9\u6cd5 \u203bWindows"},"content":{"rendered":"<h2 id=\"outline__1\">Nightwatch.js\u3068\u306f<\/h2>\n<p>Node.js\u4e0a\u3067\u52d5\u304fE2E\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002selenium\u3092\u4f7f\u3044\u3084\u3059\u304f\u3057\u305f\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3002<br \/>\n\u30c6\u30b9\u30c8\u306e\u8a18\u8ff0\u65b9\u6cd5\u304c\u7c21\u5358\u3002headless\u30e2\u30fc\u30c9\u3067\u3082\u52d5\u304b\u305b\u308b\u3002<\/p>\n<p>E2E\u30c6\u30b9\u30c8\u306e\u81ea\u52d5\u5316\u3060\u3051\u3067\u306a\u304f\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u884c\u3046\u5b9a\u5e38\u52d5\u4f5c\u306e\u81ea\u52d5\u5316\u3068\u304b\u3082\u3067\u304d\u305d\u3046\u3002<br \/>\nwinActor\u3068\u304b\u306b\u4ee3\u8868\u3055\u308c\u308bRPA\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3059\u308b\u3088\u3046\u306a\u304a\u91d1\u3068\u304b\u306a\u3044\u3057\u3001\u500b\u4eba\u3067\u6c17\u8efd\u306b\u3084\u3063\u3066\u307f\u305f\u3044\u3002\u3068\u304b\u306e\u304d\u3063\u304b\u3051\u3067\u3082\u304a\u3059\u3059\u3081\u3067\u304d\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"outline__2\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u5fc5\u8981\u306a\u3082\u306e<br \/>\n\u30fb\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u74b0\u5883<br \/>\n\u30fbNode.js<br \/>\n\u30fbSelenium Standalone Server<br \/>\n\u30fb\u30d6\u30e9\u30a6\u30b6\uff08edge,IE,firefox,chrome,etc&#8230;\uff09<br \/>\n\u30fb\u30d6\u30e9\u30a6\u30b6\u306b\u5bfe\u5fdc\u3059\u308bwebdriver<\/p>\n<h3 id=\"outline__2_1\">Node.js<\/h3>\n<p><a href=\"https:\/\/nodejs.org\/ja\/\">https:\/\/nodejs.org\/ja\/<\/a><\/p>\n<h3 id=\"outline__2_2\">Selenium Standalone Server<\/h3>\n<p>\u300cselenium-server-standalone-X.XX.X.jar\u300d\u3092\u624b\u306b\u5165\u308c\u308b\u3002<br \/>\n<a href=\"https:\/\/www.seleniumhq.org\/download\/\">https:\/\/www.seleniumhq.org\/download\/<\/a><\/p>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u9078\u3093\u3067DL\u3059\u308b\u5834\u5408\u306f\u3053\u3053\u304b\u3089<br \/>\n<a href=\"http:\/\/selenium-release.storage.googleapis.com\/index.html\">http:\/\/selenium-release.storage.googleapis.com\/index.html<\/a><\/p>\n<h3 id=\"outline__2_3\">webdriver<\/h3>\n<h4 id=\"outline__2_3_1\">chrome<\/h4>\n<p>ChromeDriver<br \/>\n<a href=\"https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/downloads\">https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/downloads<\/a><\/p>\n<h4 id=\"outline__2_3_2\">firefox<\/h4>\n<p>geckodriver<br \/>\n<a href=\"https:\/\/github.com\/mozilla\/geckodriver\/releases\">https:\/\/github.com\/mozilla\/geckodriver\/releases<\/a><\/p>\n<h4 id=\"outline__2_3_3\">Internet Explorer<\/h4>\n<p>The Internet Explorer Driver Server<br \/>\nSelenium Standalone Server\u3068\u540c\u3058\u5834\u6240\u306b\u3042\u308b<br \/>\n<a href=\"https:\/\/www.seleniumhq.org\/download\/\">https:\/\/www.seleniumhq.org\/download\/<\/a><br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-732\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2019\/03\/iedriver.png\" alt=\"\" width=\"962\" height=\"368\" \/><\/p>\n<h3 id=\"outline__2_4\">\u6ce8\u610f<\/h3>\n<p>webdriver\u3068\u30d6\u30e9\u30a6\u30b6\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u4e92\u63db\u6027\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3002<br \/>\n\u3053\u308c\u304c\u305a\u308c\u3066\u308b\u3068nightwatch\u3092\u8d77\u52d5\u3057\u3066\u3082\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<br \/>\n\u4f8b\u3048\u3070\u3001chrome\u3060\u3068ChromeDriver 2.46\u3092\u4f7f\u3046\u3068\u3057\u305f\u5834\u5408\u3001<br \/>\nchrome\u306e\u30b5\u30dd\u30fc\u30c8\u30d0\u30fc\u30b8\u30e7\u30f3\u306fv71-73\u306e\u9593\u3092\u4f7f\u308f\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-733\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2019\/03\/chromedriver.png\" alt=\"\" width=\"678\" height=\"400\" \/><\/p>\n<p>firefox\u306e\u5834\u5408\u3060\u3068release\u60c5\u5831\u306b\u8a18\u8f09\u304c\u3057\u3066\u3042\u308b\u3002<br \/>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-734\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2019\/03\/geckodriver.png\" alt=\"\" width=\"886\" height=\"597\" \/><br \/>\n\u3053\u306e\u4f8b\u3060\u3068selenium\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3082\u8a18\u8f09\u304c\u3057\u3066\u3042\u308b\u306e\u3067\u6ce8\u610f\u3002<\/p>\n<h2 id=\"outline__3\">Hello world<\/h2>\n<h3 id=\"outline__3_1\">npm\u3067\u5fc5\u8981\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n<p>\u307e\u305anightwatch\u3092\u59cb\u3081\u308b\u57fa\u5e95\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u308b\u3002<br \/>\n\uff08\u3053\u3053\u3067\u306f\u300cC:\\opt\\nightwatch\u300d\u3068\u3059\u308b\uff09<br \/>\n\u300cC:\\opt\\nightwatch\u300d\u306b\u79fb\u52d5\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067nightwatch\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">npm install nightwatch<\/pre>\n<h3 id=\"outline__3_2\">nightwatch.js<\/h3>\n<p>windows\u3067\u52d5\u304b\u3059\u3068\u304d\u306f\u5fc5\u8981\u3089\u3057\u3044\u3002<br \/>\n\u300cC:\\opt\\nightwatch\u300d\u76f4\u4e0b\u306b\u7f6e\u3044\u3066\u304a\u304f<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nrequire('nightwatch\/bin\/runner.js');\r\n<\/pre>\n<h3 id=\"outline__3_3\">\u8d77\u52d5\u306b\u5fc5\u8981\u306adriver\u7cfb<\/h3>\n<p>\u300cC:\\opt\\nightwatch\\lib\u300d\u3092\u4f5c\u6210\u3057\u3001chrome\u3067\u8d77\u52d5\u3059\u308b\u306e\u3067chromedriver.exe\u3092\u683c\u7d0d\u3057\u3066\u304a\u304f\u3002<br \/>\n\u6700\u5c0f\u69cb\u6210\u306e\u5834\u5408\u3001chromedriver.exe\u3060\u3051\u3067\u52d5\u304b\u305b\u308b\u3002<br \/>\nselenium-server-standalone\u3092\u4f7f\u3046\u5834\u5408\u306f\u540c\u3058\u5834\u6240\u306b\u5165\u308c\u3066\u304a\u304f\u3002<\/p>\n<h3 id=\"outline__3_4\">test<\/h3>\n<p>\u300cC:\\opt\\nightwatch\\tests\u300d\u3092\u4f5c\u6210\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u30c6\u30b9\u30c8\u3059\u308b\u30bd\u30fc\u30b9\u3092\u683c\u7d0d\u3059\u308b\u3002<br \/>\n<a href=\"https:\/\/chocoby.jp\/blog\/2015\/04\/30\/selenium-server-windows-nightwatch-js\/\">https:\/\/chocoby.jp\/blog\/2015\/04\/30\/selenium-server-windows-nightwatch-js\/<\/a>\u306e\u65b9\u306e\u30c6\u30b9\u30c8\u30bd\u30fc\u30b9\u3092\u3061\u3087\u3063\u3068\u62dd\u501f\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3 id=\"outline__3_5\">nightwatch.json<\/h3>\n<p>nightwatch\u306e\u4e00\u756a\u91cd\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3002\u5168\u3066\u306e\u8a2d\u5b9a\u3092\u53f8\u308b\u3002<br \/>\nnightwatch.conf.js\u3068\u3044\u3046\u540d\u524d\u3067javascript\u5f62\u5f0f\u3067\u66f8\u304f\u5fc5\u8981\u3082\u3042\u308b\u304c\u4eca\u56de\u306f\u5272\u611b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{\r\n\t&quot;src_folders&quot;: &#x5B;\r\n\t\t&quot;tests&quot;\r\n\t],\r\n\t&quot;output_folder&quot;: &quot;reports&quot;,\r\n\t&quot;webdriver&quot;: {\r\n\t\t&quot;start_process&quot;: true,\r\n\t\t&quot;server_path&quot;: &quot;.\/lib\/chromedriver&quot;,\r\n\t\t&quot;cli_args&quot;: &#x5B;\r\n\t\t\t&quot;--verbose&quot;\r\n\t\t],\r\n\t\t&quot;port&quot;: 9515\r\n\t},\r\n\t&quot;test_settings&quot;: {\r\n\t\t&quot;default&quot;: {\r\n\t\t\t&quot;desiredCapabilities&quot;: {\r\n\t\t\t\t&quot;browserName&quot;: &quot;chrome&quot;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h3 id=\"outline__3_6\">\u5b9f\u884c<\/h3>\n<p>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067nightwatch\u304c\u8d77\u52d5\u3055\u308c\u308c\u3070\u6210\u529f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nnode nightwatch.js\r\n<\/pre>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nC:\\opt\\nightwatch&gt;node nightwatch.js\r\n\r\n&#x5B;Google] Test Suite\r\n===================\r\n\r\nDevTools listening on ws:\/\/127.0.0.1:51039\/devtools\/browser\/eb3df138-aed6-422a-a157-b779a7f47e59\r\nRunning:  Demo test Google\r\n\r\n\u221a Element &lt;body&gt; was visible after 19 milliseconds.\r\n\u221a Testing if the page title equals &quot;Google&quot;  - 5 ms.\r\n\u221a Testing if element &lt;input&#x5B;type=text]&gt; is visible  - 21 ms.\r\n  Warning: More than one element (2) found for &lt;input&#x5B;name=btnK]&gt; with selector: &quot;input&#x5B;name=btnK]&quot;. Only the first one will be used.\r\n\u221a Element &lt;input&#x5B;name=btnK]&gt; was visible after 534 milliseconds.\r\n\r\nOK. 4 assertions passed. (3.065s)\r\n\r\n<\/pre>\n<p>\u6700\u7d42\u7684\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2019\/03\/nightwatch_directory.png\" alt=\"\" width=\"587\" height=\"232\" class=\"alignnone size-full wp-image-736\" \/><\/p>\n<h2 id=\"outline__4\">\u53c2\u8003<\/h2>\n<p><a href=\"http:\/\/nightwatchjs.org\/\">\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a><br \/>\n<a href=\"https:\/\/www.webprofessional.jp\/javascript-functional-testing-nightwatch-js\/\">\u307e\u3060\u624b\u52d5\u3067\u3084\u3063\u3066\u306a\u3044\uff1fUI\u30c6\u30b9\u30c8\u3092\u7206\u901f\u3067\u81ea\u52d5\u5316\u3067\u304d\u308bNightwatch.js\u304c\u4fbf\u5229\u3059\u304e<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nightwatch.js\u3068\u306f Node.js\u4e0a\u3067\u52d5\u304fE2E\u30c6\u30b9\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002selenium\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":717,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[168],"tags":[170,169],"class_list":["post-675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-nightwatch-js","tag-chrome","tag-nightwatch-js"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=675"}],"version-history":[{"count":4,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/675\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/675\/revisions\/737"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/717"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}