What is the problem?
I am finding circumstances where, despite their being a valid username entered in the target input, submitting Special:Block leads to the error (returned by the API):
Invalid value "" for user parameter "user"
Inspecting the network traffic, the API request to create the block has a blank user parameter.
I also notice the Block log does not get populated.
I don't know if this makes any difference, but when I see this problem I looked in the Vue devtools in Chromium, in the "Components" tab the "<UserLookup>" component has the modelValue: null.
Steps to reproduce problem
- https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block
- In the "Username..." input, type "Drwpb"
- In the dropdown menu that appears, select "Drwpb" (either with mouse or keyboard)
- Blur the input (click outside or tab)
- Place the cursor in the input again (the dropdown menu should be blue shaded)
- Delete some or all the input and retype it
- Set a duration
- Submit the form
Expected behaviour: Block is created successfully.
Observed behaviour: Invalid value "" for user parameter "user"
Environment
Browser: Firefox 128. Chromium 130.
Wiki(s): https://test.wikipedia.beta.wmflabs.org MediaWiki 1.44.0-alpha (2d06484) 12:44, 6 November 2024.
Screenshots
Derived Requirement
Ensure that the username parameter in the API request to create a block on Special:Block is correctly populated with the selected username, even after retyping it in the input field.
BDD
gherkin Feature: Block User with Retyped Username on Special:Block Page Scenario: Ensure the username parameter is correctly populated after retyping in the input field Given the user is on Special:Block page And the user enters a valid username in the "Username..." input field And selects the username from the dropdown menu When the user clears and retypes the username in the input field And submits the block request Then the block should be created successfully And no error should be displayed for an invalid user parameter
Test Result - Beta|Prod
Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/testwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device: NA
Test Artifact(s):
Test Steps
Test Case 1: Ensure username parameter is correctly populated after retyping
- Navigate to Special:Block on testwiki.
- In the "Username..." input field, type "Drwpb."
- From the dropdown menu, select "Drwpb" using the mouse or keyboard.
- Blur the input field by clicking outside or pressing Tab.
- Click back into the input field to re-focus, then delete some or all of the input.
- Retype the full username "Drwpb."
- Set a block duration.
- Submit the form.
- ✅❓❌⬜ AC1: Confirm that the block is created successfully without displaying the error, "Invalid value '' for user parameter 'user.'"
- ✅❓❌⬜ AC2: Verify that the Block log entry appears with the correct username "Drwpb."
QA Results - Testwiki
AC | Status | Details |
---|---|---|
1 | ✅ | T379162#10319224 |
2 | ✅ | T379162#10319224 |