jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/343096 )
Change subject: Add browser tests for help tutorial ...................................................................... Add browser tests for help tutorial Bug: T159522 Change-Id: I096749e46d9f7b55d5abf9146094d4b9677b890f --- A tests/browser/features/help.feature M tests/browser/features/support/pages/edit_conflict_page.rb M tests/browser/features/support/step_definitions/edit_conflict_steps.rb A tests/browser/features/support/step_definitions/help_steps.rb 4 files changed, 70 insertions(+), 0 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/features/help.feature b/tests/browser/features/help.feature new file mode 100644 index 0000000..25aa4bd --- /dev/null +++ b/tests/browser/features/help.feature @@ -0,0 +1,19 @@ +@chrome @en.wikipedia.beta.wmflabs.org @firefox @integration +Feature: Two column edit conflict help + Background: + Given I am logged in + And I have reset my preferences + And TwoColConflict is enabled as a beta feature + And I handle an edit conflict + + Scenario: Two column edit conflict tutorial shows + When I click on the show help button + Then The help dialog should be visible + + Scenario: Two column edit conflict sequence works + When I click on the show help button + And I have moved to the next step + And I have moved to the next step + And I have moved to the next step + And I have closed the help dialog at the end + Then The help dialog should not be present diff --git a/tests/browser/features/support/pages/edit_conflict_page.rb b/tests/browser/features/support/pages/edit_conflict_page.rb index 72897f2..72d8f80 100644 --- a/tests/browser/features/support/pages/edit_conflict_page.rb +++ b/tests/browser/features/support/pages/edit_conflict_page.rb @@ -31,4 +31,11 @@ radio_button(:twocolconflict_option_show, xpath: '(//*[@name="mw-twocolconflict-same"])[1]') span(:twocolconflict_option_show_div, xpath: '(//*[@name="mw-twocolconflict-same"]//parent::span)[1]') span(:twocolconflict_option_hide_div, xpath: '(//*[@name="mw-twocolconflict-same"]//parent::span)[2]') + + button(:twocolconflict_show_help, css: '.mw-twocolconflict-show-help > button') + div(:twocolconflict_help_dialog, css: '.mw-twocolconflict-help-dialog') + link(:twocolconflict_help_next, css: '.mw-twocolconflict-help-next > a') + link(:twocolconflict_help_previous, css: '.mw-twocolconflict-help-previous > a') + link(:twocolconflict_help_close_start, css: '.mw-twocolconflict-help-close-start > a') + link(:twocolconflict_help_close_end, css: '.mw-twocolconflict-help-close-end > a') end diff --git a/tests/browser/features/support/step_definitions/edit_conflict_steps.rb b/tests/browser/features/support/step_definitions/edit_conflict_steps.rb index fa89988..3c76b9f 100644 --- a/tests/browser/features/support/step_definitions/edit_conflict_steps.rb +++ b/tests/browser/features/support/step_definitions/edit_conflict_steps.rb @@ -101,6 +101,14 @@ on(EditConflictPage).twocolconflict_option_hide_div_element.when_present.click end +When(/^I handle an edit conflict$/) do + step 'I go to the "TwoColConflict Test Page" page with content "I am a sentence."' + step 'I click Edit' + step 'Another user changes content of the "TwoColConflict Test Page" page to "I am a longer sentence than before."' + step 'I edit the page with "Adding some random content."' + step 'I save the edit' +end + When(/^I handle a multi line edit conflict$/) do step 'I go to the "TwoColConflict Test Page" page with multi line content' step 'I click Edit' diff --git a/tests/browser/features/support/step_definitions/help_steps.rb b/tests/browser/features/support/step_definitions/help_steps.rb new file mode 100644 index 0000000..71e65e3 --- /dev/null +++ b/tests/browser/features/support/step_definitions/help_steps.rb @@ -0,0 +1,36 @@ +When(/^I click on the show help button$/) do + on(EditConflictPage).twocolconflict_show_help_element.when_present.click +end + +When(/^I have dismissed the help dialog$/) do + step 'I have closed the help dialog at the start' + step 'I wait until help dialog is hidden' +end + +When(/^I have closed the help dialog at the start$/) do + on(EditConflictPage).twocolconflict_help_close_start_element.when_present.click +end + +When(/^I have closed the help dialog at the end/) do + on(EditConflictPage).twocolconflict_help_close_end_element.when_present.click +end + +When(/^I have moved to the next step$/) do + on(EditConflictPage).twocolconflict_help_next_element.when_present.click +end + +When(/^I wait until help dialog is hidden$/) do + step 'The help dialog is hidden' +end + +Given(/^The help dialog is hidden$/) do + on(EditConflictPage).wait_for_help_dialog_to_hide +end + +Then(/^The help dialog should be visible/) do + expect(on(EditConflictPage).twocolconflict_help_dialog_element.when_present).to be_visible +end + +Then(/^The help dialog should not be present/) do + expect(on(EditConflictPage).twocolconflict_help_dialog_element.when_not_present).not_to be_present +end -- To view, visit https://gerrit.wikimedia.org/r/343096 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I096749e46d9f7b55d5abf9146094d4b9677b890f Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/TwoColConflict Gerrit-Branch: master Gerrit-Owner: WMDE-Fisch <[email protected]> Gerrit-Reviewer: Addshore <[email protected]> Gerrit-Reviewer: Andrew-WMDE <[email protected]> Gerrit-Reviewer: Tobias Gritschacher <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
