You are here

public function SocialMinkContext::iMakeAScreenshotWithFileName in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  2. 8.3 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  3. 8.4 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  4. 8.5 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  5. 8.6 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  6. 8.7 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  7. 10.3.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  8. 10.0.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  9. 10.1.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()
  10. 10.2.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iMakeAScreenshotWithFileName()

@Given /^I make a screenshot with the name "([^"]*)"$/

2 calls to SocialMinkContext::iMakeAScreenshotWithFileName()
SocialMinkContext::iMakeAScreenshot in tests/behat/features/bootstrap/SocialMinkContext.php
@Given /^I make a screenshot$/
SocialMinkContext::takeScreenShotAfterFailedStep in tests/behat/features/bootstrap/SocialMinkContext.php
@AfterStep

File

tests/behat/features/bootstrap/SocialMinkContext.php, line 72

Class

SocialMinkContext
Defines application features from the specific context.

Namespace

Drupal\social\Behat

Code

public function iMakeAScreenshotWithFileName($filename) {
  $screenshot = $this
    ->getSession()
    ->getDriver()
    ->getScreenshot();
  $dir = '/var/www/travis_artifacts';
  if (is_writeable($dir)) {
    $file_and_path = $dir . '/' . $filename . '.jpg';
    file_put_contents($file_and_path, $screenshot);
  }
}