Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
66e67621
Commit
66e67621
authored
Aug 06, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add integration tests that check size of root block dropdown and input
field containers.
parent
741de068
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
problem_builder/tests/integration/test_instructor_tool.py
+38
-0
No files found.
problem_builder/tests/integration/test_instructor_tool.py
View file @
66e67621
# -*- coding: utf-8 -*-
import
math
import
re
import
time
...
...
@@ -49,6 +50,9 @@ class InstructorToolTest(SeleniumXBlockTest):
self
.
set_scenario_xml
(
"""
<vertical_demo>
<pb-instructor-tool url_name="data_export"/>
<problem-builder mode="standard">
<pb-answer name="answer" question="Is this a long long long long long long long long long long question?" />
</problem-builder>
</vertical_demo>
"""
)
...
...
@@ -62,6 +66,40 @@ class InstructorToolTest(SeleniumXBlockTest):
'instructor_task.models'
:
MockInstructorTaskModelsModule
(),
})
@patch.object
(
InstructorToolBlock
,
'user_is_staff'
,
Mock
(
return_value
=
True
))
def
test_export_field_container_width
(
self
):
instructor_tool
=
self
.
go_to_view
()
export_field_container
=
instructor_tool
.
find_element_by_class_name
(
'data-export-field-container'
)
parent_div
=
export_field_container
.
find_element_by_xpath
(
'..'
)
export_field_container_width
=
export_field_container
.
size
[
'width'
]
parent_div_width
=
parent_div
.
size
[
'width'
]
self
.
assertTrue
(
export_field_container_width
<=
math
.
ceil
(
0.43
*
parent_div_width
))
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'instructor_task'
:
True
,
'instructor_task.models'
:
MockInstructorTaskModelsModule
(),
})
@patch.object
(
InstructorToolBlock
,
'user_is_staff'
,
Mock
(
return_value
=
True
))
def
test_root_block_select_width
(
self
):
instructor_tool
=
self
.
go_to_view
()
root_block_select
=
instructor_tool
.
find_element_by_name
(
'root_block_id'
)
parent_div
=
root_block_select
.
find_element_by_xpath
(
'../..'
)
root_block_select_width
=
root_block_select
.
size
[
'width'
]
parent_div_width
=
parent_div
.
size
[
'width'
]
self
.
assertTrue
(
root_block_select_width
<=
math
.
ceil
(
0.55
*
parent_div_width
))
@patch.dict
(
'sys.modules'
,
{
'problem_builder.tasks'
:
MockTasksModule
(
successful
=
True
),
'instructor_task'
:
True
,
'instructor_task.models'
:
MockInstructorTaskModelsModule
(),
})
@patch.object
(
InstructorToolBlock
,
'user_is_staff'
,
Mock
(
return_value
=
True
))
def
test_data_export_delete
(
self
):
instructor_tool
=
self
.
go_to_view
()
start_button
=
instructor_tool
.
find_element_by_class_name
(
'data-export-start'
)
...
...
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