Commit graph

34 commits

Author SHA1 Message Date
mimurawil
ac634435f4 api-testing/action/PageProtection.js: clear state for each test
Anonymous editing with temp account creates a new account (temporary),
so the anonymous token are not valid anymore.

This sets a clear state for each test scenario.

Bug: T365647
Change-Id: I41c6d98a107830f7b9dcc90b91cff0a776767195
2024-07-11 09:27:21 +00:00
mimurawil
e5abaa2929 api-testing/action/Autopatrolling.js: adjust key prop for temp account
Update autopatrolling rights key from `anon` to `temp`.

Bug: T365647
Change-Id: I4a0eeb2739ea7a457e52cb7dd9441eb87bcaea84
2024-07-11 09:27:21 +00:00
mimurawil
0578848298 api-testing/action/Edit.js: Adjust username assertion for anonymous
Anonymous users (temp accounts) have auto-generated usernames.
This change prevents the assertion test of the username for temporary
accounts, while it still tests everything else in the change record.

Bug: T365647
Change-Id: I406340cd54421ef48fa96da76d58cf3b0b8b77e1
2024-07-11 09:27:21 +00:00
Ed Sanders
4b9ccab9b9 ESLint: Enforce prefer-arrow-callback and autofix
Change-Id: Iddfa574e42e569ac5e2a2b098ad2f11ca80c5955
2024-06-11 19:03:54 +01:00
Tim Starling
917f0a5996 Replace all instances of "per default" with "by default"
According to the dictionary, "per" (or more conventionally "as per")
means "according to". Refer OED "per" sense II.3.a. For example:

"No value was passed, so return null, as per default".

In this sentence, we are not specifying the default, we are referring
to the default. This correct usage of "per default" was used nowhere
in MediaWiki core as far as I can see.

Instead we have "per default" being used to mean "by default", that is,
giving the value to use when no explicit value was specified.

In OED, the phrase "by default" is blessed with its own section just
for computing usage:

"P.1.e. Computing. As an option or setting adopted automatically by a
computer program whenever an alternative is not specified by the user
or programmer. Cf. sense I.7a."

There are highly similar pre-computing usages of the same phrase,
whereas the phrase "per default" is not mentioned.

As a matter of style, I think "per default" should not be used even
when it is strictly correct, since the common incorrect usage makes it
ambiguous and misleading.

Change-Id: Ibcccc65ead864d082677b472b34ff32ff41c60ae
2024-04-29 10:47:54 +10:00
James D. Forrester
c2aa05102d build: Upgrade eslint-config-wikimedia from 0.25.0 to 0.26.0 and make pass
Mostly this has a bunch of whitespace changes from the
template-curly-spacing and brace-style rules being set
to align with other spacing rules.

Change-Id: I4609c52a4ef426ad1f35fb4bfe447bb08323a8e8
2023-11-22 13:25:32 -05:00
Amir Sarabadani
c7056e8fd8 Set default migration stage of externallinks to read new and write both
Bug: T341828
Depends-On: I2d4ef8fc3bffa43bc611af3eab0494f4900df557
Change-Id: Ia55cb6cbdb28484e820f9cf3d6aacac00a86ffab
2023-07-13 22:43:43 +02:00
Bartosz Dziewoński
5dbb00cc6a api-testing: Make 'parse' tests compatible with Vector 2022
Vector 2022 does not render a table of contents. Allow matching a TOC
placeholder as well as the real TOC.

Change-Id: Ib473bf811709e1d71513a906a0c2928f1727ca05
2023-05-20 21:22:49 +03:00
Klein Muçi
803b873beb docs: Fix 'the the' typo
Bug: T201491
Change-Id: Idd776953dcf7dadc136e57d586c09b24363005a6
2022-05-05 15:40:26 +00:00
jenkins-bot
85e2a07fe6 Merge "Revert "api-testing: Skip flaky bot edit revert test"" 2022-02-21 15:19:44 +00:00
Kosta Harlan
d01950a57d
api-testing: Run all jobs after edit in Watchlist.js
See
https://integration.wikimedia.org/ci/job/mediawiki-quibble-apitests-vendor-php72-docker/28585/console
for a build failure where the watchlist query didn't return a result.

