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
60b368e2
Commit
60b368e2
authored
Apr 06, 2016
by
Amir Qayyum Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unable to created ccx even if ccx_conn url is not set
parent
b9b87f9b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
2 deletions
+91
-2
common/test/acceptance/pages/lms/ccx_dashboard_page.py
+42
-0
common/test/acceptance/tests/lms/test_ccx.py
+46
-0
lms/envs/bok_choy.env.json
+2
-1
lms/templates/ccx/coach_dashboard.html
+1
-1
No files found.
common/test/acceptance/pages/lms/ccx_dashboard_page.py
0 → 100644
View file @
60b368e2
# -*- coding: utf-8 -*-
"""
CCX coach dashboard page
"""
from
bok_choy.promise
import
EmptyPromise
from
common.test.acceptance.pages.lms.course_page
import
CoursePage
class
CoachDashboardPage
(
CoursePage
):
"""
CCX coach dashboard, where ccx coach can manage a course.
"""
url_path
=
"ccx_coach"
def
is_browser_on_page
(
self
):
"""
check if ccx dashboard is open.
"""
return
self
.
q
(
css
=
'div.instructor-dashboard-wrapper-2'
)
.
present
def
is_browser_on_enrollment_page
(
self
):
"""
check if enrollment page in ccx dashboard is open.
"""
return
self
.
q
(
css
=
'div.batch-enrollment'
)
.
present
def
fill_ccx_name_text_box
(
self
,
ccx_name
):
"""
Fill in the form with the provided ccx name and submit it.
"""
ccx_name_selector
=
"#ccx_name"
create_ccx_button
=
"#create-ccx"
# Fill the ccx_name.
self
.
wait_for_element_visibility
(
ccx_name_selector
,
'CCX name field is visible'
)
self
.
q
(
css
=
ccx_name_selector
)
.
fill
(
ccx_name
)
# Verify create ccx button is present before clicking.
EmptyPromise
(
lambda
:
self
.
q
(
css
=
create_ccx_button
)
.
present
,
"Create a new Custom Course for edX"
)
.
fulfill
()
self
.
q
(
css
=
create_ccx_button
)
.
click
()
common/test/acceptance/tests/lms/test_ccx.py
0 → 100644
View file @
60b368e2
# -*- coding: utf-8 -*-
"""
End-to-end tests for the CCX dashboard.
"""
from
nose.plugins.attrib
import
attr
from
common.test.acceptance.fixtures.course
import
CourseFixture
from
common.test.acceptance.tests.helpers
import
UniqueCourseTest
,
EventsTestMixin
from
common.test.acceptance.pages.lms.auto_auth
import
AutoAuthPage
from
common.test.acceptance.pages.lms.ccx_dashboard_page
import
CoachDashboardPage
@attr
(
'shard_7'
)
class
CreateCCXCoachTest
(
EventsTestMixin
,
UniqueCourseTest
):
"""
Test ccx end to end process.
"""
USERNAME
=
"coach_tester"
EMAIL
=
"coach_tester@example.com"
def
setUp
(
self
):
super
(
CreateCCXCoachTest
,
self
)
.
setUp
()
self
.
course_info
.
update
({
"settings"
:
{
"enable_ccx"
:
"true"
}})
self
.
course_fixture
=
CourseFixture
(
**
self
.
course_info
)
.
install
()
self
.
coach_dashboard_page
=
CoachDashboardPage
(
self
.
browser
,
self
.
course_id
)
def
_auto_auth
(
self
,
username
,
email
):
"""
Logout and login with given credentials.
"""
AutoAuthPage
(
self
.
browser
,
username
=
username
,
email
=
email
,
course_id
=
self
.
course_id
,
staff
=
True
)
.
visit
()
def
test_create_ccx
(
self
):
"""
Assert that ccx created.
"""
ccx_name
=
"Test ccx"
self
.
_auto_auth
(
self
.
USERNAME
,
self
.
EMAIL
)
self
.
coach_dashboard_page
.
visit
()
self
.
coach_dashboard_page
.
fill_ccx_name_text_box
(
ccx_name
)
self
.
coach_dashboard_page
.
wait_for_page
()
# Assert that new ccx is created and we are on ccx dashboard/enrollment tab.
self
.
assertTrue
(
self
.
coach_dashboard_page
.
is_browser_on_enrollment_page
())
lms/envs/bok_choy.env.json
View file @
60b368e2
...
...
@@ -87,7 +87,8 @@
"AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING"
:
true
,
"ENABLE_COURSE_DISCOVERY"
:
true
,
"ENABLE_SPECIAL_EXAMS"
:
true
,
"SHOW_LANGUAGE_SELECTOR"
:
true
"SHOW_LANGUAGE_SELECTOR"
:
true
,
"CUSTOM_COURSES_EDX"
:
true
},
"FEEDBACK_SUBMISSION_EMAIL"
:
""
,
"GITHUB_REPO_ROOT"
:
"** OVERRIDDEN **"
,
...
...
lms/templates/ccx/coach_dashboard.html
View file @
60b368e2
...
...
@@ -167,7 +167,7 @@ from openedx.core.djangolib.js_utils import (
function
validateForm
(
form
)
{
var
newCCXName
=
$
(
form
).
find
(
'#ccx_name'
).
val
();
var
$errorMessage
=
$
(
'#ccx-create-message'
);
var
hasCcxConnector
=
$
{
has_ccx_connector
|
n
,
dump_js_escaped_json
};
var
hasCcxConnector
=
$
{
has_ccx_connector
|
n
,
dump_js_escaped_json
}
===
'true'
;
if
(
!
newCCXName
&&
!
hasCcxConnector
)
{
$errorMessage
.
text
(
"${_('Please enter a valid CCX name.') | n, js_escaped_string}"
);
...
...
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