Page MenuHomePhabricator

Selenium tests are being skipped
Closed, ResolvedPublic

Description

Code in page.js is skipping more tests than it should? The code was introduced in 713682. It was needed for WikiLambda 713548.

		// Don't try to run wikitext-specific tests if the test namespace isn't wikitext by default.
		if ( await Util.isTargetNotWikitext( name ) ) {
			this.skip();
		}

Master branch: 11 skipped, 3 passing. Full output: P40808.

/tests/selenium/specs/page.js
9 skipped

/tests/selenium/specs/recentchanges.js
1 skipped

/tests/selenium/specs/user.js
2 passing

/tests/selenium/specs/watchlist.js
1 skipped

/tests/selenium/wdio-mediawiki/specs/BlankPage.js
1 passing

860029: 0 skipped, 14 passing. Full output: P40811.

/tests/selenium/specs/page.js
9 passing

/tests/selenium/specs/recentchanges.js
1 passing

/tests/selenium/specs/user.js
2 passing

/tests/selenium/specs/watchlist.js
1 passing

/tests/selenium/wdio-mediawiki/specs/BlankPage.js
1 passing

Event Timeline

Change 772879 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] WIP selenium: Debugging setup

https://gerrit.wikimedia.org/r/772879

Output with @wdio/dot-reporter. Not super helpful. Doesn't say much.

1~/Documents/gerrit/mediawiki/core$ npm run selenium-test
2
3> selenium-test
4> wdio ./tests/selenium/wdio.conf.js
5
6Execution of 5 workers started at 2022-03-22T16:37:02.776Z
7
8[0-0] RUNNING in chrome - /tests/selenium/specs/page.js
9[0-0] PASSED in chrome - /tests/selenium/specs/page.js
10[0-1] RUNNING in chrome - /tests/selenium/specs/recentchanges.js
11[0-1] PASSED in chrome - /tests/selenium/specs/recentchanges.js
12[0-2] RUNNING in chrome - /tests/selenium/specs/user.js
13[0-2] PASSED in chrome - /tests/selenium/specs/user.js
14[0-3] RUNNING in chrome - /tests/selenium/specs/watchlist.js
15[0-3] PASSED in chrome - /tests/selenium/specs/watchlist.js
16[0-4] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
17[0-4] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
18
19 "dot" Reporter:
20..............
21
22Spec Files: 5 passed, 5 total (100% completed) in 00:00:54

Output with @wdio/spec-reporter. Much more verbose but much more useful.

