Commit graph

359 commits

Author SHA1 Message Date
Željko Filipin
0d9b1e699a selenium: Fix 'Page should be editable'
The test was failing because a popup was added to the beta cluster.

Popup text:
Download a browser extension to get new features and help us improve Wikipedia

Bug: T270771
Change-Id: I6ba0026fcaa05610d4a310605f5ff6ae93705bc0
2024-10-08 15:06:39 +00:00
Željko Filipin
1746c9e623 selenium: Document when, how and why a test is skipped
Bug: T280652
Change-Id: I4a2803386d849ca9af995e643b573319a0f766f3
2024-10-02 12:00:39 +02:00
Željko Filipin
e5ce705de7 selenium: Replace Node.js Assert library with WebdriverIO Expect library
Assertions from Expect library are more readable that assertions from Assert library.

Bug: T325740
Change-Id: I686f39d7ef08085037bc34219c6f55eba9da8dd1
2024-09-19 10:57:35 +02:00
Željko Filipin
b85439f1a0 selenium: Add LoginPage.getActualUsername()
This piece of code is used in two tests in user.js.
It makes sense to extract it to a page object.

Bug: T325740
Change-Id: Iedc8108080f295cf124953dba1f237f08957aba4
2024-09-18 13:19:17 +02:00
Željko Filipin
24bf1f5ac2 selenium: Use LoginPage instead of UserLoginPage
Page name is LoginPage. There's no need for the longer name.

Bug: T325740
Change-Id: Ia3b032bfd38c86abaff84feb2ff1773e9a7db9d8
2024-09-16 16:44:07 +02:00
Željko Filipin
e1b982bce7 selenium: Fix 'User temporary user should be able to create account'
Add missing `await`.

Bug: T325740
Change-Id: I942349e4fe3e8bc90727a4ae886ec8d5a219980c
2024-09-16 13:30:02 +02:00
Željko Filipin
ab73a3848c selenium: Fix docs/Stack/webdriverio.js
The file was by mistake going to `/Main Page` instead of `Main Page`.

Bug: T373125
Change-Id: Ie88dc1c24329aac8f00eb8471eed18165297d42b
2024-09-12 11:18:28 +02:00
Željko Filipin
6700247fa6 selenium: Fix Main Page should have "Log in" link
Three tests with that name were by mistake going to `/Main Page` instead of `Main Page`.

Bug: T373125
Change-Id: I5936f2c944765f576ab87d899002f7f24116ef44
2024-09-11 15:59:11 +02:00
Željko Filipin
bc772ddda0 selenium: Main page should have "Log in" link
Make it explicit that there are three separate tests
by expanding test names.

Until now, these three tests were doing the same thing,
but in a different way. All three tests had the same name.
That made it harder to debug if anything went wrong.
For example, all three tests created the screenshot file
with the same name.

Bug: T373125
Change-Id: I53f62186fd4e8ffbe5e93642c933da2493b91896
2024-09-11 10:55:58 +02:00
jenkins-bot
09121089f4 Merge "auth: Disable irrelevant account creation fields for temp users" 2024-09-10 20:05:43 +00:00
jenkins-bot
6aa500ccd8 Merge "wdio-mediawiki: Fix incorrect async execute() usage" 2024-09-10 20:01:23 +00:00
Máté Szabó
d150c66840 auth: Disable irrelevant account creation fields for temp users
Why:

- When signing up for an account, temporary users are currently forced
  to provide a reason for creating an account, and also have the option
  to send a temporary password to an email address.
- Neither of these options are useful for temporary users wanting to
  create a full user account.

What:

- Don't show these two form fields on Special:CreateAccount for temporary users.
- Add a functional test for the temporary user account creation flow.

Bug: T328718
Change-Id: Ie545857f7647be89d9462ec2b0def48690f0a2bf
2024-09-10 16:45:56 +02:00
jenkins-bot
c79c070737 Merge "selenium: Remove engines from wdio-mediawiki" 2024-09-09 14:02:07 +00:00
Máté Szabó
92715a924b wdio-mediawiki: Fix incorrect async execute() usage
Why:

- In WDIO < 9, the function to be run by browser.execute() must be
  synchronous.[1] Asynchronous code should be run via executeAsync()
  instead.[2]
- isTargetNotWikitext() however runs asynchronous code via execute(),
  which may be interfering with tests.

What:

- Have isTargetNotWikitext() use executeAsync() instead.

[1] https://v7.webdriver.io/docs/api/browser/execute/
[2] https://v7.webdriver.io/docs/api/browser/executeAsync/

Change-Id: I05aaf8d89c5b52ffc94f70a4f887a98a99037027
2024-09-09 14:27:12 +02:00
Željko Filipin
e2341256c7 selenium: Remove engines from wdio-mediawiki
Bug: T373684
Change-Id: I2d482b61d6a3bf037f43c9050b46f989c06bc559
2024-09-09 13:48:09 +02:00
Lucas Werkmeister
10609e6dee wdio-mediawiki: Add random element to junit-reporter file name
Without this, it’s possible (though rare) for two tests to write to the
same file, producing garbled XML. As far as I can tell, there’s no way
to access the test name in the outputFileFormat callback (it gets passed
an options object but the test name doesn’t seem to be included in it),
so just add a random string, using the simplest method that should work
in every JS engine. (I tried using crypto.getRandomValues() first, and
it works without warning in fresh-node18, but ESLint still yelled at me
about the Node.js feature being experimental.)

