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
c425531e
Commit
c425531e
authored
Nov 03, 2015
by
Andy Armstrong
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #750 from edx/andya/small-fixes
Fix acceptance tests, and minor doc tweaks
parents
1f80d7a3
6421c49d
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 @
c425531e
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
</div>
</div>
<div
class=
"staff-info__status ui-staff__content__section"
>
<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>
<caption
class=
"title"
>
{% trans "Learner Progress" %}
</caption>
...
...
openassessment/xblock/staff_area_mixin.py
View file @
c425531e
...
@@ -75,8 +75,8 @@ def require_course_staff(error_key, with_json_handler=False):
...
@@ -75,8 +75,8 @@ def require_course_staff(error_key, with_json_handler=False):
@wraps
(
func
)
@wraps
(
func
)
def
_wrapped
(
xblock
,
*
args
,
**
kwargs
):
# pylint: disable=C0111
def
_wrapped
(
xblock
,
*
args
,
**
kwargs
):
# pylint: disable=C0111
permission_errors
=
{
permission_errors
=
{
"STAFF_AREA"
:
xblock
.
_
(
u"You do not have permission to access the staff area"
),
"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 learner information."
),
"STUDENT_INFO"
:
xblock
.
_
(
u"You do not have permission to access
ORA
learner information."
),
}
}
if
not
xblock
.
is_course_staff
and
with_json_handler
:
if
not
xblock
.
is_course_staff
and
with_json_handler
:
...
...
requirements/test-acceptance.txt
View file @
c425531e
bok-choy==0.4.7
bok-choy==0.4.7
ddt==0.8.0
nose==1.3.3
nose==1.3.3
requirements/test.txt
View file @
c425531e
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
-r test-acceptance.txt
-r test-acceptance.txt
coverage==3.7.1
coverage==3.7.1
ddt==0.8.0
django-nose==1.4.1
django-nose==1.4.1
mock==1.0.1
mock==1.0.1
moto==0.2.22
moto==0.2.22
...
...
scripts/jenkins-acceptance-tests.sh
View file @
c425531e
...
@@ -29,7 +29,7 @@ if [ -z "$TEST_HOST" ]; then
...
@@ -29,7 +29,7 @@ if [ -z "$TEST_HOST" ]; then
exit
1
;
exit
1
;
fi
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
virtualenv venv
source
venv/bin/activate
source
venv/bin/activate
...
@@ -46,6 +46,6 @@ make test-acceptance
...
@@ -46,6 +46,6 @@ make test-acceptance
unset
SELENIUM_HOST
unset
SELENIUM_HOST
# AutoAuthPage times out in PhantomJS when using https, so switch to use http
# 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
make test-a11y
scripts/test-acceptance.sh
View file @
c425531e
...
@@ -18,8 +18,13 @@
...
@@ -18,8 +18,13 @@
cd
`
dirname
$BASH_SOURCE
`
&&
cd
..
cd
`
dirname
$BASH_SOURCE
`
&&
cd
..
if
[
-z
"
$BASE_URL
"
]
;
then
# Note: support BASE_URL as a synonym for ORA_SANDBOX_URL for backward compatibility
echo
"Error: BASE_URL must be set to point to your sandbox"
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
exit
1
fi
fi
...
...
test/acceptance/README.rst
View file @
c425531e
...
@@ -22,7 +22,7 @@ To use the tests:
...
@@ -22,7 +22,7 @@ To use the tests:
.. code:: bash
.. code:: bash
export
BASE
_URL=https://{USER}:{PASSWORD}@{SANDBOX}
export
ORA_SANDBOX
_URL=https://{USER}:{PASSWORD}@{SANDBOX}
3. Run the tests
3. Run the tests
...
...
test/acceptance/auto_auth.py
View file @
c425531e
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
Auto-auth page (used to automatically log in during testing).
Auto-auth page (used to automatically log in during testing).
"""
"""
import
os
import
re
import
re
import
urllib
import
urllib
from
bok_choy.page_object
import
PageObject
from
bok_choy.page_object
import
PageObject
import
os
ORA_SANDBOX_URL
=
os
.
environ
.
get
(
'ORA_SANDBOX_URL'
)
BASE_URL
=
os
.
environ
.
get
(
'BASE_URL'
)
class
AutoAuthPage
(
PageObject
):
class
AutoAuthPage
(
PageObject
):
...
@@ -58,7 +59,7 @@ class AutoAuthPage(PageObject):
...
@@ -58,7 +59,7 @@ class AutoAuthPage(PageObject):
"""
"""
Construct the URL.
Construct the URL.
"""
"""
url
=
BASE
_URL
+
"/auto_auth"
url
=
ORA_SANDBOX
_URL
+
"/auto_auth"
query_str
=
urllib
.
urlencode
(
self
.
_params
)
query_str
=
urllib
.
urlencode
(
self
.
_params
)
if
query_str
:
if
query_str
:
...
...
test/acceptance/pages.py
View file @
c425531e
"""
"""
Page objects for UI-level acceptance tests.
Page objects for UI-level acceptance tests.
"""
"""
import
os
from
bok_choy.page_object
import
PageObject
from
bok_choy.page_object
import
PageObject
from
bok_choy.promise
import
EmptyPromise
from
bok_choy.promise
import
EmptyPromise
import
os
ORA_SANDBOX_URL
=
os
.
environ
.
get
(
'ORA_SANDBOX_URL'
)
BASE_URL
=
os
.
environ
.
get
(
'BASE_URL'
)
class
PageConfigurationError
(
Exception
):
class
PageConfigurationError
(
Exception
):
...
@@ -33,7 +35,7 @@ class OpenAssessmentPage(PageObject):
...
@@ -33,7 +35,7 @@ class OpenAssessmentPage(PageObject):
@property
@property
def
url
(
self
):
def
url
(
self
):
return
"{base}/{loc}"
.
format
(
return
"{base}/{loc}"
.
format
(
base
=
BASE
_URL
,
base
=
ORA_SANDBOX
_URL
,
loc
=
self
.
_problem_location
loc
=
self
.
_problem_location
)
)
...
...
test/acceptance/tests.py
View file @
c425531e
...
@@ -209,6 +209,7 @@ class StudentTrainingTest(OpenAssessmentTest):
...
@@ -209,6 +209,7 @@ class StudentTrainingTest(OpenAssessmentTest):
self
.
fail
(
"Student training was not marked complete."
)
self
.
fail
(
"Student training was not marked complete."
)
@ddt.ddt
class
StaffAreaTest
(
OpenAssessmentTest
):
class
StaffAreaTest
(
OpenAssessmentTest
):
"""
"""
Test the staff area.
Test the staff area.
...
@@ -250,13 +251,13 @@ class StaffAreaTest(OpenAssessmentTest):
...
@@ -250,13 +251,13 @@ class StaffAreaTest(OpenAssessmentTest):
(
"staff-info"
,
"STAFF INFO"
),
(
"staff-info"
,
"STAFF INFO"
),
)
)
@ddt.unpack
@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
Given I am viewing the staff area of an ORA problem
Then none of the panels should be shown
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
Then only the related panel should be shown
When I click the close button in the panel
When I click the close button in the panel
Then none of the panels should be shown
Then none of the panels should be shown
...
@@ -269,15 +270,15 @@ class StaffAreaTest(OpenAssessmentTest):
...
@@ -269,15 +270,15 @@ class StaffAreaTest(OpenAssessmentTest):
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[])
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[])
# Click on the button and verify that the panel has opened
# 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
.
selected_button_names
,
[
button_label
])
self
.
assertEqual
(
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
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
# 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
.
selected_button_names
,
[])
self
.
assertEqual
(
self
.
staff_area_page
.
visible_staff_panels
,
[])
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