From 29ceca884fbf50f4e5310404dfdaa4330979d0f8 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 28 Nov 2018 22:04:06 -0500 Subject: [PATCH] Fix selenium login test case --- client/galaxy/scripts/components/login/Login.vue | 6 +++--- test/galaxy_selenium/navigates_galaxy.py | 11 +++++------ test/galaxy_selenium/navigation.yml | 5 ++++- test/selenium_tests/test_login.py | 12 ++++-------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/client/galaxy/scripts/components/login/Login.vue b/client/galaxy/scripts/components/login/Login.vue index 840c5f772ac..d91f4bac083 100644 --- a/client/galaxy/scripts/components/login/Login.vue +++ b/client/galaxy/scripts/components/login/Login.vue @@ -3,13 +3,13 @@
- + - + - + Forgot password? Click here to reset your password. Login diff --git a/test/galaxy_selenium/navigates_galaxy.py b/test/galaxy_selenium/navigates_galaxy.py index d7f116bc5d2..3856880a246 100644 --- a/test/galaxy_selenium/navigates_galaxy.py +++ b/test/galaxy_selenium/navigates_galaxy.py @@ -376,12 +376,11 @@ class NavigatesGalaxy(HasDriver): self.click_masthead_user() self.wait_for_and_click(self.navigation.masthead.labels.login) - with self.main_panel(): - self.sleep_for(WAIT_TYPES.UX_RENDER) - form = self.wait_for_visible(self.navigation.login.selectors.form) - self.fill(form, login_info) - self.snapshot("logging-in") - self.click_submit(form) + self.sleep_for(WAIT_TYPES.UX_RENDER) + form = self.wait_for_visible(self.navigation.login.selectors.form) + self.fill(form, login_info) + self.snapshot("logging-in") + self.wait_for_and_click(self.navigation.login.selectors.submit) self.snapshot("login-submitted") if assert_valid: diff --git a/test/galaxy_selenium/navigation.yml b/test/galaxy_selenium/navigation.yml index 35159d4a9e9..879a7253a77 100644 --- a/test/galaxy_selenium/navigation.yml +++ b/test/galaxy_selenium/navigation.yml @@ -205,7 +205,10 @@ histories: login: selectors: - form: 'form#login' + form: 'form#login' + submit: + type: xpath + selector: "//button[@type='submit']" registration: selectors: diff --git a/test/selenium_tests/test_login.py b/test/selenium_tests/test_login.py index cbdac4fc3d1..4a954450c7f 100644 --- a/test/selenium_tests/test_login.py +++ b/test/selenium_tests/test_login.py @@ -13,8 +13,7 @@ class LoginTestCase(SeleniumTestCase): self.logout_if_needed() self.home() self.submit_login(email, assert_valid=True) - with self.main_panel(): - self.assert_no_error_message() + self.assert_no_error_message() assert self.is_logged_in() @selenium_test @@ -23,8 +22,7 @@ class LoginTestCase(SeleniumTestCase): for bad_email in bad_emails: self.home() self.submit_login(bad_email, assert_valid=False) - with self.main_panel(): - self.assert_error_message() + self.assert_error_message() @selenium_test def test_invalid_passwords(self): @@ -32,8 +30,7 @@ class LoginTestCase(SeleniumTestCase): for bad_password in bad_passwords: self.home() self.submit_login(self._get_random_email(), password=bad_password, assert_valid=False) - with self.main_panel(): - self.assert_error_message() + self.assert_error_message() @selenium_test def test_wrong_password(self): @@ -42,5 +39,4 @@ class LoginTestCase(SeleniumTestCase): self.logout_if_needed() self.home() self.submit_login(email, password="12345678", assert_valid=False) - with self.main_panel(): - self.assert_error_message() + self.assert_error_message()