Commit 923edee1 by cahrens Committed by Andy Armstrong

Fix flaky test_import_timestamp test.

TNL-2386
parent aa76d948
...@@ -239,10 +239,16 @@ class ImportMixin(object): ...@@ -239,10 +239,16 @@ class ImportMixin(object):
def is_timestamp_visible(self): def is_timestamp_visible(self):
""" """
Checks if the UTC timestamp of the last successfull import is visible Checks if the UTC timestamp of the last successful import is visible
""" """
return self.q(css='.item-progresspoint-success-date').visible return self.q(css='.item-progresspoint-success-date').visible
def wait_for_timestamp_visible(self):
"""
Wait for the timestamp of the last successful import to be visible.
"""
EmptyPromise(self.is_timestamp_visible, 'Timestamp Visible', timeout=30).fulfill()
def wait_for_filename_error(self): def wait_for_filename_error(self):
""" """
Wait for the upload field to display an error. Wait for the upload field to display an error.
......
...@@ -4,7 +4,6 @@ Acceptance tests for the Import and Export pages ...@@ -4,7 +4,6 @@ Acceptance tests for the Import and Export pages
from abc import abstractmethod from abc import abstractmethod
from bok_choy.promise import EmptyPromise from bok_choy.promise import EmptyPromise
from datetime import datetime from datetime import datetime
from flaky import flaky
from .base_studio_test import StudioLibraryTest, StudioCourseTest from .base_studio_test import StudioLibraryTest, StudioCourseTest
from ...fixtures.course import XBlockFixtureDesc from ...fixtures.course import XBlockFixtureDesc
...@@ -186,7 +185,6 @@ class ImportTestMixin(object): ...@@ -186,7 +185,6 @@ class ImportTestMixin(object):
self.import_page.upload_tarball(self.tarball_name) self.import_page.upload_tarball(self.tarball_name)
self.import_page.wait_for_upload() self.import_page.wait_for_upload()
@flaky # TODO: fix this. See TNL-2386
def test_import_timestamp(self): def test_import_timestamp(self):
""" """
Scenario: I perform a course / library import Scenario: I perform a course / library import
...@@ -200,13 +198,13 @@ class ImportTestMixin(object): ...@@ -200,13 +198,13 @@ class ImportTestMixin(object):
utc_now = datetime.utcnow() utc_now = datetime.utcnow()
import_date, import_time = self.import_page.timestamp import_date, import_time = self.import_page.timestamp
self.assertTrue(self.import_page.is_timestamp_visible()) self.import_page.wait_for_timestamp_visible()
self.assertEqual(utc_now.strftime('%m/%d/%Y'), import_date) self.assertEqual(utc_now.strftime('%m/%d/%Y'), import_date)
self.assertEqual(utc_now.strftime('%H:%M'), import_time) self.assertEqual(utc_now.strftime('%H:%M'), import_time)
self.import_page.visit() self.import_page.visit()
self.import_page.wait_for_tasks(completed=True) self.import_page.wait_for_tasks(completed=True)
self.assertTrue(self.import_page.is_timestamp_visible()) self.import_page.wait_for_timestamp_visible()
def test_landing_url(self): def test_landing_url(self):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment