Page MenuHomePhabricator

Create E2E tests for subreferences in VisualEditor: create, edit, delete, and re-use
Closed, ResolvedPublic

Description

Create E2E tests that cover the full lifecycle for subreferences in VisualEditor: create, edit, copy/reuse and delete.

Implement two separate test files:

  1. For pages using <references />
  2. For pages using the {{reflist}} template.

Starting scenario / fixture:
The page should already contain main and subrefs, and at least one main plus details reference.
Load the page in VisualEditor.

Scenarios for both test files:

  • Create a new subreference for existing main ref

Given I have Wikitext with a ref and a reuse of a ref
And I load the VisualEditor
When I convert both references into sub-references.
Then It appears correctly in the article and references section.
And the references section displays the updated sub-reference content.

When I save the page.
Then the Wikitext reflects the updated sub-reference content and that the main content moved to a sub-ref.

  • Edit the existing sub-reference

Given I have a main+details reference in Wikitext
And I load the VisualEditor
When I select and modify the sub-reference content.
Then the changes are reflected correctly in the article preview.
And the references section displays the updated sub-reference content.
And footnote numbers and backlinks remain consistent.

When I save the page.
Then the Wikitext reflects the updated sub-reference content.

  • Delete the main reference to sub-reference

Given I have a named reference and a sub-reference to that main Wikitext
And I load the VisualEditor
When I remove the main reference
Then it is removed from the article
And the references list still shows it's content together with the indented sub-ref

When I save the page.
Then the Wikitext shows that the main content moved to the sub-ref.

Optional and only if possible
  • Copy or reuse the subreference elsewhere in the article

When I select the subreference and use the reuse/copy dialog.
Then the subreference appears in the new location.
And footnote numbers, backlinks, and content remain consistent.

Details

Related Changes in Gerrit:

Event Timeline

Change #1269025 had a related patch set uploaded (by Mareike Heuer; author: Mareike Heuer):

[mediawiki/extensions/Cite@master] e2e test for VE subrefs

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

Change #1269025 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] e2e test for VE subrefs

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

Tobi_WMDE_SW claimed this task.