Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
6421c49d
Commit
6421c49d
authored
Nov 03, 2015
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix acceptance tests, and minor doc tweaks
parent
1f80d7a3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
21 deletions
+30
-21
openassessment/templates/openassessmentblock/staff_area/staff_area.html
+1
-1
openassessment/xblock/staff_area_mixin.py
+2
-2
requirements/test-acceptance.txt
+1
-0
requirements/test.txt
+0
-1
scripts/jenkins-acceptance-tests.sh
+2
-2
scripts/test-acceptance.sh
+7
-2
test/acceptance/README.rst
+1
-1
test/acceptance/auto_auth.py
+4
-3
test/acceptance/pages.py
+5
-3
test/acceptance/tests.py
+7
-6
No files found.
openassessment/templates/openassessmentblock/staff_area/staff_area.html
View file @
6421c49d
...
...
@@ -103,7 +103,7 @@
</div>
<div
class=
"staff-info__status ui-staff__content__section"
>
<table
class=
"staff-info__status__table"
summary=
"{% trans "
Where
are
your
learners
currently
in
this
problem
"
%}"
>
<table
class=
"staff-info__status__table"
>
<caption
class=
"title"
>
{% trans "Learner Progress" %}
</caption>
...
...
openassessment/xblock/staff_area_mixin.py
View file @
6421c49d
...
...
@@ -75,8 +75,8 @@ def require_course_staff(error_key, with_json_handler=False):
@wraps
(
func
)
def
_wrapped
(
xblock
,
*
args
,
**
kwargs
):
# pylint: disable=C0111
permission_errors
=
{
"STAFF_AREA"
:
xblock
.
_
(
u"You do not have permission to access the staff area"
),
"STUDENT_INFO"
:
xblock
.
_
(
u"You do not have permission to access learner information."
),
"STAFF_AREA"
:
xblock
.
_
(
u"You do not have permission to access the
ORA
staff area"
),
"STUDENT_INFO"
:
xblock
.
_
(
u"You do not have permission to access
ORA
learner information."
),
}
if
not
xblock
.
is_course_staff
and
with_json_handler
:
...
...
requirements/test-acceptance.txt
View file @
6421c49d
bok-choy==0.4.7
ddt==0.8.0
nose==1.3.3
requirements/test.txt
View file @
6421c49d
...
...
@@ -2,7 +2,6 @@
-r test-acceptance.txt
coverage==3.7.1
ddt==0.8.0
django-nose==1.4.1
mock==1.0.1
moto==0.2.22
...
...
scripts/jenkins-acceptance-tests.sh
View file @
6421c49d
...
...
@@ -29,7 +29,7 @@ if [ -z "$TEST_HOST" ]; then
exit
1
;
fi
export
BASE
_URL
=
"https://
${
BASIC_AUTH_USER
}
:
${
BASIC_AUTH_PASSWORD
}
@
${
TEST_HOST
}
"
export
ORA_SANDBOX
_URL
=
"https://
${
BASIC_AUTH_USER
}
:
${
BASIC_AUTH_PASSWORD
}
@
${
TEST_HOST
}
"
virtualenv venv
source
venv/bin/activate
...
...
@@ -46,6 +46,6 @@ make test-acceptance
unset
SELENIUM_HOST
# AutoAuthPage times out in PhantomJS when using https, so switch to use http
export
BASE
_URL
=
"http://
${
BASIC_AUTH_USER
}
:
${
BASIC_AUTH_PASSWORD
}
@
${
TEST_HOST
}
"
export
ORA_SANDBOX
_URL
=
"http://
${
BASIC_AUTH_USER
}
:
${
BASIC_AUTH_PASSWORD
}
@
${
TEST_HOST
}
"
make test-a11y
scripts/test-acceptance.sh
View file @
6421c49d
...
...
@@ -18,8 +18,13 @@
cd
`
dirname
$BASH_SOURCE
`
&&
cd
..
if
[
-z
"
$BASE_URL
"
]
;
then
echo
"Error: BASE_URL must be set to point to your sandbox"
# Note: support BASE_URL as a synonym for ORA_SANDBOX_URL for backward compatibility
if
[[
$BASE_URL
]]
;
then
export
ORA_SANDBOX_URL
=
"
$BASE_URL
"
fi
if
[[
-z
$ORA_SANDBOX_URL
]]
;
then
echo
"Error: ORA_SANDBOX_URL must be set to point to your sandbox"
exit
1
fi
...
...
test/acceptance/README.rst
View file @
6421c49d
...
...
@@ -22,7 +22,7 @@ To use the tests:
.. code:: bash
export
BASE
_URL=https://{USER}:{PASSWORD}@{SANDBOX}
export
ORA_SANDBOX
_URL=https://{USER}:{PASSWORD}@{SANDBOX}
3. Run the tests
...
...
test/acceptance/auto_auth.py
View file @
6421c49d
...
...
@@ -2,12 +2,13 @@
Auto-auth page (used to automatically log in during testing).
"""
import
os
import
re
import
urllib
from
bok_choy.page_object
import
PageObject
import
os
BASE_URL
=
os
.
environ
.
get
(
'BASE_URL'
)
ORA_SANDBOX_URL
=
os
.
environ
.
get
(
'ORA_SANDBOX_URL'
)
class
AutoAuthPage
(
PageObject
):
...
...
@@ -58,7 +59,7 @@ class AutoAuthPage(PageObject):
"""
Construct the URL.
"""
url
=
BASE
_URL
+
"/auto_auth"
url
=
ORA_SANDBOX
_URL
+
"/auto_auth"
query_str
=
urllib
.
urlencode
(
self
.
_params
)
if
query_str
:
...
...
test/acceptance/pages.py
View file @
6421c49d
"""
Page objects for UI-level acceptance tests.
"""
import
os
from
bok_choy.page_object
import
PageObject
from
bok_choy.promise
import
EmptyPromise
import
os
BASE_URL
=
os
.
environ
.
get
(
'BASE_URL'
)
ORA_SANDBOX_URL
=
os
.
environ
.
get
(
'ORA_SANDBOX_URL'
)
class
PageConfigurationError
(
Exception
):
...
...
@@ -33,7 +35,7 @@ class OpenAssessmentPage(PageObject):
@property
def
url
(
self
):
return
"{base}/{loc}"
.
format
(
base
=
BASE
_URL
,
base
=
ORA_SANDBOX
_URL
,
loc
=
self
.
_problem_location
)
...
...
test/acceptance/tests.py
View file @
6421c49d
...
...
@@ -209,6 +209,7 @@ class StudentTrainingTest(OpenAssessmentTest):
self
.
fail
(
"Student training was not marked complete."
)
@ddt.ddt
class
StaffAreaTest
(
OpenAssessmentTest
):
"""
Test the staff area.
...
...
@@ -250,13 +251,13 @@ class StaffAreaTest(OpenAssessmentTest):
(
"staff-info"
,
"STAFF INFO"
),
)
@ddt.unpack
def
test_staff_
tools_panel
(
self
,
button
_name
,
button_label
):
def
test_staff_
area_panel
(
self
,
panel
_name
,
button_label
):
"""
Scenario: the staff
tools panel
should be shown correctly
Scenario: the staff
area panels
should be shown correctly
Given I am viewing the staff area of an ORA problem
Then none of the panels should be shown
When I click
the
staff button
When I click
a
staff button
Then only the related panel should be shown
When I click the close button in the panel
Then none of the panels should be shown
...
...
@@ -269,15 +270,15 @@ class StaffAreaTest(OpenAssessmentTest):
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[])
# Click on the button and verify that the panel has opened
self
.
staff_area_page
.
click_staff_toolbar_button
(
button
_name
)
self
.
staff_area_page
.
click_staff_toolbar_button
(
panel
_name
)
self
.
assertEqual
(
self
.
staff_area_page
.
selected_button_names
,
[
button_label
])
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[
u'openassessment__{button_name}'
.
format
(
button_name
=
button
_name
)]
[
u'openassessment__{button_name}'
.
format
(
button_name
=
panel
_name
)]
)
# Click 'Close' and verify that the panel has been closed
self
.
staff_area_page
.
click_staff_panel_close_button
(
"staff-tools"
)
self
.
staff_area_page
.
click_staff_panel_close_button
(
panel_name
)
self
.
assertEqual
(
self
.
staff_area_page
.
selected_button_names
,
[])
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[])
...
...
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