コード例 #1
0
ファイル: test_page.py プロジェクト: lawrencec/horace
    def test_take_screenshot_as_filename(self):
        screenshotFilename = '/tmp/testScreenshot.png'
        webPage = CSSTestPage(self.driver)
        self.assertIsNotNone(webPage.headingTwos)

        self.assertFalse(os.path.exists(screenshotFilename))
        self.assertTrue(webPage.take_screenshot(screenshotFilename))
        assert os.path.exists(screenshotFilename)
        os.remove(screenshotFilename)
        self.assertFalse(os.path.exists(screenshotFilename))
コード例 #2
0
ファイル: test_page.py プロジェクト: lawrencec/horace
 def test_refresh_content(self):
     webPage = CSSTestPage(self.driver)
     self.assertIsNotNone(webPage.headingTwos)
     self.assertEquals(len(webPage.paragraphSection.paragraphs), 2)
     webPage.refresh_content('paragraphSection')
     self.assertEquals(len(webPage.paragraphSection.paragraphs), 2)
コード例 #3
0
ファイル: test_page.py プロジェクト: lawrencec/horace
 def test_take_screenshot(self):
     webPage = CSSTestPage(self.driver)
     self.assertIsNotNone(webPage.headingTwos)
     base64EncodedImage = webPage.take_screenshot()
     self.assertEquals(base64EncodedImage[:10], 'iVBORw0KGg')