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
05537540
Commit
05537540
authored
Feb 14, 2014
by
Julia Hansbrough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix acceptance tests
Fixed bok-choy acceptance tests
parent
b61649f9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
common/djangoapps/user_api/tests/test_models.py
+2
-1
common/test/acceptance/pages/lms/dashboard.py
+8
-0
common/test/acceptance/tests/test_lms.py
+15
-3
No files found.
common/djangoapps/user_api/tests/test_models.py
View file @
05537540
...
...
@@ -29,7 +29,8 @@ class UserPreferenceModelTest(TestCase):
)
def
test_get_set_preference
(
self
):
# tests for the getters and setters of preferences
# Checks that you can set a preference and get that preference later
# Also, tests that no preference is returned for keys that are not set
user
=
UserFactory
.
create
()
key
=
'testkey'
...
...
common/test/acceptance/pages/lms/dashboard.py
View file @
05537540
...
...
@@ -19,6 +19,14 @@ class DashboardPage(PageObject):
return
self
.
is_css_present
(
'section.my-courses'
)
@property
def
current_courses_text
(
self
):
text_items
=
self
.
css_text
(
'section#my-courses'
)
if
len
(
text_items
)
>
0
:
return
text_items
[
0
]
else
:
return
""
@property
def
available_courses
(
self
):
"""
Return list of the names of available courses (e.g. "999 edX Demonstration Course")
...
...
common/test/acceptance/tests/test_lms.py
View file @
05537540
...
...
@@ -6,7 +6,7 @@ E2E tests for the LMS.
from
unittest
import
skip
from
bok_choy.web_app_test
import
WebAppTest
from
bok_choy.promise
import
EmptyPromise
,
fulfill_before
from
bok_choy.promise
import
EmptyPromise
,
fulfill_before
,
fulfill
,
Promise
from
.helpers
import
UniqueCourseTest
,
load_data_str
from
..pages.studio.auto_auth
import
AutoAuthPage
...
...
@@ -74,6 +74,15 @@ class LanguageTest(UniqueCourseTest):
"""
Tests that the change language functionality on the dashboard works
"""
@property
def
_changed_lang_promise
(
self
):
def
_check_func
():
text
=
self
.
dashboard_page
.
current_courses_text
return
(
len
(
text
)
>
0
,
text
)
return
Promise
(
_check_func
,
"language changed"
)
def
setUp
(
self
):
"""
...
...
@@ -84,6 +93,8 @@ class LanguageTest(UniqueCourseTest):
self
.
test_new_lang
=
'eo'
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
# We store the string this way because Selenium seems to try and read in strings from
# the HTML in this format. Ideally we could just store the raw ÇÜRRÉNT ÇØÜRSÉS string here
self
.
current_courses_text
=
u'
\xc7\xdc
RR
\xc9
NT
\xc7\xd6\xdc
RS
\xc9
S'
self
.
username
=
"test"
...
...
@@ -113,9 +124,10 @@ class LanguageTest(UniqueCourseTest):
auto_auth_page
.
visit
()
self
.
dashboard_page
.
visit
()
changed_text
=
fulfill
(
self
.
_changed_lang_promise
)
# We should see the dummy-language text on the page
self
.
browser
.
is_text_present
(
self
.
current_courses_text
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
self
.
current_courses_text
))
self
.
assertIn
(
self
.
current_courses_text
,
changed_text
)
class
HighLevelTabTest
(
UniqueCourseTest
):
...
...
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