Page MenuHomePhabricator

Fix MediaWiki-Docker/Extension/ProofreadPage
Open, Needs TriagePublic

Description

This is a microtask for T256239: Create MediaWiki-Docker documentation for all repositories with Selenium tests. See that task for more information and how to get help.

  • If you are working on this task, assign it to yourself, so others know it's already taken.
  • Read the MediaWiki-Docker documentation for the repository: MediaWiki-Docker/Extension/ProofreadPage.
  • Set up the repository on your machine.
  • Run Selenium tests.
  • Read the repository documentation: Extension:ProofreadPage.
  • You might need to read repository source code: ProofreadPage.
  • You might need to contact developers of the repository. Developers/Maintainers lists which team is in charge of which repository.
  • Find what's missing from the MediaWiki-Docker documentation for the repository. Update the page. If the Selenium tests pass, you're done.
  • Selenium test output:

Event Timeline

@zeljkofilipin I've been working on ProofreadPage selenium tests, will be happy to answer questions on test and general ProofreadPage setup.

Wrt to P17185, currently the feature being tested via Selenium is behind the $wgProofreadPageEnableEditInSequence feature flag. Setting it to true should allow the tests to run locally.

We have some pretty adhoc/hacky code to modify the LocalSettings.php file at tests/selenium/wdio.conf.js in the CI/development environments, maybe it is not working as expected ?

Hi @Soda! I've tried adding the variable to LocalSettings.php (diff) but I'm getting the same results. Did I misunderstood what needs to be done?

zeljkofilipin changed the task status from Open to In Progress.Feb 22 2023, 12:34 PM
zeljkofilipin claimed this task.
zeljkofilipin triaged this task as Low priority.

Additionally, when I try to run the tests from a Fresh container, I get ERROR @wdio/config:ConfigParser: Failed loading configuration file: /ProofreadPage/tests/selenium/wdio.conf.js: ENOENT: no such file or directory, open '/LocalSettings.php'.

