Commit dfdecfb6 by Braden MacDonald

Expand test coverage to mobile

parent f5f9f386
...@@ -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 given a maximum width",
"feedback": {"incorrect": "", "correct": ""}, "feedback": {"incorrect": "", "correct": ""},
"zone": "Zone 1/3", "zone": "Zone 1/3",
"imageURL": "", "imageURL": "",
......
...@@ -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):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment