{"id":500,"date":"2018-10-02T01:58:24","date_gmt":"2018-10-02T01:58:24","guid":{"rendered":"https:\/\/thinkcolorful.org\/?p=500"},"modified":"2024-12-13T19:52:48","modified_gmt":"2024-12-13T19:52:48","slug":"outreachy-internship-application-process-part-2-echo-tests","status":"publish","type":"post","link":"https:\/\/thinkcolorful.org\/?p=500","title":{"rendered":"Outreachy Internship Application Process: Part 2 Echo Tests"},"content":{"rendered":"<p>I ran into a problem when running the <a href=\"https:\/\/phabricator.wikimedia.org\/diffusion\/ECHO\/browse\/master\/tests\/selenium\/specs\/echo.js\">echo.js<\/a> test. The login should be username: admin and password: vagrant as per these <a href=\"https:\/\/www.mediawiki.org\/wiki\/MediaWiki-Vagrant#Quick_start\">instructions<\/a>, but when the test runs mediawiki complains that the password is too short and prompts the user to change it to a password of 8 characters or more.<!--more--><\/p>\n<p><a href=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-501 size-large\" src=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-510x226.png\" alt=\"\" width=\"510\" height=\"226\" srcset=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-510x226.png 510w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-300x133.png 300w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-768x340.png 768w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-100x44.png 100w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-862x382.png 862w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-1200x532.png 1200w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-846x375.png 846w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-1184x525.png 1184w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement-864x383.png 864w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/8charrequirement.png 1340w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>When I tested this manually and clicked the &#8216;skip&#8217; button this error showed up:<\/p>\n<p><a href=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-502 size-large\" src=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-510x220.png\" alt=\"\" width=\"510\" height=\"220\" srcset=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-510x220.png 510w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-300x129.png 300w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-768x331.png 768w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-100x43.png 100w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-862x371.png 862w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-1200x517.png 1200w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-846x364.png 846w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-1184x510.png 1184w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror-864x372.png 864w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/hitskiptointernalerror.png 1354w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>So my way around it is I created a new user called admin2 with password vagrant123 (so it met the password length requirement). I modified the echo.js code to say\u00a0 <code>UserLoginPage.login( 'admin2', 'vagrant123' );<\/code> but then it brought up this page,\u00a0 something again to do with central login?:<a href=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-503 size-large\" src=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-510x302.png\" alt=\"\" width=\"510\" height=\"302\" srcset=\"https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-510x302.png 510w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-300x178.png 300w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-768x455.png 768w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-100x59.png 100w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-862x510.png 862w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-846x501.png 846w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z-864x512.png 864w, https:\/\/thinkcolorful.org\/wp-content\/uploads\/2018\/10\/ERROR_chrome_2018-10-02T01-30-23.527Z.png 1042w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/a><\/p>\n<p>To get around that I added this line after the modified one above:\u00a0 <code>UserLoginPage.open();<\/code> and the test passed.<\/p>\n<p>So the echo.js code that passed it&#8217;s test looks like this:<\/p>\n<p>&#8216;use strict&#8217;;<\/p>\n<pre>var assert = require( 'assert' ),\n        EchoPage = require( '..\/pageobjects\/echo.page' ),\n        UserLoginPage = require( 'wdio-mediawiki\/LoginPage' );\n\ndescribe( 'Echo', function () {\n\n        it( 'alerts and notices are visible after logging in', function () {\n\n                UserLoginPage.login( 'admin2', 'vagrant123' );\n                UserLoginPage.open();\n                assert( EchoPage.alerts.isExisting() );\n                assert( EchoPage.notices.isExisting() );\n\n        } );\n\n} );<\/pre>\n<p>And Terminal Results:<\/p>\n<pre>ephemeral@ephemeral-peppy:~\/Programs\/vagrant\/mediawiki$ sudo .\/node_modules\/.bin\/wdio tests\/selenium\/wdio.conf.js --spec extensions\/Echo\/tests\/selenium\/specs\/echo.js\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/VisualEditor\/modules\/ve-mw\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/Wikibase\/repo\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/skins\/*\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/CirrusSearch\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/VisualEditor\/modules\/ve-mw\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/Wikibase\/repo\/tests\/selenium\/specs\/**\/*.js did not match any file\npattern \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/skins\/*\/tests\/selenium\/specs\/**\/*.js did not match any file\n------------------------------------------------------------------\n[chrome #0-0] Session ID: 5e3a5bd5ee9de04125eb11c505b0c9e1\n[chrome #0-0] Spec: \/home\/ephemeral\/Programs\/vagrant\/mediawiki\/extensions\/Echo\/tests\/selenium\/specs\/echo.js\n[chrome #0-0] Running: chrome\n[chrome #0-0]\n[chrome #0-0]   Echo\n[chrome #0-0]\n[chrome #0-0]   Echo\n[chrome #0-0]       \u2713 alerts and notices are visible after logging in\n[chrome #0-0]\n[chrome #0-0]\n[chrome #0-0] 1 passing (26s)\n[chrome #0-0]\n\nWrote xunit report to [\/home\/ephemeral\/Programs\/vagrant\/mediawiki\/tests\/selenium\/log].\n\n\n1 passing (27.90s)\n<\/pre>\n<hr \/>\n<p>Update:<br \/>\nFound some documentation about how to change the value of the username and password <a href=\"https:\/\/phabricator.wikimedia.org\/source\/mediawiki\/browse\/master\/tests\/selenium\/\">here<\/a> (values are set in the wdio.conf.js file).<\/p>\n<p><!--Ran the test with: <code> .\/node_modules\/.bin\/wdio tests\/selenium\/wdio.conf.js --spec extensions\/Echo\/tests\/selenium\/specs\/echo.js<\/code>--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran into a problem when running the echo.js test. The login should be username: admin and password: vagrant&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":1334,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[213],"tags":[],"class_list":["post-500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-outreachy"],"_links":{"self":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=500"}],"version-history":[{"count":10,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/500\/revisions"}],"predecessor-version":[{"id":1089,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/posts\/500\/revisions\/1089"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=\/wp\/v2\/media\/1334"}],"wp:attachment":[{"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkcolorful.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}