From 8f07c10b906b5736a7330ba8eb42af6259e0797a Mon Sep 17 00:00:00 2001 From: NavaL Date: Thu, 28 Jan 2016 10:42:37 +0100 Subject: added ft step Issue #583 --- service/pixelated/assets/Interstitial.js | 2 +- service/test/functional/features/environment.py | 1 + service/test/functional/features/login.feature | 1 + service/test/functional/features/steps/login.py | 10 ++++++++++ service/test/support/integration/multi_user_client.py | 15 --------------- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/service/pixelated/assets/Interstitial.js b/service/pixelated/assets/Interstitial.js index cf9ef8e4..6fed8d78 100644 --- a/service/pixelated/assets/Interstitial.js +++ b/service/pixelated/assets/Interstitial.js @@ -45,7 +45,7 @@ $(function () { url: '/' }).success(function (data) { if (/Pixelated Mail/g.test(data)) { - window.location.reload(true); + window.location="/"; } }); }, 5000); diff --git a/service/test/functional/features/environment.py b/service/test/functional/features/environment.py index 3f478def..37b5d612 100644 --- a/service/test/functional/features/environment.py +++ b/service/test/functional/features/environment.py @@ -61,6 +61,7 @@ def after_all(context): def before_feature(context, feature): + # context.browser = webdriver.Chrome() # context.browser = webdriver.Firefox() context.browser = webdriver.PhantomJS() context.browser.set_window_size(1280, 1024) diff --git a/service/test/functional/features/login.feature b/service/test/functional/features/login.feature index 9a353d74..d22cc774 100644 --- a/service/test/functional/features/login.feature +++ b/service/test/functional/features/login.feature @@ -25,4 +25,5 @@ Feature: login and logout When I open the login page And I enter username and password as credentials And I click on the login button + Then I should see the fancy interstitial Then I have mails diff --git a/service/test/functional/features/steps/login.py b/service/test/functional/features/steps/login.py index 3c80e819..7f17567a 100644 --- a/service/test/functional/features/steps/login.py +++ b/service/test/functional/features/steps/login.py @@ -32,3 +32,13 @@ def enter_credentials(context, username, password): def click_login(context): login_button = wait_until_element_is_visible_by_locator(context, (By.CSS_SELECTOR, 'input[name="login"]')) login_button.click() + + +@then(u'I should see the fancy interstitial') +def step_impl(context): + assert find_element_by_css_selector(context, 'section#hive-section') + _wait_for_interstitial_to_reload() + + +def _wait_for_interstitial_to_reload(): + time.sleep(6) diff --git a/service/test/support/integration/multi_user_client.py b/service/test/support/integration/multi_user_client.py index 67b034cc..692dc5e9 100644 --- a/service/test/support/integration/multi_user_client.py +++ b/service/test/support/integration/multi_user_client.py @@ -14,32 +14,17 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . -import json -import shutil from leap.exceptions import SRPAuthenticationError -from leap.mail.imap.account import IMAPAccount from mockito import mock, when, any as ANY -from twisted.cred import portal -from twisted.cred.checkers import AllowAnonymousAccess from twisted.internet import defer from leap.auth import SRPAuth -from pixelated.adapter.mailstore.leap_attachment_store import LeapAttachmentStore -from pixelated.adapter.services.feedback_service import FeedbackService from pixelated.application import UserAgentMode, ServicesFactory, set_up_protected_resources -from pixelated.adapter.mailstore import LeapMailStore -from pixelated.adapter.mailstore.searchable_mailstore import SearchableMailStore - -from pixelated.adapter.search import SearchEngine -from pixelated.adapter.services.draft_service import DraftService from pixelated.bitmask_libraries.session import LeapSession, LeapSessionFactory import pixelated.config.services -# from pixelated.config.services import Services -from pixelated.resources.auth import LeapPasswordChecker, SessionChecker, PixelatedRealm, PixelatedAuthSessionWrapper -from pixelated.resources.login_resource import LoginResource from pixelated.resources.root_resource import RootResource from test.support.integration import AppTestClient from test.support.integration.app_test_client import initialize_soledad, AppTestAccount -- cgit v1.2.3