Page MenuHomePhabricator

Create e2e test for subreference feature
Open, Needs TriagePublic

Description

Create Cypress test to simulate user actions in VisualEditor and Wikitext to verify the subreferencing feature works correctly.

Case 1: Add details to one reference
Given I click on a reference and open the "Add details" dialog
And I add citation details for the reference
Then the reference should be converted to a subref.
Other reuses of that ref remain unchanged

Case 2: Add details to all reuses of a reference
Given I click on a reference with multiple reuses and open "Add details".
And I add citation details.
And I select "Add these details to all (num) uses of this reference that don't have details yet." checkbox
Then all instances of that reference should be converted to the same subref.
And all reuses point to the same main ref

Case 3: Edit details of one subreference
Given I have a subreference
When I open the subreference edit dialog
And I edit details
Then only that subreference's details should change.

Case 4: Edit all reuses of a subreference
Given I have a subreference with multiple reuses
When I open the edit subref dialog
And I select "Edit all (num) uses of these details.".
Then all reuses of that subreference should get the updated details.

Case 5: Save and verify wikitext output
After performing any of Cases 1-4.
When I save the page.
Then the wikitext should correctly reflect the changes.