From ed6c3c449b7a947901b45bdb0d0dc017560e7f78 Mon Sep 17 00:00:00 2001 From: Tayane Fernandes Date: Wed, 29 Mar 2017 18:49:16 -0300 Subject: [#927] Change account recovery tests to run against a non mocked application with @thaissiqueira --- service/test/functional/features/steps/signup.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'service/test/functional/features/steps/signup.py') diff --git a/service/test/functional/features/steps/signup.py b/service/test/functional/features/steps/signup.py index d89cbb97..2fa1773a 100644 --- a/service/test/functional/features/steps/signup.py +++ b/service/test/functional/features/steps/signup.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . +import uuid + from behave import given, then, when from common import ( @@ -23,22 +25,31 @@ from common import ( @given(u'a user is accessing the signup page') # noqa -def step_impl(context): +def access_signup_page(context): context.browser.get(context.signup_url) +@given(u'I am an existent Pixelated user') +def setup_user(context): + access_signup_page(context) + enter_user_information(context) + click_signup_button(context) + see_user_control_panel(context) + + @when(u'I enter username, password and password confirmation') # noqa -def step_impl(context): - fill_by_css_selector(context, '#srp_username', context.username) +def enter_user_information(context): + username = 'testuser_{}'.format(uuid.uuid4()) + fill_by_css_selector(context, '#srp_username', username) fill_by_css_selector(context, '#srp_password', 'password') fill_by_css_selector(context, '#srp_password_confirmation', 'password') @when(u'I click on the signup button') # noqa -def step_impl(context): +def click_signup_button(context): find_element_by_css_selector(context, 'input[type=submit]').click() @then(u'I should see the user control panel') # noqa -def step_impl(context): +def see_user_control_panel(context): element_should_have_content(context, 'h1', 'user control panel') -- cgit v1.2.3