1~/Documents/gerrit/mediawiki/core$ npm run selenium-test
2
3> selenium-test
4> wdio ./tests/selenium/wdio.conf.js
5
6Execution of 5 workers started at 2022-03-22T16:45:16.385Z
7
8[0-0] RUNNING in chrome - /tests/selenium/specs/page.js
9[0-0] PASSED in chrome - /tests/selenium/specs/page.js
10[0-1] RUNNING in chrome - /tests/selenium/specs/recentchanges.js
11[0-1] PASSED in chrome - /tests/selenium/specs/recentchanges.js
12[0-2] RUNNING in chrome - /tests/selenium/specs/user.js
13[0-2] PASSED in chrome - /tests/selenium/specs/user.js
14[0-3] RUNNING in chrome - /tests/selenium/specs/watchlist.js
15[0-3] PASSED in chrome - /tests/selenium/specs/watchlist.js
16[0-4] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
17[0-4] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
18
19 "spec" Reporter:
20------------------------------------------------------------------
21[Chrome 99.0.4844.83 darwin #0-0] Running: Chrome (v99.0.4844.83) on darwin
22[Chrome 99.0.4844.83 darwin #0-0] Session ID: 5b441791-dca8-4bbb-b82d-7e3713ba58c9
23[Chrome 99.0.4844.83 darwin #0-0]
24[Chrome 99.0.4844.83 darwin #0-0] » /tests/selenium/specs/page.js
25[Chrome 99.0.4844.83 darwin #0-0] Page
26[Chrome 99.0.4844.83 darwin #0-0] ? should be previewable
27[Chrome 99.0.4844.83 darwin #0-0] - should be previewable
28[Chrome 99.0.4844.83 darwin #0-0] ? should be creatable
29[Chrome 99.0.4844.83 darwin #0-0] - should be creatable
30[Chrome 99.0.4844.83 darwin #0-0] ? should be re-creatable
31[Chrome 99.0.4844.83 darwin #0-0] - should be re-creatable
32[Chrome 99.0.4844.83 darwin #0-0] ? should be editable @daily
33[Chrome 99.0.4844.83 darwin #0-0] - should be editable @daily
34[Chrome 99.0.4844.83 darwin #0-0] ? should have history @daily
35[Chrome 99.0.4844.83 darwin #0-0] - should have history @daily
36[Chrome 99.0.4844.83 darwin #0-0] ? should be deletable
37[Chrome 99.0.4844.83 darwin #0-0] - should be deletable
38[Chrome 99.0.4844.83 darwin #0-0] ? should be restorable
39[Chrome 99.0.4844.83 darwin #0-0] - should be restorable
40[Chrome 99.0.4844.83 darwin #0-0] ? should be protectable
41[Chrome 99.0.4844.83 darwin #0-0] - should be protectable
42[Chrome 99.0.4844.83 darwin #0-0] - should be undoable
43[Chrome 99.0.4844.83 darwin #0-0]
44[Chrome 99.0.4844.83 darwin #0-0] 9 skipped (1.4s)
45------------------------------------------------------------------
46[Chrome 99.0.4844.83 darwin #0-1] Running: Chrome (v99.0.4844.83) on darwin
47[Chrome 99.0.4844.83 darwin #0-1] Session ID: bf38cf84-f29f-4de6-bf6e-83736626d229
48[Chrome 99.0.4844.83 darwin #0-1]
49[Chrome 99.0.4844.83 darwin #0-1] » /tests/selenium/specs/recentchanges.js
50[Chrome 99.0.4844.83 darwin #0-1] Special:RecentChanges
51[Chrome 99.0.4844.83 darwin #0-1] ? shows page creation
52[Chrome 99.0.4844.83 darwin #0-1] - shows page creation
53[Chrome 99.0.4844.83 darwin #0-1]
54[Chrome 99.0.4844.83 darwin #0-1] 1 skipped (1.4s)
55------------------------------------------------------------------
56[Chrome 99.0.4844.83 darwin #0-2] Running: Chrome (v99.0.4844.83) on darwin
57[Chrome 99.0.4844.83 darwin #0-2] Session ID: a692643b-0b55-4d84-91db-849380031f32
58[Chrome 99.0.4844.83 darwin #0-2]
59[Chrome 99.0.4844.83 darwin #0-2] » /tests/selenium/specs/user.js
60[Chrome 99.0.4844.83 darwin #0-2] User
61[Chrome 99.0.4844.83 darwin #0-2] ✓ should be able to create account
62[Chrome 99.0.4844.83 darwin #0-2] ✓ should be able to log in @daily
63[Chrome 99.0.4844.83 darwin #0-2]
64[Chrome 99.0.4844.83 darwin #0-2] 2 passing (11.3s)
65------------------------------------------------------------------
66[Chrome 99.0.4844.83 darwin #0-3] Running: Chrome (v99.0.4844.83) on darwin
67[Chrome 99.0.4844.83 darwin #0-3] Session ID: fd021e49-412b-43d9-96b5-b53d6a9822b8
68[Chrome 99.0.4844.83 darwin #0-3]
69[Chrome 99.0.4844.83 darwin #0-3] » /tests/selenium/specs/watchlist.js
70[Chrome 99.0.4844.83 darwin #0-3] Special:Watchlist
71[Chrome 99.0.4844.83 darwin #0-3] ? should show page with new edit
72[Chrome 99.0.4844.83 darwin #0-3] - should show page with new edit
73[Chrome 99.0.4844.83 darwin #0-3]
74[Chrome 99.0.4844.83 darwin #0-3] 1 skipped (2.9s)
75------------------------------------------------------------------
76[Chrome 99.0.4844.83 darwin #0-4] Running: Chrome (v99.0.4844.83) on darwin
77[Chrome 99.0.4844.83 darwin #0-4] Session ID: b36c8b98-a4bf-4fda-a205-6fe4d1f68432
78[Chrome 99.0.4844.83 darwin #0-4]
79[Chrome 99.0.4844.83 darwin #0-4] » /tests/selenium/wdio-mediawiki/specs/BlankPage.js
80[Chrome 99.0.4844.83 darwin #0-4] BlankPage
81[Chrome 99.0.4844.83 darwin #0-4] ✓ should have its title @daily
82[Chrome 99.0.4844.83 darwin #0-4]
83[Chrome 99.0.4844.83 darwin #0-4] 1 passing (2.2s)
84
85Spec Files: 5 passed, 5 total (100% completed) in 00:00:32

Uh oh. Looks like a lot of tests are skipped in CI and nobody noticed. See 142198. :/

1> selenium-test
2> wdio ./tests/selenium/wdio.conf.js
3
4
5Execution of 5 workers started at 2022-03-22T16:46:12.785Z
6
7[0-0] RUNNING in chrome - /tests/selenium/specs/page.js
8[0-0] PASSED in chrome - /tests/selenium/specs/page.js
9[0-1] RUNNING in chrome - /tests/selenium/specs/recentchanges.js
10[0-1] PASSED in chrome - /tests/selenium/specs/recentchanges.js
11[0-2] RUNNING in chrome - /tests/selenium/specs/user.js
12[0-2] PASSED in chrome - /tests/selenium/specs/user.js
13[0-3] RUNNING in chrome - /tests/selenium/specs/watchlist.js
14[0-3] PASSED in chrome - /tests/selenium/specs/watchlist.js
15[0-4] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
16[0-4] PASSED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
17
18 "spec" Reporter:
19------------------------------------------------------------------
20[Chrome 90.0.4430.212 linux #0-0] Running: Chrome (v90.0.4430.212) on linux
21[Chrome 90.0.4430.212 linux #0-0] Session ID: ff2bfd1e-850d-4c66-8826-b2f18c282744
22[Chrome 90.0.4430.212 linux #0-0]
23[Chrome 90.0.4430.212 linux #0-0] » /tests/selenium/specs/page.js
24[Chrome 90.0.4430.212 linux #0-0] Page
25[Chrome 90.0.4430.212 linux #0-0] ? should be previewable
26[Chrome 90.0.4430.212 linux #0-0] - should be previewable
27[Chrome 90.0.4430.212 linux #0-0] ? should be creatable
28[Chrome 90.0.4430.212 linux #0-0] - should be creatable
29[Chrome 90.0.4430.212 linux #0-0] ? should be re-creatable
30[Chrome 90.0.4430.212 linux #0-0] - should be re-creatable
31[Chrome 90.0.4430.212 linux #0-0] ? should be editable @daily
32[Chrome 90.0.4430.212 linux #0-0] - should be editable @daily
33[Chrome 90.0.4430.212 linux #0-0] ? should have history @daily
34[Chrome 90.0.4430.212 linux #0-0] - should have history @daily
35[Chrome 90.0.4430.212 linux #0-0] ? should be deletable
36[Chrome 90.0.4430.212 linux #0-0] - should be deletable
37[Chrome 90.0.4430.212 linux #0-0] ? should be restorable
38[Chrome 90.0.4430.212 linux #0-0] - should be restorable
39[Chrome 90.0.4430.212 linux #0-0] ? should be protectable
40[Chrome 90.0.4430.212 linux #0-0] - should be protectable
41[Chrome 90.0.4430.212 linux #0-0] - should be undoable
42[Chrome 90.0.4430.212 linux #0-0]
43[Chrome 90.0.4430.212 linux #0-0] 9 skipped (5.5s)
44------------------------------------------------------------------
45[Chrome 90.0.4430.212 linux #0-1] Running: Chrome (v90.0.4430.212) on linux
46[Chrome 90.0.4430.212 linux #0-1] Session ID: 1091d40a-8146-43e3-ad31-6945d7ccae00
47[Chrome 90.0.4430.212 linux #0-1]
48[Chrome 90.0.4430.212 linux #0-1] » /tests/selenium/specs/recentchanges.js
49[Chrome 90.0.4430.212 linux #0-1] Special:RecentChanges
50[Chrome 90.0.4430.212 linux #0-1] ? shows page creation
51[Chrome 90.0.4430.212 linux #0-1] - shows page creation
52[Chrome 90.0.4430.212 linux #0-1]
53[Chrome 90.0.4430.212 linux #0-1] 1 skipped (654ms)
54------------------------------------------------------------------
55[Chrome 90.0.4430.212 linux #0-2] Running: Chrome (v90.0.4430.212) on linux
56[Chrome 90.0.4430.212 linux #0-2] Session ID: 83a117c4-5981-4140-96f7-3e2a3cac303d
57[Chrome 90.0.4430.212 linux #0-2]
58[Chrome 90.0.4430.212 linux #0-2] » /tests/selenium/specs/user.js
59[Chrome 90.0.4430.212 linux #0-2] User
60[Chrome 90.0.4430.212 linux #0-2] ✓ should be able to create account
61[Chrome 90.0.4430.212 linux #0-2] ✓ should be able to log in @daily
62[Chrome 90.0.4430.212 linux #0-2]
63[Chrome 90.0.4430.212 linux #0-2] 2 passing (7.9s)
64------------------------------------------------------------------
65[Chrome 90.0.4430.212 linux #0-3] Running: Chrome (v90.0.4430.212) on linux
66[Chrome 90.0.4430.212 linux #0-3] Session ID: eb4f1154-109b-448b-b35e-4a1da5b2a64e
67[Chrome 90.0.4430.212 linux #0-3]
68[Chrome 90.0.4430.212 linux #0-3] » /tests/selenium/specs/watchlist.js
69[Chrome 90.0.4430.212 linux #0-3] Special:Watchlist
70[Chrome 90.0.4430.212 linux #0-3] ? should show page with new edit
71[Chrome 90.0.4430.212 linux #0-3] - should show page with new edit
72[Chrome 90.0.4430.212 linux #0-3]
73[Chrome 90.0.4430.212 linux #0-3] 1 skipped (1.3s)
74------------------------------------------------------------------
75[Chrome 90.0.4430.212 linux #0-4] Running: Chrome (v90.0.4430.212) on linux
76[Chrome 90.0.4430.212 linux #0-4] Session ID: c152bd0b-4ab0-443d-96b0-0f098f4892cd
77[Chrome 90.0.4430.212 linux #0-4]
78[Chrome 90.0.4430.212 linux #0-4] » /tests/selenium/wdio-mediawiki/specs/BlankPage.js
79[Chrome 90.0.4430.212 linux #0-4] BlankPage
80[Chrome 90.0.4430.212 linux #0-4] ✓ should have its title @daily
81[Chrome 90.0.4430.212 linux #0-4]
82[Chrome 90.0.4430.212 linux #0-4] 1 passing (773ms)
83
84
85Spec Files: 5 passed, 5 total (100% completed) in 00:00:24

zeljkofilipin raised the priority of this task from Medium to High.Mar 23 2022, 12:44 PM

One thing that I think can be fixed is https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/tests/selenium/wdio-mediawiki/Util.js#51 - that runs a async method so it should await for the return. Make that function (isTargetNotWikitext) async and await this.getMWApiResponse(....)

Change 773471 had a related patch set uploaded (by Phedenskog; author: Phedenskog):

[mediawiki/core@master] Fix async/await missmatch for isTargetNotWikitext.

https://gerrit.wikimedia.org/r/773471

Change 773589 had a related patch set uploaded (by Zfilipin; author: Jforrester):

[mediawiki/core@master] wdio-mediawiki: Extend isTargetNotWikitext() to cope with queries for existing pages too

https://gerrit.wikimedia.org/r/773589

zeljkofilipin moved this task from Deep work 🌊 to Q4 👔 on the User-zeljkofilipin board.
zeljkofilipin subscribed.

Change 772879 abandoned by Zfilipin:

[mediawiki/core@master] WIP selenium: Debugging setup

Reason:

https://gerrit.wikimedia.org/r/772879

zeljkofilipin changed the task status from Open to In Progress.Nov 23 2022, 5:29 PM
zeljkofilipin claimed this task.
zeljkofilipin moved this task from Q4 👔 to Deep work 🌊 on the User-zeljkofilipin board.

Change 860029 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] WIP Revert "Selenium tests: Skip wikitext-specific tests if NS isn't wikitext"

https://gerrit.wikimedia.org/r/860029

Change 860565 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] selenium: Delete PreferencesPage

https://gerrit.wikimedia.org/r/860565

Change 860606 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] selenium: Delete automationProtocol setting

https://gerrit.wikimedia.org/r/860606

Change 860869 had a related patch set uploaded (by Zfilipin; author: Zfilipin):

[mediawiki/core@master] selenium: Fix failing tests

https://gerrit.wikimedia.org/r/860869

zeljkofilipin renamed this task from Investigate why Selenium tests are being skipped and get delete page tests running on Beta to Selenium tests are being skipped.Nov 25 2022, 1:12 PM

Change 860565 merged by jenkins-bot:

[mediawiki/core@master] selenium: Delete PreferencesPage

https://gerrit.wikimedia.org/r/860565

Change 860869 merged by jenkins-bot:

[mediawiki/core@master] selenium: Fix failing tests

https://gerrit.wikimedia.org/r/860869

Change 860029 merged by jenkins-bot:

[mediawiki/core@master] Revert "Selenium tests: Skip wikitext-specific tests if NS isn't wikitext"

https://gerrit.wikimedia.org/r/860029

Change 860606 merged by jenkins-bot:

[mediawiki/core@master] selenium: Delete automationProtocol setting

https://gerrit.wikimedia.org/r/860606

Change 959812 had a related patch set uploaded (by WMDE-Fisch; author: WMDE-Fisch):

[mediawiki/core@master] wdio-mediawiki: Release 2.3.0

https://gerrit.wikimedia.org/r/959812

Change 959812 merged by jenkins-bot:

[mediawiki/core@master] wdio-mediawiki: Release 2.3.0

https://gerrit.wikimedia.org/r/959812

Change 773471 abandoned by Phedenskog:

[mediawiki/core@master] Fix async/await missmatch for isTargetNotWikitext.

Reason:

When we updated to v8 lets go through all missing awaits

https://gerrit.wikimedia.org/r/773471