While working on T289853: Wikibase Selenium tests fail when targeting wiki created by MediaWiki-Docker I've decided to try my luck with WikibaseLexeme too. To my big surprise, most of the tests are passing! Only 1 test is failing.
For setup, I've followed MediaWiki-Docker/Extension/WikibaseLexeme.
nobody@docker-desktop:/WikibaseLexeme$ npm run selenium-test (...) [0-14] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js [0-14] AssertionError [ERR_ASSERTION] in "Special:RecentChanges shows lemmas in title links to lexemes on Special:RecentChanges" AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: assert( title.includes( 'entrôpi' ) ) at Context.it (/WikibaseLexeme/tests/selenium/specs/special/recentchanges.js:33:3) [0-14] FAILED in chrome - /tests/selenium/specs/special/recentchanges.js (...) ...............................................F. Spec Files: 15 passed, 1 failed, 16 total (100% completed) in 00:15:21 (...)
As far as I can tell, the assertion looking for entrôpi failed. I'm not sure what went wrong, but I can see the text on the page.
Terminal output:
1 | ~/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme$ export MW_SERVER=http://localhost:8080 |
---|---|
2 | export MW_SCRIPT_PATH=/w |
3 | export MEDIAWIKI_USER=Admin |
4 | export MEDIAWIKI_PASSWORD=dockerpass |
5 | |
6 | |
7 | |
8 | ~/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme$ fresh-node -env -net |
9 | # fresh: 21.04.1 (2021-04-29) |
10 | # image: docker-registry.wikimedia.org/releng/node10-test-browser:0.6.3-s2 |
11 | # software: Debian GNU/Linux 9 (stretch) |
12 | # Node.js v10.15.2 (npm 6.14.5) |
13 | # Chromium 73.0.3683.75 |
14 | # Mozilla Firefox 68.12.0esr |
15 | # JSDuck 5.3.4 (Ruby 2.3.3) |
16 | # mount: /WikibaseLexeme ➟ /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme (read-write) |
17 | # /WikibaseLexeme/.git ➟ /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme/.git (read-only) |
18 | # env: MW_*, MEDIAWIKI_* |
19 | # net: expose host |
20 | |
21 | 🌱 Fresh! |
22 | |
23 | |
24 | |
25 | nobody@docker-desktop:/WikibaseLexeme$ npm ci |
26 | |
27 | > core-js@2.6.12 postinstall /WikibaseLexeme/node_modules/core-js |
28 | > node -e "try{require('./postinstall')}catch(e){}" |
29 | |
30 | Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library! |
31 | |
32 | The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: |
33 | > https://opencollective.com/core-js |
34 | > https://www.patreon.com/zloirock |
35 | |
36 | Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -) |
37 | |
38 | |
39 | > core-js@3.10.1 postinstall /WikibaseLexeme/node_modules/eslint-plugin-compat/node_modules/core-js |
40 | > node -e "try{require('./postinstall')}catch(e){}" |
41 | |
42 | |
43 | > fibers@4.0.3 install /WikibaseLexeme/node_modules/fibers |
44 | > node build.js || nodejs build.js |
45 | |
46 | `linux-x64-64-glibc` exists; testing |
47 | Binary is fine; exiting |
48 | added 995 packages in 173.442s |
49 | |
50 | |
51 | |
52 | nobody@docker-desktop:/WikibaseLexeme$ npm run selenium-test |
53 | |
54 | > @ selenium-test /WikibaseLexeme |
55 | > wdio tests/selenium/wdio.conf.js |
56 | |
57 | 2021-09-23T10:05:57.529Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
58 | |
59 | Execution of 16 spec files started at 2021-09-23T10:06:01.301Z |
60 | |
61 | (node:66) ExperimentalWarning: The dns.promises API is experimental |
62 | (node:66) ExperimentalWarning: The fs.promises API is experimental |
63 | [0-0] (node:75) ExperimentalWarning: The dns.promises API is experimental |
64 | [0-0] (node:75) ExperimentalWarning: The fs.promises API is experimental |
65 | [0-0] RUNNING in chrome - /tests/selenium/specs/form.add.js |
66 | [0-0] PASSED in chrome - /tests/selenium/specs/form.add.js |
67 | [0-1] (node:155) ExperimentalWarning: The dns.promises API is experimental |
68 | [0-1] (node:155) ExperimentalWarning: The fs.promises API is experimental |
69 | [0-1] RUNNING in chrome - /tests/selenium/specs/form.edit.js |
70 | [0-1] PASSED in chrome - /tests/selenium/specs/form.edit.js |
71 | [0-2] (node:241) ExperimentalWarning: The dns.promises API is experimental |
72 | [0-2] (node:241) ExperimentalWarning: The fs.promises API is experimental |
73 | [0-2] RUNNING in chrome - /tests/selenium/specs/form.remove.js |
74 | [0-2] PASSED in chrome - /tests/selenium/specs/form.remove.js |
75 | [0-3] (node:322) ExperimentalWarning: The dns.promises API is experimental |
76 | [0-3] (node:322) ExperimentalWarning: The fs.promises API is experimental |
77 | [0-3] RUNNING in chrome - /tests/selenium/specs/form.section.js |
78 | [0-3] PASSED in chrome - /tests/selenium/specs/form.section.js |
79 | [0-4] (node:405) ExperimentalWarning: The dns.promises API is experimental |
80 | [0-4] (node:405) ExperimentalWarning: The fs.promises API is experimental |
81 | [0-4] RUNNING in chrome - /tests/selenium/specs/header.edit.js |
82 | [0-4] PASSED in chrome - /tests/selenium/specs/header.edit.js |
83 | [0-5] (node:486) ExperimentalWarning: The dns.promises API is experimental |
84 | [0-5] (node:486) ExperimentalWarning: The fs.promises API is experimental |
85 | [0-5] RUNNING in chrome - /tests/selenium/specs/header.js |
86 | [0-5] PASSED in chrome - /tests/selenium/specs/header.js |
87 | [0-6] (node:567) ExperimentalWarning: The dns.promises API is experimental |
88 | [0-6] (node:567) ExperimentalWarning: The fs.promises API is experimental |
89 | [0-6] RUNNING in chrome - /tests/selenium/specs/helloworld.js |
90 | [0-6] PASSED in chrome - /tests/selenium/specs/helloworld.js |
91 | [0-7] (node:648) ExperimentalWarning: The dns.promises API is experimental |
92 | [0-7] (node:648) ExperimentalWarning: The fs.promises API is experimental |
93 | [0-7] RUNNING in chrome - /tests/selenium/specs/lemma.edit.js |
94 | [0-7] PASSED in chrome - /tests/selenium/specs/lemma.edit.js |
95 | [0-8] (node:726) ExperimentalWarning: The dns.promises API is experimental |
96 | [0-8] (node:726) ExperimentalWarning: The fs.promises API is experimental |
97 | [0-8] RUNNING in chrome - /tests/selenium/specs/nonexistinglexeme.js |
98 | [0-8] PASSED in chrome - /tests/selenium/specs/nonexistinglexeme.js |
99 | [0-9] (node:807) ExperimentalWarning: The dns.promises API is experimental |
100 | [0-9] (node:807) ExperimentalWarning: The fs.promises API is experimental |
101 | [0-9] RUNNING in chrome - /tests/selenium/specs/sense.edit.js |
102 | [0-9] PASSED in chrome - /tests/selenium/specs/sense.edit.js |
103 | [0-10] (node:889) ExperimentalWarning: The dns.promises API is experimental |
104 | [0-10] (node:889) ExperimentalWarning: The fs.promises API is experimental |
105 | [0-10] RUNNING in chrome - /tests/selenium/specs/sense.js |
106 | [0-10] PASSED in chrome - /tests/selenium/specs/sense.js |
107 | [0-11] (node:970) ExperimentalWarning: The dns.promises API is experimental |
108 | [0-11] (node:970) ExperimentalWarning: The fs.promises API is experimental |
109 | [0-11] RUNNING in chrome - /tests/selenium/specs/statement.add.js |
110 | [0-11] PASSED in chrome - /tests/selenium/specs/statement.add.js |
111 | [0-12] (node:1051) ExperimentalWarning: The dns.promises API is experimental |
112 | [0-12] (node:1051) ExperimentalWarning: The fs.promises API is experimental |
113 | [0-12] RUNNING in chrome - /tests/selenium/specs/special/merge.js |
114 | [0-12] PASSED in chrome - /tests/selenium/specs/special/merge.js |
115 | [0-13] (node:1132) ExperimentalWarning: The dns.promises API is experimental |
116 | [0-13] (node:1132) ExperimentalWarning: The fs.promises API is experimental |
117 | [0-13] RUNNING in chrome - /tests/selenium/specs/special/new.js |
118 | [0-13] PASSED in chrome - /tests/selenium/specs/special/new.js |
119 | [0-14] (node:1211) ExperimentalWarning: The dns.promises API is experimental |
120 | [0-14] (node:1211) ExperimentalWarning: The fs.promises API is experimental |
121 | [0-14] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
122 | [0-14] AssertionError [ERR_ASSERTION] in "Special:RecentChanges shows lemmas in title links to lexemes on Special:RecentChanges" |
123 | AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: |
124 | |
125 | assert( title.includes( 'entrôpi' ) ) |
126 | |
127 | at Context.it (/WikibaseLexeme/tests/selenium/specs/special/recentchanges.js:33:3) |
128 | [0-14] FAILED in chrome - /tests/selenium/specs/special/recentchanges.js |
129 | [0-15] (node:1293) ExperimentalWarning: The dns.promises API is experimental |
130 | [0-15] (node:1293) ExperimentalWarning: The fs.promises API is experimental |
131 | [0-15] RUNNING in chrome - /tests/selenium/specs/special/watchlist.js |
132 | [0-15] PASSED in chrome - /tests/selenium/specs/special/watchlist.js |
133 | |
134 | "dot" Reporter: |
135 | ...............................................F. |
136 | |
137 | Spec Files: 15 passed, 1 failed, 16 total (100% completed) in 00:15:21 |
138 | |
139 | npm ERR! code ELIFECYCLE |
140 | npm ERR! errno 1 |
141 | npm ERR! @ selenium-test: `wdio tests/selenium/wdio.conf.js` |
142 | npm ERR! Exit status 1 |
143 | npm ERR! |
144 | npm ERR! Failed at the @ selenium-test script. |
145 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above. |
146 | |
147 | npm ERR! A complete log of this run can be found in: |
148 | npm ERR! /cache/_logs/2021-09-23T10_21_22_849Z-debug.log |
Tests pass in CI (for example, build #76993) The only thing that I can see different is that entrôpi is at the top of the list in CI.
After some debugging, looks like that's causing the test to fail.
const title = RecentChangesPage.titles[ 0 ].getText(); returns text for the first item on the page, and entrôpi/entropy/ентропы is very frequently (but not always) the second element on the page.
I ran the failing tests 10 times, and it failed 1 time, passed 9 times. I'm not sure how this tests is not more unstable in CI or the daily job.
Terminal output:
1 | ~/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme$ for i in $(seq 1 10); do npm run selenium-test -- --spec tests/selenium/specs/special/recentchanges.js; done |
---|---|
2 | |
3 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
4 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
5 | |
6 | 2021-09-23T12:11:19.434Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
7 | |
8 | Execution of 1 spec files started at 2021-09-23T12:11:19.680Z |
9 | |
10 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
11 | [0-0] AssertionError [ERR_ASSERTION] in "Special:RecentChanges shows lemmas in title links to lexemes on Special:RecentChanges" |
12 | AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: |
13 | |
14 | assert( title.includes( 'entrôpi' ) ) |
15 | |
16 | at Context.it (/Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme/tests/selenium/specs/special/recentchanges.js:33:3) |
17 | [0-0] FAILED in chrome - /tests/selenium/specs/special/recentchanges.js |
18 | |
19 | "dot" Reporter: |
20 | F |
21 | |
22 | Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:20 |
23 | |
24 | npm ERR! code ELIFECYCLE |
25 | npm ERR! errno 1 |
26 | npm ERR! @ selenium-test: `wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js"` |
27 | npm ERR! Exit status 1 |
28 | npm ERR! |
29 | npm ERR! Failed at the @ selenium-test script. |
30 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above. |
31 | |
32 | npm ERR! A complete log of this run can be found in: |
33 | npm ERR! /Users/z/.npm/_logs/2021-09-23T12_11_40_360Z-debug.log |
34 | |
35 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
36 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
37 | |
38 | 2021-09-23T12:11:43.275Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
39 | |
40 | Execution of 1 spec files started at 2021-09-23T12:11:43.757Z |
41 | |
42 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
43 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
44 | |
45 | "dot" Reporter: |
46 | . |
47 | |
48 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:22 |
49 | |
50 | |
51 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
52 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
53 | |
54 | 2021-09-23T12:12:09.319Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
55 | |
56 | Execution of 1 spec files started at 2021-09-23T12:12:09.811Z |
57 | |
58 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
59 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
60 | |
61 | "dot" Reporter: |
62 | . |
63 | |
64 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:27 |
65 | |
66 | |
67 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
68 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
69 | |
70 | 2021-09-23T12:12:40.210Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
71 | |
72 | Execution of 1 spec files started at 2021-09-23T12:12:41.006Z |
73 | |
74 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
75 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
76 | |
77 | "dot" Reporter: |
78 | . |
79 | |
80 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:29 |
81 | |
82 | |
83 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
84 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
85 | |
86 | 2021-09-23T12:13:13.743Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
87 | |
88 | Execution of 1 spec files started at 2021-09-23T12:13:14.263Z |
89 | |
90 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
91 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
92 | |
93 | "dot" Reporter: |
94 | . |
95 | |
96 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:21 |
97 | |
98 | |
99 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
100 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
101 | |
102 | 2021-09-23T12:13:37.418Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
103 | |
104 | Execution of 1 spec files started at 2021-09-23T12:13:37.903Z |
105 | |
106 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
107 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
108 | |
109 | "dot" Reporter: |
110 | . |
111 | |
112 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:22 |
113 | |
114 | |
115 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
116 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
117 | |
118 | 2021-09-23T12:14:01.642Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
119 | |
120 | Execution of 1 spec files started at 2021-09-23T12:14:01.886Z |
121 | |
122 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
123 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
124 | |
125 | "dot" Reporter: |
126 | . |
127 | |
128 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:21 |
129 | |
130 | |
131 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
132 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
133 | |
134 | 2021-09-23T12:14:26.370Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
135 | |
136 | Execution of 1 spec files started at 2021-09-23T12:14:26.769Z |
137 | |
138 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
139 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
140 | |
141 | "dot" Reporter: |
142 | . |
143 | |
144 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:24 |
145 | |
146 | |
147 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
148 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
149 | |
150 | 2021-09-23T12:14:53.985Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
151 | |
152 | Execution of 1 spec files started at 2021-09-23T12:14:54.383Z |
153 | |
154 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
155 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
156 | |
157 | "dot" Reporter: |
158 | . |
159 | |
160 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:22 |
161 | |
162 | |
163 | > @ selenium-test /Users/z/Documents/gerrit/mediawiki/core/extensions/WikibaseLexeme |
164 | > wdio tests/selenium/wdio.conf.js "--spec" "tests/selenium/specs/special/recentchanges.js" |
165 | |
166 | 2021-09-23T12:15:18.766Z DEBUG @wdio/config:utils: Couldn't find ts-node package, no TypeScript compiling |
167 | |
168 | Execution of 1 spec files started at 2021-09-23T12:15:18.999Z |
169 | |
170 | [0-0] RUNNING in chrome - /tests/selenium/specs/special/recentchanges.js |
171 | [0-0] PASSED in chrome - /tests/selenium/specs/special/recentchanges.js |
172 | |
173 | "dot" Reporter: |
174 | . |
175 | |
176 | Spec Files: 1 passed, 1 total (100% completed) in 00:00:23 |