Zfilipin has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/338146 )
Change subject: WIP Make it possible to execute tests as a specific (new) MediaWiki user on beta cluster ...................................................................... WIP Make it possible to execute tests as a specific (new) MediaWiki user on beta cluster Bug: T152432 Change-Id: Ib5419d4f6c5f44e3badaf57f2ce2537aadd94087 --- M tests/browser/features/create_account.feature M tests/browser/features/step_definitions/create_account_steps.rb 2 files changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/46/338146/1 diff --git a/tests/browser/features/create_account.feature b/tests/browser/features/create_account.feature index 8029182..3895f8b 100644 --- a/tests/browser/features/create_account.feature +++ b/tests/browser/features/create_account.feature @@ -15,3 +15,8 @@ Given I go to Create account page at Special:CreateAccount When I submit the form Then an error message is displayed + + Scenario: Create account via the API + Given I have created account via the API + When I log in as the new user + Then I am logged in diff --git a/tests/browser/features/step_definitions/create_account_steps.rb b/tests/browser/features/step_definitions/create_account_steps.rb index d9b4f52..9f0eeef 100644 --- a/tests/browser/features/step_definitions/create_account_steps.rb +++ b/tests/browser/features/step_definitions/create_account_steps.rb @@ -2,10 +2,21 @@ visit(CreateAccountPage, using_params: { page_title: path }) end +Given(/^I have created account via the API$/) do + require 'securerandom' + @user = SecureRandom.hex(20).capitalize + @password = SecureRandom.hex(20) + api.create_account @user, @password +end + Then(/^form has Create account button$/) do expect(on(CreateAccountPage).create_account_element).to exist end +When(/^I log in as the new user$/) do + visit(LoginPage).login_with(@user, @password) +end + When(/^I submit the form$/) do on(CreateAccountPage).create_account end -- To view, visit https://gerrit.wikimedia.org/r/338146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5419d4f6c5f44e3badaf57f2ce2537aadd94087 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Zfilipin <zfili...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits