예제 #1
0
class TestSetOEMApp(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestSetOEMApp, self).setUp()
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                                'tests.tablet.oem.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.oem = OEMImpl(self.config.read(cfg_file, 'default'))
        self.oem.setup_connection()
        self.oem.set_orientation_n()
        self.oem.wake_up()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestSetOEMApp, self).tearDown()
        self.wifi = None

    def testSet_oem_apps(self):
        """
        Set multi-apps by OEM
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.write_oem()
        self.oem.set_oem_app()
        self.oem.unwrite_oem()
        self.oem.reset_device()

        self.oem.check_set_apps()
예제 #2
0
class TestDefaultStaticWallpaper(UIATestBase):
    """
    Testing wifi enable
    """
    def setUp(self):
        super(TestDefaultStaticWallpaper, self).setUp()
        cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                                'tests.tablet.oem.conf')
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.oem = OEMImpl(self.config.read(cfg_file, 'default'))
        self.oem.setup_connection()
        self.oem.set_orientation_n()
        self.oem.wake_up()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestDefaultStaticWallpaper, self).tearDown()
        self.wifi = None

    def testDefault_static_wallpaper(self):
        """
        Default static Wallpaper
        """
        print "[RunTest] %s" % self.__str__()

        self.oem.launch_wallpaper()
        self.oem.change_wallpaper(5, "start.png")

        self.oem.write_oem()
        self.oem.set_default_wallpaper()
        self.oem.unwrite_oem()
        self.oem.reset_device()

        self.oem.take_picture("end.png")
        print "Compare the picture"
        base_path = self.oem.host_file_path + '/file/' + "start.png"
        new_path = self.oem.host_file_path + '/file/' + "end.png"
        print base_path
        from igascomparator import igascomparator
        comp = igascomparator()
        rate = comp.getsimilarityrate(new_path, base_path)
        print "Rate: %s" % rate
        print "Expect that pictures are not similar"
        assert (rate < 0.95)
        os.remove(base_path)
        os.remove(new_path)