Page MenuHomePhabricator

Cypress: "Page should be creatable" test fails on the CI because of welcomedialog pop up on TestWiki
Open, MediumPublic

Description

Status

  • tests run fine locally, but fail in CI

TODO

  • install mediawiki-vagrant and provision guidedtour role
    • vagrant roles enable guidedtour
    • vagrant provision
  • set up GuidedTour on mediawiki-docker and see if the popup appears (parameter_functions.py#747)

I have a local setup using Mediawiki-Docker. I am running these tests with Cypress. The test runs perfectly fine on local but a popup on TestWiki (Mediawiki on the CI) breaks the test.

Cypress patch for the test

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJun 8 2020, 3:33 PM
Soham renamed this task from Cypress: Page should be creatable test fails on the CI because of a TestWiki pop up to Cypress & Puppeteer: Page should be creatable test fails on the CI because of a TestWiki pop up.Jun 10 2020, 3:04 PM
Soham updated the task description. (Show Details)

Hi @Soham,

Have a look at tests/selenium/pageobjects/edit.page.js in MediaWiki core, you can see that we pass query parameters to suppress these dialogs:

super.openTitle( title, { action: 'edit', vehidebetadialog: 1, hidewelcomedialog: 1 } );

Hi @Soham,

Have a look at tests/selenium/pageobjects/edit.page.js in MediaWiki core, you can see that we pass query parameters to suppress these dialogs:

super.openTitle( title, { action: 'edit', vehidebetadialog: 1, hidewelcomedialog: 1 } );

Thank you so much @kostajh for reverting. I have actually added these in my tests too but for a weird reason, the dialogue still fails to be suppressed. It would be lovely if you could have a look at my edit.page.js file and let me know if I am doing something wrong:

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/604389/2/tests/puppeteer/pageobjects/edit.page.js

Here is the link to my base page object file:

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/603933/4/tests/puppeteer/pageobjects/page.js

In the browser tests for Two-Column-Edit-Conflict-Merge we have a piece of code that disables VisualEditor and it's welcome message, see https://gerrit.wikimedia.org/g/mediawiki/extensions/TwoColConflict/+/master/tests/selenium/pageobjects/editconflict.page.js#92. Maybe this helps?

I will try to give this a go. I am not sure where the mw object comes from. Is it possible for you to explain a bit on this on guide me to a resource that does so @thiemowmde . This will help me translate the code to its equivalent in Puppeteer and Cypress.

The mw object is available because this class extends the Page class from the wdio-mediawiki package:

But all this is just a convenience layer on top of the normal MediaWiki API. You can achieve the same with any HTTP request to the options API: https://www.mediawiki.org/wiki/API:Options

Aklapper renamed this task from Cypress & Puppeteer: Page should be creatable test fails on the CI because of a TestWiki pop up to Cypress & Puppeteer: Page should be creatable test fails on the CI because of welcomedialog pop up on TestWiki.Jun 12 2020, 12:40 PM

The mw object is available because this class extends the Page class from the wdio-mediawiki package:

But all this is just a convenience layer on top of the normal MediaWiki API. You can achieve the same with any HTTP request to the options API: https://www.mediawiki.org/wiki/API:Options

@thiemowmde sorry for my delayed reply. Thank you so much for the explanation. I think we have done a script injection in the Utils file. I was confused as to where the mw object came from. I will try this out and see if it runs on the CI

@thiemowmde, this requires me to be logged in first in order for we to set options. Is there a way we can accomplish this without that?

Oh. The idea is that you set this option for the same user that is running the browser test. If that's an anonymous user, this solution doesn't work.

@thiemowmde Ohh yes figured...yes the tests are targetted as an anonymous user. I am not sure why this happens since the tests run perfectly on my local set up!

zeljkofilipin renamed this task from Cypress & Puppeteer: Page should be creatable test fails on the CI because of welcomedialog pop up on TestWiki to Cypress: "Page should be creatable" test fails on the CI because of welcomedialog pop up on TestWiki.Jun 29 2020, 10:13 AM
zeljkofilipin updated the task description. (Show Details)
zeljkofilipin updated the task description. (Show Details)

@hashar do you know how mediawiki needs to be configured for this popup to appear?

It's appearing in CI when running mediawiki/core tests. We've tried to get the popup to show up in mediawiki-docker (see MediaWiki-Docker/Extension/GuidedTour) and mediawiki-vagrant (by provisioning guidedtour role) but the popup does not show up. Does it need to be configured? How is it set up in CI?

@Soham please answer any questions from @hashar.

@hashar do you know how mediawiki needs to be configured for this popup to appear?

It's appearing in CI when running mediawiki/core tests. We've tried to get the popup to show up in mediawiki-docker (see MediaWiki-Docker/Extension/GuidedTour) and mediawiki-vagrant (by provisioning guidedtour role) but the popup does not show up. Does it need to be configured? How is it set up in CI?

@Soham please answer any questions from @hashar.

This comes from VisualEditor. Have a look at extensions/VisualEditor/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js, specifically shouldShowWelcomeDialog(). You probably want to modify your test to set vehidebetadialog=1 in the query parameters.