Page MenuHomePhabricator

Cannot run wikidata-query-gui browser tests
Closed, ResolvedPublic8 Estimated Story Points

Description

As a developer, I want to be able to run the browser tests of the Wikidata Query UI, to make sure that they still work.

Problem:
Currently, @noarave and I are unable to run the browser tests, and I’m not aware of anyone else being able to run them, either. (Note that we already don’t run them in CI, see T222200.) According to this Gerrit comment, I was still able to run them in June 2020.

Note: @noarave was using docker at the time and Lucas was not

Example:

12:29:10.639 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358                                                                           
12:29:10.744 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444                                                             
2020-11-06 12:29:10.814:INFO::main: Logging initialized @400ms to org.seleniumhq.jetty9.util.log.StdErrLog                                                                   
                                                                                                                                                                             
Execution of 1 spec files started at 2020-11-06T11:29:11.019Z                                                                                                                
                                                                                                                                                                             
12:29:11.192 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet                                                                                                  
12:29:11.310 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444                                                                                     
Selenium started                                                                                                                                                             
[0-0] RUNNING in chrome - /tests/specs/embed_spec.js                                                                                                                         
[0-0] 2020-11-06T11:29:37.103Z ERROR @wdio/runner: Error: connect ECONNREFUSED 127.0.0.1:37695                                                                               
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)                                                                                                          
[0-0]  Error:  connect ECONNREFUSED 127.0.0.1:37695                                                                                                                          
[0-0] FAILED in chrome - /tests/specs/embed_spec.js                                                                                                                          
                                                                                                                                                                             
Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:26

I tried some combinations of git bisect and older Node versions but was unable to find any working state. (On many older Node versions, running the browser tests fails because the fs-extra npm package uses catch { syntax, which is a syntax error in those versions, so we never even get as far as starting the browser tests proper.)

Acceptance criteria:
[ x ] At least one developer on the Wikidata team is able to run the browser tests.

Event Timeline

I tried updating some browser test related packages but it didn’t help at all. (Pasting only the package.json diff for brevity, use npm install to update the lockfile too.)

diff --git a/package.json b/package.json
index 25da2f9..85f60fc 100644
--- a/package.json
+++ b/package.json
@@ -55,11 +55,11 @@
     "wellknown": "^0.5.0"
   },
   "devDependencies": {
-    "@wdio/cli": "^6.1.16",
-    "@wdio/dot-reporter": "^6.1.14",
-    "@wdio/local-runner": "^6.1.16",
-    "@wdio/mocha-framework": "^6.1.14",
-    "@wdio/spec-reporter": "^6.1.14",
+    "@wdio/cli": "^6.7.2",
+    "@wdio/dot-reporter": "^6.7.0",
+    "@wdio/local-runner": "^6.7.2",
+    "@wdio/mocha-framework": "^6.7.0",
+    "@wdio/spec-reporter": "^6.7.0",
     "grunt": "^1.0.4",
     "grunt-auto-install": "^0.3.1",
     "grunt-banana-checker": "^0.6.0",
@@ -83,10 +83,10 @@
     "karma-qunit": "^1.2.1",
     "load-grunt-tasks": "^3.5.2",
     "qunit": "^2.9.2",
-    "selenium-standalone": "^6.16.0",
+    "selenium-standalone": "^6.20.1",
     "sinon": "^4.4.2",
     "stylelint": "^13.3.3",
     "stylelint-config-wikimedia": "^0.10.1",
-    "webdriverio": "^6.1.16"
+    "webdriverio": "^6.7.2"
   }
 }
-    "selenium-standalone": "^6.16.0",
+    "selenium-standalone": "^6.20.1",

This package should not be needed at all. None of the other repositories have it.

Well, we use the package in the Gruntfile to launch the Selenium server automatically. (Probably not the only way in which the Selenium setup here differs from other repositories.)

Addshore updated the task description. (Show Details)
noarave claimed this task.
noarave updated the task description. (Show Details)

After testing this again, multiple devs were able to run the browser test without issues. Closing as this seems to be resolved.