Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
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
xblock-drag-and-drop-v2
Commits
dfdecfb6
Commit
dfdecfb6
authored
Jan 18, 2016
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand test coverage to mobile
parent
f5f9f386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
tests/integration/data/test_sizing_template.json
+1
-1
tests/integration/test_sizing.py
+18
-5
No files found.
tests/integration/data/test_sizing_template.json
View file @
dfdecfb6
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
"id"
:
0
"id"
:
0
},
},
{
{
"displayName"
:
"Auto with long text that should wrap because draggables are give a maximum width"
,
"displayName"
:
"Auto with long text that should wrap because draggables are give
n
a maximum width"
,
"feedback"
:
{
"incorrect"
:
""
,
"correct"
:
""
},
"feedback"
:
{
"incorrect"
:
""
,
"correct"
:
""
},
"zone"
:
"Zone 1/3"
,
"zone"
:
"Zone 1/3"
,
"imageURL"
:
""
,
"imageURL"
:
""
,
...
...
tests/integration/test_sizing.py
View file @
dfdecfb6
...
@@ -75,7 +75,7 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest):
...
@@ -75,7 +75,7 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest):
return
"<vertical_demo>{}
\n
{}</vertical_demo>"
.
format
(
upper_block
,
lower_block
)
return
"<vertical_demo>{}
\n
{}</vertical_demo>"
.
format
(
upper_block
,
lower_block
)
DESKTOP_
EXPECTATIONS
=
[
EXPECTATIONS
=
[
# The text 'Auto' with no fixed size specified should be 5-20% wide
# The text 'Auto' with no fixed size specified should be 5-20% wide
Expectation
(
item_id
=
0
,
zone_id
=
ZONE_33
,
width_percent
=
[
5
,
20
]),
Expectation
(
item_id
=
0
,
zone_id
=
ZONE_33
,
width_percent
=
[
5
,
20
]),
# The long text with no fixed size specified should be wrapped at the maximum width
# The long text with no fixed size specified should be wrapped at the maximum width
...
@@ -94,13 +94,26 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest):
...
@@ -94,13 +94,26 @@ class SizingTests(InteractionTestBase, BaseIntegrationTest):
Expectation
(
item_id
=
8
,
zone_id
=
ZONE_50
,
fixed_width_percent
=
50
),
Expectation
(
item_id
=
8
,
zone_id
=
ZONE_50
,
fixed_width_percent
=
50
),
]
]
def
test_wide_image
(
self
):
def
test_wide_image
_desktop
(
self
):
""" Test the upper, larger, wide image in a desktop-sized window """
""" Test the upper, larger, wide image in a desktop-sized window """
self
.
_check_sizes
(
0
,
self
.
DESKTOP_
EXPECTATIONS
)
self
.
_check_sizes
(
0
,
self
.
EXPECTATIONS
)
def
test_square_image
(
self
):
def
test_square_image
_desktop
(
self
):
""" Test the lower, smaller, square image in a desktop-sized window """
""" Test the lower, smaller, square image in a desktop-sized window """
self
.
_check_sizes
(
1
,
self
.
DESKTOP_EXPECTATIONS
,
expected_img_width
=
500
)
self
.
_check_sizes
(
1
,
self
.
EXPECTATIONS
,
expected_img_width
=
500
)
def
_size_for_mobile
(
self
):
self
.
browser
.
set_window_size
(
375
,
627
)
# iPhone 6 viewport size
def
test_wide_image_mobile
(
self
):
""" Test the upper, larger, wide image in a mobile-sized window """
self
.
_size_for_mobile
()
self
.
_check_sizes
(
0
,
self
.
EXPECTATIONS
,
is_desktop
=
False
)
def
test_square_image_mobile
(
self
):
""" Test the lower, smaller, square image in a mobile-sized window """
self
.
_size_for_mobile
()
self
.
_check_sizes
(
1
,
self
.
EXPECTATIONS
,
expected_img_width
=
375
,
is_desktop
=
False
)
def
_check_width
(
self
,
item_description
,
item
,
container_width
,
expected_percent
):
def
_check_width
(
self
,
item_description
,
item
,
container_width
,
expected_percent
):
"""
"""
...
...
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