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
6d5e65c0
Commit
6d5e65c0
authored
Sep 24, 2014
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explanation and small optimizations to languagetest
parent
f94c677a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
common/test/acceptance/pages/lms/dashboard.py
+5
-0
common/test/acceptance/tests/test_lms.py
+5
-4
No files found.
common/test/acceptance/pages/lms/dashboard.py
View file @
6d5e65c0
...
@@ -21,6 +21,11 @@ class DashboardPage(PageObject):
...
@@ -21,6 +21,11 @@ class DashboardPage(PageObject):
@property
@property
def
courses_text
(
self
):
def
courses_text
(
self
):
"""
This is the title label for the section of the student dashboard that
shows all the courses that the student is enrolled in.
The string displayed is defined in lms/templates/dashboard.html.
"""
text_items
=
self
.
q
(
css
=
'section#my-courses span.my-courses-title-label'
)
.
text
text_items
=
self
.
q
(
css
=
'section#my-courses span.my-courses-title-label'
)
.
text
if
len
(
text_items
)
>
0
:
if
len
(
text_items
)
>
0
:
return
text_items
[
0
]
return
text_items
[
0
]
...
...
common/test/acceptance/tests/test_lms.py
View file @
6d5e65c0
...
@@ -6,6 +6,7 @@ E2E tests for the LMS.
...
@@ -6,6 +6,7 @@ E2E tests for the LMS.
from
textwrap
import
dedent
from
textwrap
import
dedent
from
unittest
import
skip
from
unittest
import
skip
from
bok_choy.web_app_test
import
WebAppTest
from
.helpers
import
UniqueCourseTest
,
load_data_str
from
.helpers
import
UniqueCourseTest
,
load_data_str
from
..pages.lms.auto_auth
import
AutoAuthPage
from
..pages.lms.auto_auth
import
AutoAuthPage
from
..pages.lms.find_courses
import
FindCoursesPage
from
..pages.lms.find_courses
import
FindCoursesPage
...
@@ -37,7 +38,7 @@ class RegistrationTest(UniqueCourseTest):
...
@@ -37,7 +38,7 @@ class RegistrationTest(UniqueCourseTest):
self
.
course_about_page
=
CourseAboutPage
(
self
.
browser
,
self
.
course_id
)
self
.
course_about_page
=
CourseAboutPage
(
self
.
browser
,
self
.
course_id
)
# Create a course to register for
# Create a course to register for
course_fix
=
CourseFixture
(
CourseFixture
(
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'org'
],
self
.
course_info
[
'number'
],
self
.
course_info
[
'run'
],
self
.
course_info
[
'display_name'
]
self
.
course_info
[
'run'
],
self
.
course_info
[
'display_name'
]
)
.
install
()
)
.
install
()
...
@@ -64,7 +65,7 @@ class RegistrationTest(UniqueCourseTest):
...
@@ -64,7 +65,7 @@ class RegistrationTest(UniqueCourseTest):
self
.
assertIn
(
self
.
course_info
[
'display_name'
],
course_names
)
self
.
assertIn
(
self
.
course_info
[
'display_name'
],
course_names
)
class
LanguageTest
(
UniqueCourse
Test
):
class
LanguageTest
(
WebApp
Test
):
"""
"""
Tests that the change language functionality on the dashboard works
Tests that the change language functionality on the dashboard works
"""
"""
...
@@ -87,7 +88,7 @@ class LanguageTest(UniqueCourseTest):
...
@@ -87,7 +88,7 @@ class LanguageTest(UniqueCourseTest):
self
.
email
=
"test@example.com"
self
.
email
=
"test@example.com"
def
test_change_lang
(
self
):
def
test_change_lang
(
self
):
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
)
.
visit
()
AutoAuthPage
(
self
.
browser
)
.
visit
()
self
.
dashboard_page
.
visit
()
self
.
dashboard_page
.
visit
()
# Change language to Dummy Esperanto
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
...
@@ -98,7 +99,7 @@ class LanguageTest(UniqueCourseTest):
...
@@ -98,7 +99,7 @@ class LanguageTest(UniqueCourseTest):
self
.
assertIn
(
self
.
courses_text
,
changed_text
)
self
.
assertIn
(
self
.
courses_text
,
changed_text
)
def
test_language_persists
(
self
):
def
test_language_persists
(
self
):
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
username
,
password
=
self
.
password
,
email
=
self
.
email
,
course_id
=
self
.
course_id
)
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
username
=
self
.
username
,
password
=
self
.
password
,
email
=
self
.
email
)
auto_auth_page
.
visit
()
auto_auth_page
.
visit
()
self
.
dashboard_page
.
visit
()
self
.
dashboard_page
.
visit
()
...
...
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