Change-Id: I891668e9daf92286d2cf8f98b9aab72f56c57d78
2022-02-10 14:03:57 +01:00
Kosta Harlan
c5ba14f8cf api-testing: Disable flaky test
Bug: T285649
Change-Id: Ib13f81715c3bfcc4232d6a17da86a9e6d7e7f347
2022-02-02 13:52:07 +01:00
Kosta Harlan
b3fb341423 api-testing: Add wiki.runAllJobs() for two more tests
Bug: T285649
Change-Id: I4b770577b711c368541f4e7e53fe6e25bf26aa78
2022-02-02 13:50:39 +01:00
Hashar
b94cc17917 Revert "api-testing: Skip flaky bot edit revert test"
This reverts commit 0d41717c4b.

Reason for revert: the test fails when using Apache in CI instead
of the php built-in webserver.

Bug: T298514
Change-Id: Id47b469eb2698a80167665bba0b66a0b5d9308cd
2022-01-19 12:27:01 +01:00
Kosta Harlan
4874825d1a api-testing: Run jobs for tests dependent on deferred updates (part II)
Follows-Up: Ia9fd617ef02de57b82c5a7250b586d37bb2687b3
Bug: T285649
Change-Id: I6860b818f2690eec0904f24da6e1bdb878a068c1
2022-01-12 11:34:22 +01:00
Kosta Harlan
d269ef695e api-testing: Combine two dependent tests into one
The assertion made in the second it() statement depends on what happens
in the previous one, so combine these into a single test.

Bug: T298735
Change-Id: I120971bf747797de18ab0fdf71c16b7f520488a5
2022-01-07 13:58:13 +01:00
Kosta Harlan
9f87887e95 api-testing: Run jobs for tests dependent on deferred updates
Bug: T285649
Change-Id: Ia9fd617ef02de57b82c5a7250b586d37bb2687b3
2022-01-07 12:38:49 +01:00
Kosta Harlan
0d41717c4b api-testing: Skip flaky bot edit revert test
Bug: T298514
Change-Id: I711fbc644872d9ed2902067dc30c1766665d3e99
2022-01-04 14:02:12 +01:00
Ed Sanders
9fe2995989 build: Update eslint-config-wikimedia to 0.21.0
* Replace `substr`/`substring` with `slice`. The second argument
  to `substring` is length, not end index as in `substr`/`slice`,
  so convert where necessary.
* Replace `new Date().getTime()` with `Date.now()`
* Documentation fixes
* Replace `throw Error` with `throw new Error`

Change-Id: I532500ea4c99d8ebec01efb21273c8df21626e59
2021-11-09 21:08:55 +00:00
James D. Forrester
c2b52ea1fb api-testing: Adjust DiffCompare expected outcome to cope with new wikidiff2 output
The library now adds 'diff-side-added' and 'diff-side-deleted'.

Bug: T292676
Depends-On: If4bc60c35403799de4e330103d8aaa6f039d96fe
Change-Id: Id92aee4029f008402d9d331876c81fe2263580a7
2021-10-06 22:30:15 +00:00
Fomafix
213d45e5dd Make first char of username in ApiQueryAllUsers case-insensitive
This change uses $contentLanguage->ucfirst( $name ) to get the
canonical username like this is done in UserNameUtils::getCanonical().
This makes the first character case-insensitive. The toUpperCase() in
JavaScript is not needed anymore.

toUpperCase() in JavaScript and $contentLanguage->ucfirst() in PHP
differ on some characters:
* JavaScript: "ß".toUpperCase() // "SS"
* PHP: $contentLanguage->ucfirst( "ß" ) // "ß"

