Page MenuHomePhabricator

Browser tests for TemplateWizard
Open, NormalPublic5 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 triaged this task as Low priority.Jul 13 2018, 9:59 PM
Niharika created this task.
Restricted Application added a project: Community-Tech. · View Herald TranscriptJul 13 2018, 9:59 PM
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

aezell added a subscriber: aezell.Aug 20 2018, 5:07 PM

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

Niharika raised the priority of this task from Low to Normal.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
Mooeypoo updated the task description. (Show Details)Aug 22 2018, 12:08 AM
Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint board.

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 closed this task as Resolved.Sep 13 2018, 5:20 PM
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 reopened this task as Open.Oct 25 2018, 12:51 AM

I just realised that this task still has an open patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TemplateWizard/+/454479

@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

Mooeypoo closed this task as Resolved.Nov 27 2018, 11:02 PM
Mooeypoo moved this task from Needs Review/Feedback to Q2 2018-19 on the Community-Tech-Sprint board.

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

Samwilson reopened this task as Open.Nov 29 2018, 6:32 AM

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...

Samwilson removed Samwilson as the assignee of this task.Jan 17 2019, 12:07 AM