Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6d9cfdcd
Commit
6d9cfdcd
authored
May 27, 2015
by
Alessandro Verdura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timestamp value test
TNL-925
parent
da683ca7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
common/test/acceptance/pages/studio/import_export.py
+11
-0
common/test/acceptance/tests/studio/test_import_export.py
+18
-2
No files found.
common/test/acceptance/pages/studio/import_export.py
View file @
6d9cfdcd
...
@@ -3,6 +3,7 @@ Import/Export pages.
...
@@ -3,6 +3,7 @@ Import/Export pages.
"""
"""
from
bok_choy.promise
import
EmptyPromise
from
bok_choy.promise
import
EmptyPromise
import
os
import
os
import
re
import
requests
import
requests
from
.utils
import
click_css
from
.utils
import
click_css
from
.library
import
LibraryPage
from
.library
import
LibraryPage
...
@@ -118,6 +119,16 @@ class ImportMixin(object):
...
@@ -118,6 +119,16 @@ class ImportMixin(object):
url_path
=
"import"
url_path
=
"import"
@property
def
timestamp
(
self
):
"""
The timestamp is displayed on the page as "(MM/DD/YYYY at HH:mm)"
It parses the timestamp and returns a (date, time) tuple
"""
string
=
self
.
q
(
css
=
'.item-progresspoint-success-date'
)
.
text
[
0
]
return
re
.
match
(
r'\(([^ ]+).+?(\d{2}:\d{2})'
,
string
)
.
groups
()
def
is_browser_on_page
(
self
):
def
is_browser_on_page
(
self
):
"""
"""
Verify this is the export page
Verify this is the export page
...
...
common/test/acceptance/tests/studio/test_import_export.py
View file @
6d9cfdcd
...
@@ -3,6 +3,7 @@ Acceptance tests for the Import and Export pages
...
@@ -3,6 +3,7 @@ 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
.base_studio_test
import
StudioLibraryTest
,
StudioCourseTest
from
.base_studio_test
import
StudioLibraryTest
,
StudioCourseTest
from
...fixtures.course
import
XBlockFixtureDesc
from
...fixtures.course
import
XBlockFixtureDesc
from
...pages.studio.import_export
import
ExportLibraryPage
,
ExportCoursePage
,
ImportLibraryPage
,
ImportCoursePage
from
...pages.studio.import_export
import
ExportLibraryPage
,
ExportCoursePage
,
ImportLibraryPage
,
ImportCoursePage
...
@@ -183,10 +184,25 @@ class ImportTestMixin(object):
...
@@ -183,10 +184,25 @@ 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
()
def
test_
successful_import_timestamp
(
self
):
def
test_
import_timestamp_value
(
self
):
"""
"""
Scenario: I perform a course / library import
Scenario: I perform a course / library import
On import success, the page displays its UTC timestamp previously not visible
On import success, the page displays a UTC timestamp
"""
self
.
import_page
.
upload_tarball
(
self
.
tarball_name
)
self
.
import_page
.
wait_for_upload
()
utc_now
=
datetime
.
utcnow
()
import_date
,
import_time
=
self
.
import_page
.
timestamp
self
.
assertTrue
(
self
.
import_page
.
is_timestamp_visible
())
self
.
assertEqual
(
utc_now
.
strftime
(
'
%
m/
%
d/
%
Y'
),
import_date
)
self
.
assertEqual
(
utc_now
.
strftime
(
'
%
H:
%
M'
),
import_time
)
def
test_import_timestamp_visibility
(
self
):
"""
Scenario: I perform a course / library import
On import success, the page displays a timestamp previously not visible
And if I refresh the page, the timestamp is still displayed
And if I refresh the page, the timestamp is still displayed
"""
"""
self
.
assertFalse
(
self
.
import_page
.
is_timestamp_visible
())
self
.
assertFalse
(
self
.
import_page
.
is_timestamp_visible
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment