summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-28 10:42:37 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-28 10:43:14 +0100
commit8f07c10b906b5736a7330ba8eb42af6259e0797a (patch)
tree8b197f62a183126f83591e21c83a95ec08c7703a
parent766c5617007650d90f1d249aaa253755dcd1906c (diff)
added ft step
Issue #583
-rw-r--r--service/pixelated/assets/Interstitial.js2
-rw-r--r--service/test/functional/features/environment.py1
-rw-r--r--service/test/functional/features/login.feature1
-rw-r--r--service/test/functional/features/steps/login.py10
-rw-r--r--service/test/support/integration/multi_user_client.py15
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 <http://www.gnu.org/licenses/>.
-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