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/utils.py | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 service/test/functional/features/steps/utils.py (limited to 'service/test/functional/features/steps/utils.py') diff --git a/service/test/functional/features/steps/utils.py b/service/test/functional/features/steps/utils.py new file mode 100644 index 00000000..7a066b91 --- /dev/null +++ b/service/test/functional/features/steps/utils.py @@ -0,0 +1,55 @@ +# +# Copyright (c) 2016 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# 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 ( + element_should_have_content, + fill_by_css_selector, + find_element_by_css_selector) + + +def access_signup_page(context): + context.browser.get(context.signup_url) + + +def create_user(context): + context.browser.get(context.login_url) + access_signup_page(context) + enter_user_information(context) + click_signup_button(context) + see_user_control_panel(context) + log_out(context) + + +def log_out(context): + find_element_by_css_selector(context, 'a[href="/logout"]').click() + + +def enter_user_information(context): + fill_by_css_selector(context, '#srp_username', context.username) + fill_by_css_selector(context, '#srp_password', 'password') + fill_by_css_selector(context, '#srp_password_confirmation', 'password') + + +def click_signup_button(context): + find_element_by_css_selector(context, 'input[type=submit]').click() + + +def see_user_control_panel(context): + element_should_have_content(context, 'h1', 'user control panel') -- cgit v1.2.3