diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-11-30 19:11:57 -0200 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-11-30 19:25:23 -0200 |
commit | 8372b0127343df96cbe1ca33477ea0f197a873be (patch) | |
tree | b052911125e6cd3036a650c97a510152a3147797 /service/test/functional/features/steps/login.py | |
parent | a8a7362054f4b49ea1fbc00fe7b556e6e6ea4590 (diff) |
Add username to behave context
See: https://github.com/pixelated/project-issues/issues/381
Diffstat (limited to 'service/test/functional/features/steps/login.py')
-rw-r--r-- | service/test/functional/features/steps/login.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/service/test/functional/features/steps/login.py b/service/test/functional/features/steps/login.py index a8db6f49..e773c0b1 100644 --- a/service/test/functional/features/steps/login.py +++ b/service/test/functional/features/steps/login.py @@ -15,15 +15,14 @@ # along with Pixelated. If not, see <http://www.gnu.org/licenses/>. import time -from behave import when, then -from selenium.webdriver.common.by import By +from behave import given, when, then from common import ( fill_by_css_selector, - find_element_by_css_selector, - wait_until_element_is_visible_by_locator) + find_element_by_css_selector) +@given(u'a user is accessing the login page') @when(u'I open the login page') def login_page(context): context.browser.get(context.login_url) @@ -31,13 +30,13 @@ def login_page(context): @when(u'I enter {username} and {password} as credentials') def enter_credentials(context, username, password): - fill_by_css_selector(context, 'input#email', username) + fill_by_css_selector(context, 'input#email', context.username) fill_by_css_selector(context, 'input#password', password) @when(u'I click on the login button') def click_login(context): - login_button = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, 'input[name="login"]')) + login_button = find_element_by_css_selector(context, 'input[name="login"]') login_button.click() @@ -53,7 +52,7 @@ def _wait_for_interstitial_to_reload(): @when(u'I logout') def click_logout(context): - logout_button = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, 'ul#logout')) + logout_button = find_element_by_css_selector(context, 'ul#logout') logout_button.click() |