Esempio n. 1
0
 def setup_method(self, method) -> None:  # type: ignore
     desired_caps = desired_capabilities.get_desired_capabilities(
         'ApiDemos-debug.apk.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
     if is_ci():
         self.driver.start_recording_screen()
Esempio n. 2
0
 def teardown_method(self, method) -> None:  # type: ignore
     if is_ci():
         payload = self.driver.stop_recording_screen()
         video_path = os.path.join(os.getcwd(), method.__name__ + '.mp4')
         with open(video_path, "wb") as fd:
             fd.write(base64.b64decode(payload))
     self.driver.quit()
Esempio n. 3
0
 def setUp(self):
     desired_caps = desired_capabilities.get_desired_capabilities(
         'ApiDemos-debug.apk.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
     if is_ci():
         self.driver.start_recording_screen()
Esempio n. 4
0
 def setup_method(self) -> None:
     desired_caps = desired_capabilities.get_desired_capabilities(
         'UICatalog.app.zip')
     self.driver = webdriver.Remote('http://localhost:4723/wd/hub',
                                    desired_caps)
     if is_ci():
         self.driver.start_recording_screen()
Esempio n. 5
0
 def tearDown(self):
     if is_ci():
         payload = self.driver.stop_recording_screen()
         video_path = os.path.join(os.getcwd(),
                                   self._testMethodName + '.mp4')
         with open(video_path, "wb") as fd:
             fd.write(base64.b64decode(payload))
     self.driver.quit()
Esempio n. 6
0
    def test_element_find_single_element(self):
        if is_ci():
            self.skipTest('Need to fix flaky test during running on CI')
        wait_for_element(self.driver, MobileBy.ANDROID_UIAUTOMATOR,
                         'new UiSelector().text("Accessibility")').click()
        wait_for_element(
            self.driver, MobileBy.ANDROID_UIAUTOMATOR,
            'new UiSelector().text("Accessibility Node Querying")').click()
        el = wait_for_element(self.driver, MobileBy.CLASS_NAME,
                              'android.widget.ListView')

        sub_el = el.find_element_by_accessibility_id('Task Take out Trash')
        self.assertIsNotNone(sub_el)
Esempio n. 7
0
 def tearDown(self):
     if is_ci():
         # Take the screenshot to investigate when tests failed only on CI
         img_path = os.path.join(os.getcwd(), self._testMethodName + '.png')
         self.driver.get_screenshot_as_file(img_path)
     self.driver.quit()