As far as I can tell from Codesearch [1], the file names are matched by
Jenkins using the glob log/WDIO.xunit*.xml, so the changed file name
pattern should still work there.

[1]: https://codesearch.wmcloud.org/search/?q=WDIO%5C.xunit

Bug: T307914
Change-Id: If51549f1318c601782b3fa4ff34923e5c7db5e62
2024-09-06 13:19:00 +02:00
Željko Filipin
ef832a2fc0 selenium: Example code for Selenium/Explanation/Page object pattern
https://www.mediawiki.org/wiki/Selenium/Explanation/Page_object_pattern

Bug: T368535
Change-Id: Ib69e0696060885476e9f880f37067539ed7e1904
2024-08-27 11:41:33 +00:00
jenkins-bot
f272d5dd8e Merge "selenium: Example code for Selenium/Explanation/Stack" 2024-08-26 14:11:53 +00:00
Željko Filipin
c0da0ea8a7 selenium: Example code for Selenium/Explanation/Stack
https://www.mediawiki.org/wiki/Selenium/Explanation/Stack

Bug: T368535
Change-Id: Ie1354c94c935551a23a937bb38012c10431c6292
2024-08-23 15:43:38 +00:00
Željko Filipin
e48ffe2a8a selenium: Example code for Selenium/How-to/Use MediaWiki API
https://www.mediawiki.org/wiki/Selenium/How-to/Use_MediaWiki_API

Bug: T364268
Change-Id: I0ce71a21eee8ebdfaef4fa7e1be85816b25a553f
2024-08-14 15:43:08 +02:00
jenkins-bot
164a5d713b Merge "[Re-apply] Selenium tests: Skip wikitext-specific tests if NS_MAIN isn't wikitext" 2024-08-12 09:51:55 +00:00
Jforrester
3829e51f7a [Re-apply] Selenium tests: Skip wikitext-specific tests if NS_MAIN isn't wikitext
This reverts commit 4ef806b6e3.

Reason for revert: This is still a fundamental bug in the test runner that
has blocked us being able to run browser tests for WikiLambda for over a year.

Bug: T358530
Change-Id: I77104fac7d190267e40895b9e66732ff6f9c0dc7
2024-08-07 14:02:46 +02:00
jenkins-bot
8b60f5f13c Merge "selenium: Move code for Selenium/Getting Started/Create a simple test" 2024-07-29 14:18:52 +00:00
jenkins-bot
704ca68ccd Merge "selenium: Example code for Selenium/How-to/Debug with Visual Studio Code" 2024-07-29 13:59:43 +00:00
Jforrester
756b6e3f7d selenium: Add documentation to getTestString()
Bug: T358530
Change-Id: Ib394b49359ecdfc64265b7c37c59d4c2a0442cba
2024-07-25 15:19:03 +02:00
Željko Filipin
24f87d594f selenium: Move code for Selenium/Getting Started/Create a simple test
Move code from root of docs folder to the Create_a_simple_test folder.
There is code at several pages.
If all code ends in root, it will be confusing.

https://www.mediawiki.org/wiki/Selenium/Getting_Started/Create_a_simple_test

Bug: T368535
Change-Id: I0d2ae8118ab2425570ff996c3d95c5583f4ea278
2024-07-22 13:48:49 +00:00
Željko Filipin
e2374541ca selenium: Example code for Selenium/How-to/Debug with Visual Studio Code
https://www.mediawiki.org/wiki/Selenium/How-to/Debug_with_Visual_Studio_Code

Bug: T368535
Change-Id: If8bb90ea5f698556790f14e05e9bfea582fc5ea8
2024-07-19 13:50:47 +02:00
Željko Filipin
911957a415 selenium: Example code for Selenium/Getting Started/Create a simple test
https://www.mediawiki.org/wiki/Selenium/Getting_Started/Create_a_simple_test

Bug: T364268
Change-Id: I577fe4d49cc10bec11fc4514b1b8f090621d1d07
2024-07-17 11:36:43 +02:00
jenkins-bot
08d30cc5ca Merge "selenium: Add sample code from Selenium documentation to mediawiki core" 2024-07-17 09:06:04 +00:00
Željko Filipin
58483a7ef3 selenium: Add sample code from Selenium documentation to mediawiki core
Bug: T368535
Change-Id: I769df2ab5efafe74f28f1417260338484bd106f0
2024-07-16 15:56:56 +02:00
Jdlrobson
9703d35f85 Revert "Skip this test since it is blocking merges in Vector"
This reverts commit 83f65121f8.

Depends-On: I0ceace61899d0b1bd047e5011acaddd4428c944e
Reason for revert: Try and get to the bottom of the problem here.

