Page MenuHomePhabricator

Browser tests for TemplateWizard
Closed, ResolvedPublic5 Estimated Story Points

Description

Create basic browser tests for TemplateWizard.

I think we should add the following flow with (with this template):

The base test should do:

  1. find the template, select it;
  2. test that there is 1 required field already visible;
  3. click Add all fields, test that there are now 5 fields visible;
  4. add a value for Date of Birth;
  5. remove Username, test that focus is now on Date of Death;
  6. try to close the dialog, test that an error is shown;
  7. cancel that, and try to close the template, and test that an error is shown;
  8. cancel that, and insert the template, and test that it was inserted.

And pass.

Event Timeline

Niharika created this task.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 449408 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Basic test for search form

https://gerrit.wikimedia.org/r/449408

The above patch adds a first super basic test that creates an example template and then searches for (and finds) it in the TemplateWizard search form.

What else do we want to test?

Change 449408 merged by jenkins-bot:
[mediawiki/extensions/TemplateWizard@master] Basic test for search form

https://gerrit.wikimedia.org/r/449408

Seems like adding and removing parameters would be a good thing to test.

Niharika raised the priority of this task from Low to Medium.Aug 20 2018, 5:10 PM
Niharika added a subscriber: Mooeypoo.

@Samwilson @Mooeypoo @aezell I'm leaving it up to you all to flesh this ticket out before estimation tomorrow.

With my technical 🎩 on - we can consider testing for all the popups (required inputs not supplied, template being closed with data in fields, input type mismatch etc.)

I think we should add the following flow with (with this template):

  1. find the template, select it;
  2. test that there is 1 required field already visible;
  3. click Add all fields, test that there are now 5 fields visible;
  4. add a value for Date of Birth;
  5. remove Username, test that focus is now on Date of Death;
  6. try to close the dialog, test that an error is shown;
  7. cancel that, and try to close the template, and test that an error is shown;
  8. cancel that, and insert the template, and test that it was inserted.

That looks like a good plan to me.

Niharika set the point value for this task to 5.Aug 21 2018, 11:46 PM

Change 454479 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/TemplateWizard@master] Extend browser tests to include full workflow

https://gerrit.wikimedia.org/r/454479

This is passing now. I'm not sure if we want to introduce better selectors for some buttons etc. (I did for trash for instance, because it has no text); maybe for now it's okay?

@Mooeypoo This doesn't seem to need Product or QA review, right?

Niharika moved this task from QA to Q1 2018-19 on the Community-Tech-Sprint board.

@Mooeypoo This doesn't seem to need Product or QA review, right?

I'll take the answer is a no. :)

@Samwilson I tried to merge the patch (looks good) but it fails:

13:39:34 1) TemplateWizard basic use of TemplateWizard:
13:39:34 1 == 0
13:39:34 running chrome
13:39:34 AssertionError: 1 == 0
13:39:34     at assertVisibleElementCount (/workspace/src/extensions/TemplateWizard/tests/selenium/specs/TemplateWizard.js:23:9)
13:39:34     at Context.<anonymous> (/workspace/src/extensions/TemplateWizard/tests/selenium/specs/TemplateWizard.js:59:3)
13:39:34     at Promise.F (/workspace/src/node_modules/core-js/library/modules/_export.js:36:28)

Change 454479 merged by Samwilson:
[mediawiki/extensions/TemplateWizard@master] Extend browser tests to include full workflow

https://gerrit.wikimedia.org/r/454479

It was failing just for fun I think. I rechecked, and all is well. :-( Selenium is odd.

No, this really does seem to be flakey. Sorry! It looks like the TemplateData is not being retrieved (sometimes?) for the newly-created test template. Could that be because the job queue is not being cleared before then? Or something else...