1z@imac-ubuntu:~/Documents/gerrit/mediawiki/core/extensions/ProofreadPage$ fresh-node14 -env -net
2# fresh: 22.11.1
3# image: docker-registry.wikimedia.org/releng/node14-test-browser:0.0.2-s4
4# software: Debian GNU/Linux 11 (bullseye)
5# Node.js v14.17.5 (npm 7.21.0)
6# Chromium 97.0.4692.99
7# Mozilla Firefox 91.5.0esr
8# JSDuck 5.3.4 (Ruby 2.7.4) ruby 2.7.4p191
9# mount: /ProofreadPage โžŸ /home/z/Documents/gerrit/mediawiki/core/extensions/ProofreadPage (read-write)
10# /ProofreadPage/.git โžŸ /home/z/Documents/gerrit/mediawiki/core/extensions/ProofreadPage/.git (read-only)
11# env: MW_*, MEDIAWIKI_*
12# net: expose host
13
14๐ŸŒฑ Fresh!
15
16
17
18I have no name!@imac-ubuntu:/ProofreadPage$ npm run selenium-test
19
20> selenium-test
21> wdio tests/selenium/wdio.conf.js
22
232023-02-22T12:25:59.207Z ERROR @wdio/config:ConfigParser: Failed loading configuration file: /ProofreadPage/tests/selenium/wdio.conf.js: ENOENT: no such file or directory, open '/LocalSettings.php'
24wdio [command]
25
26The `wdio` command allows you run and manage your WebdriverIO test suite.
27If no command is provided it calls the `run` command by default, so:
28
29$ wdio wdio.conf.js
30
31is the same as:
32$ wdio run wdio.conf.js
33
34For more information, visit: https://webdriver.io/docs/clioptions
35
36Commands:
37 wdio config Initialize WebdriverIO and setup
38 configuration in your current project.
39 wdio install <type> <name> Add a `reporter`, `service`, or `framework`
40 to your WebdriverIO project. The command
41 installs the package from NPM, adds it to
42 your package.json and modifies the
43 wdio.conf.js accordingly.
44 wdio repl <option> [capabilities] Run WebDriver session in command line
45 wdio run <configPath> Run your WDIO configuration file to
46 initialize your tests. (default)
47
48Options:
49 --help Show help [boolean]
50 --version Show version number [boolean]
51 --watch Run WebdriverIO in watch mode [boolean]
52 -h, --hostname automation driver host address [string]
53 -p, --port automation driver port [number]
54 --path path to WebDriver endpoints (default "/") [string]
55 -u, --user username if using a cloud service as automation backend
56 [string]
57 -k, --key corresponding access key to the user [string]
58 -l, --logLevel level of logging verbosity
59 [choices: "trace", "debug", "info", "warn", "error", "silent"]
60 --bail stop test runner after specific amount of tests have
61 failed [number]
62 --baseUrl shorten url command calls by setting a base url[string]
63 -w, --waitforTimeout timeout for all waitForXXX commands [number]
64 -f, --framework defines the framework (Mocha, Jasmine or Cucumber) to
65 run the specs [string]
66 -r, --reporters reporters to print out the results on stdout [array]
67 --suite overwrites the specs attribute and runs the defined
68 suite [array]
69 --spec run only a certain spec file - overrides specs piped
70 from stdin [array]
71 --exclude exclude certain spec file from the test run - overrides
72 exclude piped from stdin [array]
73 --mochaOpts Mocha options
74 --jasmineOpts Jasmine options
75 --cucumberOpts Cucumber options
76 --autoCompileOpts Auto compilation options
77
78Examples:
79 wdio run wdio.conf.js --suite foobar Run suite on testsuite "foobar"
80 wdio run wdio.conf.js --spec Run suite on specific specs
81 ./tests/e2e/a.js --spec ./tests/e2e/b.js
82 wdio run wdio.conf.js --spec Run scenario by line number
83 ./tests/e2e/a.feature:5
84 wdio run wdio.conf.js --spec Run scenarios by line number
85 ./tests/e2e/a.feature:5:10
86 wdio run wdio.conf.js --spec Run scenarios by line number in
87 ./tests/e2e/a.feature:5:10 --spec single feature and another complete
88 ./test/e2e/b.feature feature
89 wdio install reporter spec Install @wdio/spec-reporter
90 wdio repl chrome -u <SAUCE_USERNAME> -k Run repl in Sauce Labs cloud
91 <SAUCE_ACCESS_KEY>
92
93Documentation: https://webdriver.io
94@wdio/cli (v7.3.0)
95
96Error: ENOENT: no such file or directory, open '/LocalSettings.php'
97 at Object.openSync (fs.js:498:3)
98 at Object.readFileSync (fs.js:394:35)
99 at Object.<anonymous> (/ProofreadPage/tests/selenium/wdio.conf.js:10:33)
100 at Module._compile (internal/modules/cjs/loader.js:1072:14)
101 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
102 at Module.load (internal/modules/cjs/loader.js:937:32)
103 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
104 at Module.require (internal/modules/cjs/loader.js:961:19)
105 at require (internal/modules/cjs/helpers.js:92:18)
106 at FileSystemPathService.loadFile (/ProofreadPage/node_modules/@wdio/config/build/lib/FileSystemPathService.js:22:16)
107exit

Hi @Soda! I've tried adding the variable to LocalSettings.php (diff) but I'm getting the same results. Did I misunderstood what needs to be done?

No, that is indeed how it is supposed to be setup.

Can you try looking through the steps from this guide and see if you have missed any steps ? (That guide is a list of steps/commands that I personally use to setup ProofreadPage)

Additionally, when I try to run the tests from a Fresh container, I get ERROR @wdio/config:ConfigParser: Failed loading configuration file: /ProofreadPage/tests/selenium/wdio.conf.js: ENOENT: no such file or directory, open '/LocalSettings.php'.

