示例#1
0
class TestDivider(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_create_delete_divider(self):
        """
        https://moztrap.mozilla.org/manage/case/13082/
        https://moztrap.mozilla.org/manage/case/13096/
        """

        self.homescreen.wait_for_number_of_apps(7)
        initial_number_of_dividers = len(self.homescreen.divider_elements)

        # Move last app to last divider
        app_position = len(self.homescreen.app_elements) - 1
        divider_position = initial_number_of_dividers - 1
        self.homescreen.move_to_divider(app_position, divider_position)
        self.assertTrue(self.homescreen.is_edit_mode_active,
                        "Edit mode should be active")

        # Exit edit mode
        self.device.touch_home_button()
        self.assertEqual(initial_number_of_dividers + 1,
                         len(self.homescreen.divider_elements))

        # Move last app to lastApp - 1 so that the new divider is removed
        self.homescreen.move_app_to_position(app_position, app_position - 1)

        # Exit edit mode
        self.device.touch_home_button()
        self.assertEqual(initial_number_of_dividers,
                         len(self.homescreen.divider_elements))
class TestMoveApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_move_app_position(self):
        """Verify the user can move an application around on the homescreen.

        https://moztrap.mozilla.org/manage/case/1317/
        """

        # Go to app page
        self.homescreen.go_to_next_page()
        first_app_before_move = self.homescreen.visible_apps[0].name

        # Activate edit mode
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")
        self.homescreen.activate_edit_mode()
        self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active")

        # Move first app to position 12
        self.homescreen.move_app_to_position(0, 12)

        # Exit edit mode
        self.device.touch_home_button()
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")

        # Check the app order and that the app on position 12 is the right one
        first_app_after_move = self.homescreen.visible_apps[0].name
        self.assertNotEqual(first_app_before_move, first_app_after_move)
        self.assertEqual(first_app_before_move, self.homescreen.visible_apps[12].name)
示例#3
0
class TestMoveApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.homescreen.launch()

    def test_move_app_position(self):
        """
        Verify the user can move an application around on the homescreen.
        https://moztrap.mozilla.org/manage/case/1317/
        """

        # Go to app page
        self.homescreen.go_to_next_page()
        first_app_before_move = self.homescreen.visible_apps[0].name

        # Activate edit mode
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")
        self.homescreen.activate_edit_mode()
        self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active")

        # Move first app to position 12
        self.homescreen.move_app_to_position(0, 12)

        # Exit edit mode
        self.homescreen.touch_home_button()
        self.homescreen.switch_to_homescreen_frame()
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")

        # Check the app order and that the app on position 12 is the right one
        first_app_after_move = self.homescreen.visible_apps[0].name
        self.assertNotEqual(first_app_before_move, first_app_after_move)
        self.assertEqual(first_app_before_move, self.homescreen.visible_apps[12].name)
示例#4
0
class TestDivider(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_create_delete_divider(self):
        """
        https://moztrap.mozilla.org/manage/case/13082/
        https://moztrap.mozilla.org/manage/case/13096/
        """

        self.homescreen.wait_for_number_of_apps(7)
        initial_number_of_dividers = len(self.homescreen.divider_elements)

        # Move last app to last divider
        app_position = len(self.homescreen.app_elements) - 1
        divider_position = initial_number_of_dividers - 1
        self.homescreen.move_to_divider(app_position, divider_position)
        self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active")

        # Exit edit mode
        self.device.touch_home_button()
        self.assertEqual(initial_number_of_dividers + 1, len(self.homescreen.divider_elements))

        # Move last app to lastApp - 1 so that the new divider is removed
        self.homescreen.move_app_to_position(app_position, app_position - 1)

        # Exit edit mode
        self.device.touch_home_button()
        self.assertEqual(initial_number_of_dividers, len(self.homescreen.divider_elements))
示例#5
0
class TestMoveApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_move_app_position(self):
        """
        https://moztrap.mozilla.org/manage/case/1317/
        """

        self.homescreen.wait_for_number_of_apps(1)
        first_app_before_move = self.homescreen.visible_apps[0].name

        # Assert that we are not in edit mode.
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")

        # Move first app to position 3 (index 2)
        self.homescreen.move_app_to_position(0, 2)

        # Assert that we are in edit mode.
        self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active")

        # Exit edit mode
        self.device.touch_home_button()
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")

        # Check the app order and that the app on position 12 is the right one
        first_app_after_move = self.homescreen.visible_apps[0].name
        self.assertNotEqual(first_app_before_move, first_app_after_move)
        self.assertEqual(first_app_before_move, self.homescreen.visible_apps[2].name)
示例#6
0
class TestMoveApp(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_move_app_position(self):
        """
        https://moztrap.mozilla.org/manage/case/1317/
        """

        self.homescreen.wait_for_number_of_apps(1)
        first_app_before_move = self.homescreen.visible_apps[0].manifest_url
        self.homescreen.move_app_to_position(0, 2)

        first_app_after_move = self.homescreen.visible_apps[0].manifest_url
        self.assertNotEqual(first_app_before_move, first_app_after_move)
        self.assertEqual(first_app_before_move, self.homescreen.visible_apps[2].manifest_url)
示例#7
0
class testDragDrop(GaiaImageCompareTestCase):
    _homescreen_locator = (By.CLASS_NAME, "theme-media")

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_drag_drop(self):

        self.take_screenshot()
        self.homescreen.wait_for_number_of_apps(1)

        # Assert that we are not in edit mode.
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")

        # Move first app to position 3 (index 2) and to position 4
        self.homescreen.move_app_to_position(0, 2)
        self.take_screenshot()
        self.homescreen.move_app_to_position(2, 3)
        self.take_screenshot()
        self.homescreen.move_app_to_position(5, 4)
        self.take_screenshot()

        # Assert that we are in edit mode.
        self.assertTrue(self.homescreen.is_edit_mode_active, "Edit mode should be active")

        # Exit edit mode
        self.device.touch_home_button()
        self.assertFalse(self.homescreen.is_edit_mode_active, "Edit mode should not be active")
示例#8
0
class testDragDrop(GaiaImageCompareTestCase):
    _homescreen_locator = (By.CLASS_NAME, 'theme-media')

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_drag_drop(self):

        self.homescreen.wait_for_number_of_apps(1)

        # Assert that we are not in edit mode.
        self.assertFalse(self.homescreen.is_edit_mode_active,
                         "Edit mode should not be active")

        # Move first app to position 3 (index 2) and to position 4
        self.homescreen.move_app_to_position(0, 2)
        self.take_screenshot()
        self.homescreen.move_app_to_position(2, 3)
        self.take_screenshot()
        self.homescreen.move_app_to_position(5, 4)
        self.take_screenshot()

        # Assert that we are in edit mode.
        self.assertTrue(self.homescreen.is_edit_mode_active,
                        "Edit mode should be active")

        # Exit edit mode
        self.device.touch_home_button()
        self.assertFalse(self.homescreen.is_edit_mode_active,
                         "Edit mode should not be active")
示例#9
0
class testDragDrop(GaiaImageCompareTestCase):
    _homescreen_locator = (By.CLASS_NAME, 'theme-media')

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_drag_drop(self):

        self.homescreen.wait_for_number_of_apps(1)
        
        # Move first app to position 3 (index 2) and to position 4
        self.homescreen.move_app_to_position(0, 2)
        self.take_screenshot()
        self.homescreen.move_app_to_position(2, 3)
        self.take_screenshot()
        self.homescreen.move_app_to_position(5, 4)
        self.take_screenshot()
        self.homescreen.move_app_to_position(9, 0)
        self.take_screenshot()
示例#10
0
class testDragDrop(GaiaImageCompareTestCase):
    _homescreen_locator = (By.CLASS_NAME, 'theme-media')

    def setUp(self):
        GaiaImageCompareTestCase.setUp(self)

        self.homescreen = Homescreen(self.marionette)
        self.apps.switch_to_displayed_app()

    def test_drag_drop(self):

        self.homescreen.wait_for_number_of_apps(1)

        # Move first app to position 3 (index 2) and to position 4
        self.homescreen.move_app_to_position(0, 2)
        self.take_screenshot()
        self.homescreen.move_app_to_position(2, 3)
        self.take_screenshot()
        self.homescreen.move_app_to_position(5, 4)
        self.take_screenshot()
        self.homescreen.move_app_to_position(9, 0)
        self.take_screenshot()