class ScreenshotTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/behat/mink/driver-testsuite/tests/Basic/ScreenshotTest.php \Behat\Mink\Tests\Driver\Basic\ScreenshotTest
Hierarchy
- class \Behat\Mink\Tests\Driver\TestCase extends \Behat\Mink\Tests\Driver\PHPUnit_Framework_TestCase
- class \Behat\Mink\Tests\Driver\Basic\ScreenshotTest
Expanded class hierarchy of ScreenshotTest
File
- vendor/
behat/ mink/ driver-testsuite/ tests/ Basic/ ScreenshotTest.php, line 7
Namespace
Behat\Mink\Tests\Driver\BasicView source
class ScreenshotTest extends TestCase {
public function testScreenshot() {
if (!extension_loaded('gd')) {
$this
->markTestSkipped('Testing screenshots requires the GD extension');
}
$this
->getSession()
->visit($this
->pathTo('/index.html'));
$screenShot = $this
->getSession()
->getScreenshot();
$this
->assertInternalType('string', $screenShot);
$this
->assertFalse(base64_decode($screenShot, true), 'The returned screenshot should not be base64-encoded');
$img = imagecreatefromstring($screenShot);
if (false === $img) {
$this
->fail('The screenshot should be a valid image');
}
imagedestroy($img);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ScreenshotTest:: |
public | function | ||
TestCase:: |
private static | property | ||
TestCase:: |
private static | property | Mink session manager. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Creates a new driver instance. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Returns assert session. | |
TestCase:: |
private static | function | ||
TestCase:: |
protected | function | Returns session. | |
TestCase:: |
protected | function | Map remote file path. | |
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | ||
TestCase:: |
protected | function | Waits for a condition to be true, considering than it is successful for drivers not supporting wait(). | |
TestCase:: |
public static | function | Initializes the test case. | |
TestCase:: |
protected | function |