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))
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)
def test_take_screenshot(self): webPage = CSSTestPage(self.driver) self.assertIsNotNone(webPage.headingTwos) base64EncodedImage = webPage.take_screenshot() self.assertEquals(base64EncodedImage[:10], 'iVBORw0KGg')