Page MenuHomePhabricator

MediaWiki Prompts User Log out Occasionally
Closed, ResolvedPublic

Description

When running automated tests on the MediaWiki site, after a successful account creation or user login. When a user tries to logout, it once in a while displays a prompt asking the user to confirm if they want to log out or not.

This behaviour is irregular as it only happens a few times and not all the time, this can cause a test to fail when it happens.

I'm trying to get a screenshot of the prompt, but as it doesn't occur always, it's hard to know when next the prompt would appear so I could screenshot it.

The prompt button has a class .oo-ui-buttonElement-button ...

Event Timeline

The prompt is skipped if the logout request has token, otherwise the user must confirm they wish to log out. It's a security measure.

Its just like @Ammarpad said. I used the token too for my tests and did not encounter this issue

Thanks everyone for the feedback. :) Does that mean that this is expected behavior and this task should be closed? Or that documentation somewhere (where) for running tests needs to be improved (which would mean Quality-and-Test-Engineering-Team (QTE) )?

@Gbahdeyboh: It's also welcome if you 1) provided clear steps to reproduce, 2) what you expect, 3) what happens instead; in seperate sections. See and follow https://www.mediawiki.org/wiki/How_to_report_a_bug - thanks! :)

You can record video of test runs. That will show the problem. Also, if a test fails, the screenshot will be taken and saved in tests/selenium/log folder. Please upload a screenshot or a video of a failed test reproducing the problem.

The prompt is skipped if the logout request has token, otherwise, the user must confirm they wish to log out. It's a security measure.

Oh, thanks. I just cleared localStorage before log out and the prompt came up.

I get it now, thanks.

You can record video of test runs. That will show the problem. Also, if a test fails, the screenshot will be taken and saved in tests/selenium/log folder. Please upload a screenshot or a video of a failed test reproducing the problem.

Thanks @zeljkofilipin .

The tests works fine with selenium. I actually didn't make use of the login API during my tests with puppeteer and cypress which caused the weird behaviour. I'm working on using the API to generate session tokens so I could test and see if it solves it.

You can record video of test runs. That will show the problem. Also, if a test fails, the screenshot will be taken and saved in tests/selenium/log folder. Please upload a screenshot or a video of a failed test reproducing the problem.

Thanks @zeljkofilipin .

The tests works fine with selenium. I actually didn't make use of the login API during my tests with puppeteer and cypress which caused the weird behaviour. I'm working on using the API to generate session tokens so I could test and see if it solves it.

Yes you generally generate login via the token in the tests. Is this task resolved?

Gbahdeyboh claimed this task.