diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-11-30 17:36:39 -0200 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-11-30 17:36:39 -0200 |
commit | b6f60fd007efc84ef7cc2b63988448a61bbeb8d2 (patch) | |
tree | 4461d14d412fa6923b221b4cbfe21071273a7299 /service/test/functional/features/steps | |
parent | ab17f819d5b724b45927e559de7c5dc796cb7fa6 (diff) |
Add sign up smoke test
See: https://github.com/pixelated/project-issues/issues/381
Diffstat (limited to 'service/test/functional/features/steps')
-rw-r--r-- | service/test/functional/features/steps/login.py | 2 | ||||
-rw-r--r-- | service/test/functional/features/steps/signup.py | 45 |
2 files changed, 46 insertions, 1 deletions
diff --git a/service/test/functional/features/steps/login.py b/service/test/functional/features/steps/login.py index d1840900..a8db6f49 100644 --- a/service/test/functional/features/steps/login.py +++ b/service/test/functional/features/steps/login.py @@ -26,7 +26,7 @@ from common import ( @when(u'I open the login page') def login_page(context): - context.browser.get(context.multi_user_url + '/login') + context.browser.get(context.login_url) @when(u'I enter {username} and {password} as credentials') diff --git a/service/test/functional/features/steps/signup.py b/service/test/functional/features/steps/signup.py new file mode 100644 index 00000000..1252017c --- /dev/null +++ b/service/test/functional/features/steps/signup.py @@ -0,0 +1,45 @@ +# +# 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 <http://www.gnu.org/licenses/>. + +import uuid +from behave import given, then, when + +from common import ( + fill_by_css_selector, + find_element_by_css_selector) + + +@given(u'a user is accessing the signup page') # noqa +def step_impl(context): + context.browser.get(context.signup_url) + + +@when(u'I enter username, password and password confirmation') # noqa +def step_impl(context): + fill_by_css_selector(context, '#srp_username', 'testuser_{}'.format(uuid.uuid4())) + 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): + find_element_by_css_selector(context, 'button[type=submit]').click() + + +@then(u'I should see the user control panel') # noqa +def step_impl(context): + text = find_element_by_css_selector(context, 'h1').text + assert text == 'user control panel' |