Change-Id: I65b9f5a2bcd27415b61cd56f35f096d3bb2b1145
2024-07-12 13:46:36 +00:00
Bartosz Dziewoński
46c3a0674a tests/selenium: Fix inputting DeletePage reason
Bug: T369872
Change-Id: Ief05bb819f7b9365e9509e89ec416b8619cf6461
2024-07-12 13:46:26 +00:00
Steph Toyofuku
83f65121f8 Skip this test since it is blocking merges in Vector
Currently, we're not entirely sure why but this test is failing
consistently on patches that seem unrelated - skip it for now while we
investigate what is causing it to fail so that merges are unblocked

Bug: T369872
Change-Id: I1c8115e95749bcb5e6b55d0ebe31267178042783
2024-07-11 15:11:30 -07:00
Ed Sanders
4b9ccab9b9 ESLint: Enforce prefer-arrow-callback and autofix
Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
2024-06-11 19:03:54 +01:00
Ed Sanders
2af1c3c901 build: Update eslint-config-wikimedia to 0.28.1 and autofix
Also remove temporary explicit dependency on eslint-plugin-vue
introduced in Ibd616750f046a.

Change-Id: Ic6330fcb116e99d5827b4877e094e3073e2b7b72
2024-06-11 19:03:53 +01:00
Kolawole
39d3a0cc09 Add a line after JSDoc block descriptions
Bug: T364193
Change-Id: Ide953babcbfc4b309a59c88b371f5b10369e2b72
2024-05-04 15:45:53 +01:00
Željko Filipin
b076717283 selenium: Fix selenium-daily-beta(commons)-MediaWiki Jenkins jobs
"User should be able to log in" is failing.
Don't run it in the daily job until we figure out what's wrong.

Bug: T270771
Change-Id: I72c524eba700e8d100435d3365dbfc4ed934bb7b
2024-04-16 15:26:35 +02:00
jenkins-bot
5f2a37575f Merge "Remove unnecessary async in wdio user test." 2024-02-26 16:57:40 +00:00
jenkins-bot
3185e5376a Merge "Add missing await in edit page." 2024-02-26 14:37:42 +00:00
Peter Hedenskog
7a548c1e01 Add missing await in edit page.
There are a couple of missing awaits when we call async functions.

Bug: T358094
Change-Id: I235732996f08a440d7fe04e9d19ce8f0d6aeda0f
2024-02-26 15:47:48 +03:00
Peter Hedenskog
e13d0e9ca5 Remove unnecessary async in wdio user test.
The mw.config.get is not async so there's no need to wrap it in
an async function.

Bug: T358092
Change-Id: Idd7951f3b5dbf36d8fde8ce8d0ef016bc42df6c3
2024-02-21 12:41:58 +01:00
Peter Hedenskog
4a42035c11 Add missing async.
This commit adds missing async defintions in a couple of
methods for our wdio page tests. It's better to define the
functions so that its clear that its async.

Bug: T358092
Change-Id: I9006deb9a9a0bb524ab61a16c6f41621482f21bf
2024-02-21 12:29:07 +01:00
jenkins-bot
48a08552cf Merge "selenium: Update readme file" 2024-02-16 14:42:43 +00:00
Željko Filipin
ed6440d9ba selenium: Update wdio-mediawiki readme file
Fix:

MD031 - Fenced code blocks should be surrounded by blank lines
https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md031.md

MD040 - Fenced code blocks should have a language specified
https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md040.md

Bug: T324766
Change-Id: I7914563975b3012302ff1b305818d49ae12e9f03
2024-02-16 13:43:40 +01:00
Željko Filipin
59c33fcb6b selenium: Update readme file
Replace `npm run selenium` with `npm run selenium-test`.

Fix MD001 - Heading levels should only increment by one level at a time.
https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/md001.md

Bug: T324766
Change-Id: Ie3d48fdd65496385a63609eef7e228031ef90f1a
2024-02-16 13:33:43 +01:00
Željko Filipin
02b182d180 selenium: Fix and update links in comments and documentation
Bug: T324766
Change-Id: If62835494fe7dd47fc4f18b881783570340cb5a9
2024-02-15 16:12:25 +01:00
Željko Filipin
40dc4040f3 selenium: Update instructions on how to release wdio-mediawiki npm package
Bug: T355556
Change-Id: Iac21332582f64b39942e9d8a19f4a03e4634af98
2024-01-29 15:57:08 +01:00
jenkins-bot
a64fac7080 Merge "wdio-mediawiki: Release 2.5.0" 2024-01-24 16:06:26 +00:00
Željko Filipin
969daa29a3 selenium: Update node and npm versions
The minimum versions are set to what our CI uses.

Bug: T355556
Change-Id: I7102f0dff92b900646625123eea1a8e2c25e0be5
2024-01-24 15:51:29 +01:00
Željko Filipin
368b35a915 wdio-mediawiki: Release 2.5.0
Bug: T355556
Change-Id: I72015cc3d363449188b1ad776aef2279a58ab565
2024-01-24 15:43:45 +01:00