You are here

protected function ThunderJavascriptTestBase::getScreenshotFolder in Thunder 6.2.x

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()
  2. 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()
  3. 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()
  4. 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::getScreenshotFolder()

Get directory for saving of screenshots.

Directory will be created if it does not already exist.

Return value

string Return directory path to store screenshots.

Throws

\Exception

5 calls to ThunderJavascriptTestBase::getScreenshotFolder()
ArticleCreationTest::testCreateArticle in tests/src/FunctionalJavascript/ArticleCreationTest.php
Test Creation of Article.
ChannelsTagsTest::testChannelsCreation in tests/src/FunctionalJavascript/ChannelsTagsTest.php
Test channel creation, tagging of articles and channel page with articles.
MediaGalleryModifyTest::testOrderChange in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test order change for Gallery.
MediaImageModifyTest::testFocalPointChange in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test Focal Point change.
MediaImageModifyTest::testImageEdit in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test Image modifications (edit fields).

File

tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php, line 151

Class

ThunderJavascriptTestBase
Base class for Thunder Javascript functional tests.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

protected function getScreenshotFolder() {
  $dir = $this->screenshotDirectory;

  // Use Travis Job ID for sub folder.
  $travisId = getenv('TRAVIS_JOB_ID');
  if (!empty($travisId)) {
    $dir .= '/' . $travisId;
  }
  if (!is_dir($dir)) {
    if (mkdir($dir, 0777, TRUE) === FALSE) {
      throw new \Exception('Unable to create directory: ' . $dir);
    }
  }
  return realpath($dir);
}