1z@imac-ubuntu:~/Documents/gerrit/mediawiki/core/extensions/ProofreadPage$ fresh-node14 -env -net
2# fresh: 22.11.1
3# image: docker-registry.wikimedia.org/releng/node14-test-browser:0.0.2-s4
4# software: Debian GNU/Linux 11 (bullseye)
5# Node.js v14.17.5 (npm 7.21.0)
6# Chromium 97.0.4692.99
7# Mozilla Firefox 91.5.0esr
8# JSDuck 5.3.4 (Ruby 2.7.4) ruby 2.7.4p191
9# mount: /ProofreadPage โžŸ /home/z/Documents/gerrit/mediawiki/core/extensions/ProofreadPage (read-write)
10# /ProofreadPage/.git โžŸ /home/z/Documents/gerrit/mediawiki/core/extensions/ProofreadPage/.git (read-only)
11# env: MW_*, MEDIAWIKI_*
12# net: expose host
13
14๐ŸŒฑ Fresh!
15
16
17
18I have no name!@imac-ubuntu:/ProofreadPage$ npm run selenium-test
19
20> selenium-test
21> wdio tests/selenium/wdio.conf.js
22
232023-02-22T12:25:59.207Z ERROR @wdio/config:ConfigParser: Failed loading configuration file: /ProofreadPage/tests/selenium/wdio.conf.js: ENOENT: no such file or directory, open '/LocalSettings.php'
24wdio [command]
25
26The `wdio` command allows you run and manage your WebdriverIO test suite.
27If no command is provided it calls the `run` command by default, so:
28
29$ wdio wdio.conf.js
30
31is the same as:
32$ wdio run wdio.conf.js
33
34For more information, visit: https://webdriver.io/docs/clioptions
35
36Commands:
37 wdio config Initialize WebdriverIO and setup
38 configuration in your current project.
39 wdio install <type> <name> Add a `reporter`, `service`, or `framework`
40 to your WebdriverIO project. The command
41 installs the package from NPM, adds it to
42 your package.json and modifies the
43 wdio.conf.js accordingly.
44 wdio repl <option> [capabilities] Run WebDriver session in command line
45 wdio run <configPath> Run your WDIO configuration file to
46 initialize your tests. (default)
47
48Options:
49 --help Show help [boolean]
50 --version Show version number [boolean]
51 --watch Run WebdriverIO in watch mode [boolean]
52 -h, --hostname automation driver host address [string]
53 -p, --port automation driver port [number]
54 --path path to WebDriver endpoints (default "/") [string]
55 -u, --user username if using a cloud service as automation backend
56 [string]
57 -k, --key corresponding access key to the user [string]
58 -l, --logLevel level of logging verbosity
59 [choices: "trace", "debug", "info", "warn", "error", "silent"]
60 --bail stop test runner after specific amount of tests have
61 failed [number]
62 --baseUrl shorten url command calls by setting a base url[string]
63 -w, --waitforTimeout timeout for all waitForXXX commands [number]
64 -f, --framework defines the framework (Mocha, Jasmine or Cucumber) to
65 run the specs [string]
66 -r, --reporters reporters to print out the results on stdout [array]
67 --suite overwrites the specs attribute and runs the defined
68 suite [array]
69 --spec run only a certain spec file - overrides specs piped
70 from stdin [array]
71 --exclude exclude certain spec file from the test run - overrides
72 exclude piped from stdin [array]
73 --mochaOpts Mocha options
74 --jasmineOpts Jasmine options
75 --cucumberOpts Cucumber options
76 --autoCompileOpts Auto compilation options
77
78Examples:
79 wdio run wdio.conf.js --suite foobar Run suite on testsuite "foobar"
80 wdio run wdio.conf.js --spec Run suite on specific specs
81 ./tests/e2e/a.js --spec ./tests/e2e/b.js
82 wdio run wdio.conf.js --spec Run scenario by line number
83 ./tests/e2e/a.feature:5
84 wdio run wdio.conf.js --spec Run scenarios by line number
85 ./tests/e2e/a.feature:5:10
86 wdio run wdio.conf.js --spec Run scenarios by line number in
87 ./tests/e2e/a.feature:5:10 --spec single feature and another complete
88 ./test/e2e/b.feature feature
89 wdio install reporter spec Install @wdio/spec-reporter
90 wdio repl chrome -u <SAUCE_USERNAME> -k Run repl in Sauce Labs cloud
91 <SAUCE_ACCESS_KEY>
92
93Documentation: https://webdriver.io
94@wdio/cli (v7.3.0)
95
96Error: ENOENT: no such file or directory, open '/LocalSettings.php'
97 at Object.openSync (fs.js:498:3)
98 at Object.readFileSync (fs.js:394:35)
99 at Object.<anonymous> (/ProofreadPage/tests/selenium/wdio.conf.js:10:33)
100 at Module._compile (internal/modules/cjs/loader.js:1072:14)
101 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
102 at Module.load (internal/modules/cjs/loader.js:937:32)
103 at Function.Module._load (internal/modules/cjs/loader.js:778:12)
104 at Module.require (internal/modules/cjs/loader.js:961:19)
105 at require (internal/modules/cjs/helpers.js:92:18)
106 at FileSystemPathService.loadFile (/ProofreadPage/node_modules/@wdio/config/build/lib/FileSystemPathService.js:22:16)
107exit

You need run fresh from the mediawiki/ directory and then cd into the extensions/ProofreadPage directory before running the selenium test commands. (it's a side-effect of our hack at tests/selenium/wdio.conf.js)

zeljkofilipin changed the task status from In Progress to Open.Mar 14 2023, 10:05 AM
zeljkofilipin removed zeljkofilipin as the assignee of this task.
zeljkofilipin raised the priority of this task from Low to Needs Triage.Oct 31 2023, 4:09 PM