Bug: T291339
Change-Id: Id9afb2dd0212e4b871bb6a7a9d8762e1bcb81d6a
2021-09-21 06:21:21 +00:00
daniel
d55f361a5b Add more end-to-end tests related to page protection
This covers:
* cascading protection
* unprotecting a page

Bug: T218395
Change-Id: I7639930e379256f720f864c758b1735a0cfa04c9
2021-08-28 17:59:29 +02:00
daniel
23aa8db51f Improve structure of e2e tests for page protection.
This does not change any tests, it just adds nested "describes"
structures and improves descriptions.

Change-Id: I3b5628405b97e784b05337ea22b9878dc63ab26d
2021-08-28 17:52:57 +02:00
TChin
eac9174eb3 Added integration tests for ApiQueryExternalLinks
Bug: T286498
Change-Id: Ie97a517968a498de5b2d282a9e30027c2462d450
2021-07-16 16:30:21 -04:00
Kosta Harlan
9445358f6e Avoid Promise.all when creating users to prevent deadlock
See also I884ca6e15a1

Bug: T199393
Change-Id: I3d0a8c3896e7879bc48e251beb26b41a328b71d0
2021-01-05 14:13:07 +00:00
daniel
36127ffd9d ApiOptions: log when userjs-* option changes
Bug: T259073
Change-Id: I99b9f224d3c0c21ef22a0ffa98ad2f72bf300943
2020-09-15 16:50:03 +02:00
Nikki Nikkhoui
764fd295c4 ActionAPI Tag end to end test
Create initial test for action api action=tag
end to end test.

Bug: T256826
Change-Id: I7b4f43112534efd7258cf1368d198fbe4bdef7d8
2020-07-14 13:16:52 -07:00
Ed Sanders
08510de602 api-testing: Use wikimedia/mocha eslint config
Change-Id: Iec346d87f252c66fbff1e0fa522d7440df6f1764
2020-06-18 19:20:33 +01:00
Clara Andrew-Wani
daf10105a8 Move final batch of tests from api-testing to core
Moving tests that were added to api-testing repo after the initial
move to core.

Tests are from:
* Ifdfc56a80e70f169fa857af4123041723463cf90
* I55f9b23805f4c10449a508633f36c0bb75b06717
* I04db44c89a7b0bcb6dabb2ab9d9d96d495d98e82
* I3b74a9fb2f318158a72856599db837f63426ae4d

Change-Id: I83fc653f1a2f44cc12a5452cd659e809e6332b37
2020-06-05 11:28:52 -04:00
Ed Sanders
8b720e9bd6 eslint: Update to eslint-config-wikimedia 0.16.0
* valid-jsdoc replaced with jsdoc plugin
* New /selenium config

Change-Id: I471eebac0312cb25c539c3f6a3ecfc7cfd4ed8d6
2020-06-02 21:32:56 +01:00
Ed Sanders
d94f90e088 eslint: Code style fixes for upcoming config change
Change-Id: Ief44c0bb26c5a1c1773cab5dba51d5e856612bf7
2020-05-14 22:19:55 +01:00
Clara Andrew-Wani
aa0ad28c4f Move Search and Watchlist tests from api-testing repo into Core
Bug: T236680
Change-Id: Id1e37791576d27e5e7007387e91270392e7d5904
2020-02-06 00:55:53 +00:00
Clara Andrew-Wani
f07d7ba699 Move tests from api-testing repo into Core
Except for Search & Watchlist, which need fixes in gated extensions first.

Change-Id: I88d24dda4bc047868de3ff9dd4a5753b9c7b0f64
2020-02-05 16:07:54 -08:00
Clara Andrew-Wani
ac4dec907b Add API-testing to core
Bug: T236680
Depends-On: I0110de1539e4d6d9d6a58d1a645c1a1c02d8127f
Change-Id: I827dc895719cc68738ebb425f8471ac38caa49aa
2019-12-19 13:20:12 -05:00