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
0e697f97
Commit
0e697f97
authored
Aug 30, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
acceptance tests updated
parent
02de4609
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
lms/djangoapps/courseware/features/lti.feature
+5
-0
lms/djangoapps/courseware/features/lti.py
+61
-3
No files found.
lms/djangoapps/courseware/features/lti.feature
View file @
0e697f97
...
...
@@ -8,3 +8,7 @@ Feature: LTI component
Scenario
:
LTI component in LMS is rendered
Given
the course has a LTI component filled with correct data
Then
I view the LTI and it is rendered
Scenario
:
LTI component in LMS is rendered incorreclty
Given
the course has a LTI component filled with correct url and client_key, but incorrect client_secret
Then
I view the LTI but incorrect_signature warning is rendered
\ No newline at end of file
lms/djangoapps/courseware/features/lti.py
View file @
0e697f97
...
...
@@ -37,6 +37,31 @@ def lti_is_rendered(_step):
with
world
.
browser
.
get_iframe
(
'ltiLaunchFrame'
)
as
iframe
:
# iframe does not contain functions from terrain/ui_helpers.py
assert
iframe
.
is_element_present_by_css
(
'.result'
,
wait_time
=
5
)
assert
(
"This is LTI tool. Success."
==
world
.
retry_on_exception
(
lambda
:
iframe
.
find_by_css
(
'.result'
)[
0
]
.
text
,
max_attempts
=
5
))
@step
(
'I view the LTI but incorrect_signature warning is rendered'
)
def
incorrect_lti_is_rendered
(
_step
):
# lti div has class rendered
assert
world
.
is_css_present
(
'div.lti.rendered'
)
# error is hidden
assert
(
not
world
.
css_visible
(
'.error_message'
))
# iframe is visible
assert
world
.
css_visible
(
'iframe'
)
#inside iframe test content is presented
with
world
.
browser
.
get_iframe
(
'ltiLaunchFrame'
)
as
iframe
:
# iframe does not contain functions from terrain/ui_helpers.py
assert
iframe
.
is_element_present_by_css
(
'.result'
,
wait_time
=
5
)
assert
(
"Wrong LTI signature"
==
world
.
retry_on_exception
(
lambda
:
iframe
.
find_by_css
(
'.result'
)[
0
]
.
text
,
max_attempts
=
5
))
@step
(
'the course has a LTI component filled with correct data'
)
...
...
@@ -75,6 +100,25 @@ def view_default_lti(_step):
world
.
browser
.
visit
(
url
)
@step
(
'the course has a LTI component filled with correct url
\
and client_key, but incorrect client_secret'
)
def
view_wrong_data_lti
(
_step
):
coursenum
=
'test_course'
i_am_registered_for_the_course
(
_step
,
coursenum
)
wrong_data_lti_to_course
(
coursenum
)
chapter_name
=
world
.
scenario_dict
[
'SECTION'
]
.
display_name
.
replace
(
" "
,
"_"
)
section_name
=
chapter_name
url
=
django_url
(
'/courses/
%
s/
%
s/
%
s/courseware/
%
s/
%
s'
%
(
world
.
scenario_dict
[
'COURSE'
]
.
org
,
world
.
scenario_dict
[
'COURSE'
]
.
number
,
world
.
scenario_dict
[
'COURSE'
]
.
display_name
.
replace
(
' '
,
'_'
),
chapter_name
,
section_name
,)
)
world
.
browser
.
visit
(
url
)
def
add_correct_lti_to_course
(
course
):
category
=
'lti'
world
.
ItemFactory
.
create
(
...
...
@@ -82,9 +126,9 @@ def add_correct_lti_to_course(course):
category
=
category
,
display_name
=
'LTI'
,
metadata
=
{
'client_key'
:
'client_key'
,
'cl
ent_secret'
:
'client_secret'
,
'lti_url'
:
'http://127.0.0.1:{}/correct_lti_endpoint'
.
format
(
world
.
lti_server_port
)
'client_key'
:
world
.
lti_server
.
oauth_settings
[
'client_key'
]
,
'cl
ient_secret'
:
world
.
lti_server
.
oauth_settings
[
'client_secret'
]
,
'lti_url'
:
world
.
lti_server
.
oauth_settings
[
'lti_base'
]
+
world
.
lti_server
.
oauth_settings
[
'lti_endpoint'
]
}
)
...
...
@@ -96,3 +140,17 @@ def add_default_lti_to_course(course):
category
=
category
,
display_name
=
'LTI'
)
def
wrong_data_lti_to_course
(
course
):
category
=
'lti'
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
category
=
category
,
display_name
=
'LTI'
,
metadata
=
{
'client_key'
:
world
.
lti_server
.
oauth_settings
[
'client_key'
],
'client_secret'
:
"wrong_secret"
,
'lti_url'
:
world
.
lti_server
.
oauth_settings
[
'lti_base'
]
+
world
.
lti_server
.
oauth_settings
[
'lti_endpoint'
]
}
)
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