diff --git a/tests/src/FunctionalJavascript/ConditionalFieldCheckboxTest.php b/tests/src/FunctionalJavascript/ConditionalFieldCheckboxTest.php index f7b370a6c5a1f99f96839873df7bbd2168d335b6..0c69b5384f74e4a78d3cdc5fd4b676e02ee466de 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldCheckboxTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldCheckboxTest.php @@ -11,11 +11,6 @@ use Drupal\Tests\conditional_fields\FunctionalJavascript\TestCases\ConditionalFi */ class ConditionalFieldCheckboxTest extends ConditionalFieldTestBase implements ConditionalFieldCheckedUncheckedInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/checkbox/'; - /** * {@inheritdoc} */ diff --git a/tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php b/tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php index b277d7006b078076f2584720da8f5a128a1fe4c6..c96a1efc3acb629ac3fb22d0d08a40524d7f4aec 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php @@ -18,11 +18,6 @@ class ConditionalFieldCheckboxesTest extends ConditionalFieldTestBase implements use EntityReferenceFieldCreationTrait; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/checkboxes/'; - /** * The name and vid of vocabulary, created for testing. * @@ -99,13 +94,11 @@ class ConditionalFieldCheckboxesTest extends ConditionalFieldTestBase implements $this->assertSession() ->pageTextContains('body field_' . $this->taxonomyName . ' visible value'); $this->clickLink('Edit'); - $this->createScreenshot($this->screenshotPath . '01. Checkboxes' . __FUNCTION__ . '.jpg'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '02. Checkboxes' . __FUNCTION__ . '.jpg'); $this->waitUntilHidden('.field--name-body', 0, '01. Article Body field is visible'); // Change a select value set to show the body. $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id_1, $term_id_1); @@ -199,14 +192,12 @@ class ConditionalFieldCheckboxesTest extends ConditionalFieldTestBase implements // Change a select value set to show the body. $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id_1, $term_id_1); $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id_2, $term_id_2); - $this->createScreenshot($this->screenshotPath . 'scr1BodyVisCheckboxes.jpg'); $this->waitUntilVisible('.field--name-body', 60, '02. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id_1, $term_id_1); $this->waitUntilHidden('.field--name-body', 60, '03. Article Body field is visible'); $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id_2, $term_id_2); $this->waitUntilHidden('.field--name-body', 60, '04. Article Body field is visible'); - $this->createScreenshot($this->screenshotPath . 'scr2BodyHidCheckboxes.jpg'); } /** diff --git a/tests/src/FunctionalJavascript/ConditionalFieldDateListTest.php b/tests/src/FunctionalJavascript/ConditionalFieldDateListTest.php index cf74cf5625f16d7917d7e47a83fdbb4e4638ac23..f286866a9323f077a161e98e6101cc89e7f23729 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldDateListTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldDateListTest.php @@ -17,11 +17,6 @@ use Drupal\field\Entity\FieldStorageConfig; */ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/datelist/'; - /** * The test's name to use in file names. * @@ -89,7 +84,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -104,37 +98,29 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); $this->changeField($this->fieldSelectors['month'], $month); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelectors['day'], $wrong_day); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -151,7 +137,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -164,37 +149,29 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); $this->changeField($this->fieldSelectors['month'], $month); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelectors['day'], $month_wrong); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -217,7 +194,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -233,37 +209,30 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day); $this->changeField($this->fieldSelectors['month'], $month); $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day_2); $this->changeField($this->fieldSelectors['month'], $month_2); $this->changeField($this->fieldSelectors['year'], $year_2); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelectors['day'], $wrong_day); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -288,7 +257,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -304,37 +272,30 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should be show the body. $this->changeField($this->fieldSelectors['day'], $day); $this->changeField($this->fieldSelectors['month'], $month); $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a date that should be show the body. $this->changeField($this->fieldSelectors['day'], $day_2); $this->changeField($this->fieldSelectors['month'], $month_2); $this->changeField($this->fieldSelectors['year'], $year_2); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelectors['day'], $wrong_day); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -358,7 +319,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -374,37 +334,30 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day); $this->changeField($this->fieldSelectors['month'], $month); $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day_2); $this->changeField($this->fieldSelectors['month'], $month_2); $this->changeField($this->fieldSelectors['year'], $year_2); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelectors['day'], $wrong_day); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -428,7 +381,6 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -444,37 +396,30 @@ class ConditionalFieldDateListTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day); $this->changeField($this->fieldSelectors['month'], $month); $this->changeField($this->fieldSelectors['year'], $year); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelectors['day'], $day_2); $this->changeField($this->fieldSelectors['month'], $month_2); $this->changeField($this->fieldSelectors['year'], $year_2); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Check that the field Body is not visible. $this->changeField($this->fieldSelectors['day'], $wrong_day); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldDateTimeTest.php b/tests/src/FunctionalJavascript/ConditionalFieldDateTimeTest.php index e03d9ac22dd1ce4859fdbac281c7298c8ea3f12a..18ad88241f9b69e0418d38f949780b65cc23acc0 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldDateTimeTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldDateTimeTest.php @@ -19,11 +19,6 @@ use Drupal\field\Entity\FieldStorageConfig; */ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/datetime/'; - /** * An array of display options to pass to entity_get_display() * @@ -108,7 +103,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTimeVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -121,12 +115,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTimeVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTimeVisibleValueWidget.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -135,17 +126,14 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Change a date that should not show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '04-testDateTimeVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, DrupalDateTime::createFromTimestamp(\Drupal::time()->getRequestTime())->format('Y-m-d')); - $this->createScreenshot($this->screenshotPath . '05-testDateTimeVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testDateTimeVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -159,7 +147,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTimeVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -172,12 +159,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTimeVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTimeVisibleValueWidget.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -186,17 +170,14 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Change a date that should not show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '04-testDateTimeVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $date_formatted); - $this->createScreenshot($this->screenshotPath . '05-testDateTimeVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a date that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testDateTimeVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -211,7 +192,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTime ' . __FUNCTION__ . '.png'); // Set up conditions. $dates = [ @@ -228,12 +208,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTime ' . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTime ' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -241,27 +218,22 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testDateTime ' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testDateTime ' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[0]); - $this->createScreenshot($this->screenshotPath . '06-testDateTime ' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[1]); - $this->createScreenshot($this->screenshotPath . '07-testDateTime ' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change a date value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testDateTime ' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '0.5Article Body field is visible'); } @@ -276,7 +248,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTimeVisibleValueOr.png'); // Set up conditions. $dates = [ @@ -293,12 +264,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTimeVisibleValueOr.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTimeVisibleValueOr.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -306,27 +274,22 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testDateTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testDateTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[0]); - $this->createScreenshot($this->screenshotPath . '06-testDateTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[1]); - $this->createScreenshot($this->screenshotPath . '07-testDateTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a date value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testDateTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '0.5 Article Body field is visible'); } @@ -341,7 +304,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTime' . __FUNCTION__ . '.png'); // Set up conditions. $dates = [ @@ -358,12 +320,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTime' . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTime' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -371,27 +330,22 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[0]); - $this->createScreenshot($this->screenshotPath . '06-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[1]); - $this->createScreenshot($this->screenshotPath . '07-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change a date value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '0.5 Article Body field is not visible'); } @@ -406,7 +360,6 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testDateTime' . __FUNCTION__ . '.png'); // Set up conditions. $dates = [ @@ -423,12 +376,9 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testDateTime' . __FUNCTION__ . '.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testDateTime' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $this->fieldName . ' visible value'); @@ -436,27 +386,22 @@ class ConditionalFieldDateTimeTest extends ConditionalFieldTestBase implements C $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a date that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[0]); - $this->createScreenshot($this->screenshotPath . '06-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a date value to show the body. $this->changeField($this->fieldSelector, $dates[1]); - $this->createScreenshot($this->screenshotPath . '07-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a date value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testDateTime' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '0.5 Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldEmailTest.php b/tests/src/FunctionalJavascript/ConditionalFieldEmailTest.php index 498d525a06d3caf42bb9e794176fcd724512e964..adddc58b785ab9e28e806dc29933d02320500c4e 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldEmailTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldEmailTest.php @@ -26,11 +26,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond 'node', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/email/'; - /** * An array of display options to pass to entity_get_display() * @@ -119,7 +114,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -132,12 +126,9 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. @@ -145,17 +136,14 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Change a email that should not show the body. $this->changeField($this->fieldSelector, 'wrongmail@drupal.org'); - $this->createScreenshot($this->screenshotPath . '04-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 500, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '05-testEmailVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 500, '02. Article Body field is not visible'); // Change a email that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -170,7 +158,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -183,12 +170,9 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. @@ -196,17 +180,14 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Change a email that should not show the body. $this->changeField($this->fieldSelector, $email_wrong); - $this->createScreenshot($this->screenshotPath . '04-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 500, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '05-testEmailVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 500, '02. Article Body field is not visible'); // Change a email that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -221,7 +202,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -234,34 +214,27 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Change a email that should not show the body. - $this->createScreenshot($this->screenshotPath . '04-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 500, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '05-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 500, '02. Article Body field is visible'); // Check that the field Body is not visible. $this->changeField($this->fieldSelector, $email_2); - $this->createScreenshot($this->screenshotPath . '05-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 500, '02. Article Body field is visible'); // Change a email that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testEmailVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -276,7 +249,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailTimeVisibleValueOr.png'); // Set up conditions. $emails = implode("\r\n", [$email, $email2]); @@ -290,39 +262,31 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailTimeVisibleValueOr.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailTimeVisibleValueOr.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change email that should not show the body. $this->changeField($this->fieldSelector, 'wrongmail@drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '06-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 500, '03. Article Body field is not visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email2); - $this->createScreenshot($this->screenshotPath . '07-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a email value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -337,7 +301,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailTimeVisibleValueOr.png'); // Set up conditions. $emails = implode("\r\n", [$email, $email2]); @@ -351,39 +314,31 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailTimeVisibleValueOr.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailTimeVisibleValueOr.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change email that should not show the body. $this->changeField($this->fieldSelector, 'wrongmail@drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '06-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 500, '03. Article Body field is visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email2); - $this->createScreenshot($this->screenshotPath . '07-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change a email value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -398,7 +353,6 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testEmailTimeVisibleValueOr.png'); // Set up conditions. $emails = implode("\r\n", [$email, $email2]); @@ -412,39 +366,31 @@ class ConditionalFieldEmailTest extends ConditionalFieldTestBase implements Cond ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testEmailTimeVisibleValueOr.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testEmailTimeVisibleValueOr.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change email that should not show the body. $this->changeField($this->fieldSelector, 'wrongmail@drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email); - $this->createScreenshot($this->screenshotPath . '06-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 500, '03. Article Body field is not visible'); // Change a email value to show the body. $this->changeField($this->fieldSelector, $email2); - $this->createScreenshot($this->screenshotPath . '07-testEmailTimeVisibleValueOr.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a email value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testEmailTimeVisibleValueOr.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTagsTest.php b/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTagsTest.php index bd57b4b93aeb2ab673e7dd3cd1df77ed1fb19239..957395ff6ce3443107fbe81ebcd752bab5dcb6c5 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTagsTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTagsTest.php @@ -28,11 +28,6 @@ class ConditionalFieldEntityReferenceTagsTest extends ConditionalFieldTestBase { 'node', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/entity_reference_tags/'; - /** * The field name used in the test. * @@ -106,7 +101,6 @@ class ConditionalFieldEntityReferenceTagsTest extends ConditionalFieldTestBase { // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-tags-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -124,40 +118,32 @@ class ConditionalFieldEntityReferenceTagsTest extends ConditionalFieldTestBase { $this->getSession()->wait(1000, '!jQuery.active'); $this->getSession()->executeScript("jQuery('#conditional-field-edit-form').submit();"); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-tags-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-tags-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-tags-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is not visible'); // Change an entity reference field that should not show the body. $this->changeField($this->fieldSelector, $this->randomMachineName()); - $this->createScreenshot($this->screenshotPath . '05-entity-reference-tags-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is not visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_valid); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-tags-body-visible-when-controlled-field-has-valid-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-tags-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-tags-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is not visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTest.php b/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTest.php index 8f7da9f026aa09df71e6fbf3b243bc9d07ae8dae..d70be1e5a4dfe7e6bc3eaabae42a9c80167ab4d6 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldEntityReferenceTest.php @@ -30,11 +30,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple 'node', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/entity_reference/'; - /** * The field name used in the test. * @@ -109,7 +104,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -122,45 +116,36 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field that should not show the body. $this->changeField($this->fieldSelector, $this->randomMachineName()); - $this->createScreenshot($this->screenshotPath . '05-entity-reference-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '06. Article Body field is visible'); } @@ -183,7 +168,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -196,45 +180,36 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field that should not show the body. $this->changeField($this->fieldSelector, $this->randomMachineName()); - $this->createScreenshot($this->screenshotPath . '05-entity-reference-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '06. Article Body field is visible'); } @@ -263,7 +238,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -276,45 +250,36 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field that should not show the body. $this->changeField($this->fieldSelector, $this->randomMachineName()); - $this->createScreenshot($this->screenshotPath . '05-entity-reference-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '06. Article Body field is visible'); } @@ -343,7 +308,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -356,45 +320,36 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field that should not show the body. $this->changeField($this->fieldSelector, $this->randomMachineName()); - $this->createScreenshot($this->screenshotPath . '05-entity-reference-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '06. Article Body field is visible'); } @@ -423,7 +378,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -436,40 +390,32 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, '06. Article Body field is not visible'); } @@ -498,7 +444,6 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -511,40 +456,32 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-entity-reference-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change an entity reference field in format 'Node title' to show the body. $this->changeField($this->fieldSelector, $referenced_format_2); - $this->createScreenshot($this->screenshotPath . '08-entity-reference-body-visible-when-controlled-field-has-value-format-2.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '06. Article Body field is visible'); } @@ -566,35 +503,29 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -616,35 +547,29 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); } @@ -666,35 +591,29 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, '!visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' !visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); } @@ -716,35 +635,29 @@ class ConditionalFieldEntityReferenceTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, '!visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-entity-reference-add-filed-conditions.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-entity-reference-submit-entity-reference-filed-conditions.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' !visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-entity-reference-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change an entity reference field in format 'Node title (nid)' to show the // body. $this->changeField($this->fieldSelector, $referenced_format_1); - $this->createScreenshot($this->screenshotPath . '06-entity-reference-body-visible-when-controlled-field-has-value-format-1.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Set wrong format for an entity reference field to hide the body. $this->changeField($this->fieldSelector, $referenced_format_wrong); - $this->createScreenshot($this->screenshotPath . '07-entity-reference-body-invisible-when-controlled-field-has-value-in-wrong-format.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-entity-reference-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldLanguageSelectTest.php b/tests/src/FunctionalJavascript/ConditionalFieldLanguageSelectTest.php index b0ee5b826387704e9d2ffee97a7605331cee5cfe..1be3d069ef9fbd4253b0cc35c6783047f6aa4dea 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldLanguageSelectTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldLanguageSelectTest.php @@ -25,11 +25,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem 'options', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/language_select/'; - /** * The field name used in the test. * @@ -91,7 +86,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -104,33 +98,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -142,7 +129,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -155,33 +141,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -193,7 +172,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -206,33 +184,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -244,7 +215,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -257,33 +227,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); } @@ -295,7 +258,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -308,33 +270,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -346,7 +301,6 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-language-select-add-filed-conditions.png'); // Set up conditions. $data = [ @@ -359,33 +313,26 @@ class ConditionalFieldLanguageSelectTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-language-select-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-language-select-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-language-select-body-visible-when-controlled-field-has-default-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, $this->langcodes[0]); - $this->createScreenshot($this->screenshotPath . '05-language-select-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, $this->defaultLanguage); - $this->createScreenshot($this->screenshotPath . '06-language-select-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, $this->langcodes[1]); - $this->createScreenshot($this->screenshotPath . '07-language-select-body-invisible-when-controlled-field-has-wrong-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldLinkFieldTest.php b/tests/src/FunctionalJavascript/ConditionalFieldLinkFieldTest.php index c44ac896112c4740a1444ddadc308922d59e3bdd..201de1354e39c4d13e11bd5b67ebc1db9cec9492 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldLinkFieldTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldLinkFieldTest.php @@ -19,11 +19,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface, ConditionalFieldFilledEmptyInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/link_field/'; - /** * Modules to enable. * @@ -110,7 +105,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueWidget.png'); // Set up conditions. $external_url = 'https://drupal.org'; @@ -125,12 +119,9 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. @@ -138,22 +129,18 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Change a link that should not show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $external_url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Check that the field Body is not visible. $this->changeField($this->fieldSelector, $wrong_url); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change a link that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -165,7 +152,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueWidget.png'); // Set up conditions. $external_url = 'https://drupal.org'; @@ -179,12 +165,9 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. @@ -192,17 +175,14 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Change a link that should not show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is not visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $external_url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is visible'); // Change a link that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is not visible'); } @@ -214,7 +194,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-link-field-add-filed-conditions.png'); // Set up conditions. $urls = ['node/add', 'node/1']; @@ -228,39 +207,31 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-link-field-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-link-field-submit-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-link-field-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-link-field-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, $urls[0]); - $this->createScreenshot($this->screenshotPath . '06-link-field-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, $urls[1]); - $this->createScreenshot($this->screenshotPath . '07-link-field-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Change a link value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-link-field-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -272,7 +243,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-link-field-add-filed-conditions.png'); // Set up conditions. $urls = ['node/add', 'node/1']; @@ -286,39 +256,31 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-link-field-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-link-field-submit-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-link-field-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-link-field-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, $urls[0]); - $this->createScreenshot($this->screenshotPath . '06-link-field-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, $urls[1]); - $this->createScreenshot($this->screenshotPath . '07-link-field-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change a link value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-link-field-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -330,7 +292,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); // Set up conditions. $urls = ['node/add', 'node/1']; @@ -344,34 +305,27 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, $urls[0]); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a link that should not show the body again. $this->changeField($this->fieldSelector, $urls[1]); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); } @@ -383,7 +337,6 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); // Set up conditions. $urls = ['node/add', 'node/1']; @@ -397,39 +350,31 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a link that should be show the body. $this->changeField($this->fieldSelector, $urls[0]); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a link that should be show the body again. $this->changeField($this->fieldSelector, $urls[1]); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, "http://example.com"); - $this->createScreenshot($this->screenshotPath . '06-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Change a link value to hide the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -443,31 +388,24 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); - - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, $url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -481,31 +419,24 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, 'visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); - - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, $url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); } @@ -519,31 +450,24 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, '!visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); - - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' !visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, $url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); } @@ -557,31 +481,24 @@ class ConditionalFieldLinkFieldTest extends ConditionalFieldTestBase implements // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', $this->fieldName, '!visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-testFieldLinkVisibleValueNot.png'); - - $this->createScreenshot($this->screenshotPath . '02-testFieldLinkVisibleValueNot.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testFieldLinkVisibleValueNot.png'); $this->assertSession()->pageTextContains('body ' . $this->fieldName . ' !visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change a link that should not show the body. $this->changeField($this->fieldSelector, $url); - $this->createScreenshot($this->screenshotPath . '05-testFieldLinkVisibleValueNot.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a link value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testFieldLinkVisibleValueNot.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldNumberTest.php b/tests/src/FunctionalJavascript/ConditionalFieldNumberTest.php index a36fc082f4e66b93fae8c9313d3f0ba4d8c85298..b29d3908646b248029792cee6e69e30f123c75fa 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldNumberTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldNumberTest.php @@ -28,11 +28,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con 'node', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/number_integer/'; - /** * The field name used in the test. * @@ -98,7 +93,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -111,39 +105,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is not visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -155,7 +141,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -168,39 +153,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is not visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -212,7 +189,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -225,39 +201,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -269,7 +237,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -282,39 +249,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is not visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is not visible'); } @@ -326,7 +285,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -339,39 +297,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '05. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '06. Article Body field is not visible'); } @@ -383,7 +333,6 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); // Set up conditions. $data = [ @@ -396,39 +345,31 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change the number field that should not show the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '05-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Set wrong value for number field to hide the body. $this->changeField($this->fieldSelector, mt_rand(10, 100)); - $this->createScreenshot($this->screenshotPath . '07-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '05. Article Body field is visible'); } @@ -440,31 +381,24 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); - - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -476,31 +410,24 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); - - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); } @@ -512,31 +439,24 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, '!visible', '!empty'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); - - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' !visible !empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '01. Article Body field is not visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); } @@ -548,31 +468,24 @@ class ConditionalFieldNumberTest extends ConditionalFieldTestBase implements Con // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, '!visible', 'empty'); - $this->createScreenshot($this->screenshotPath . '01-testNumberInteger-testVisibleValueWidget.png'); - - $this->createScreenshot($this->screenshotPath . '02-testNumberInteger-testVisibleValueWidget.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-testNumberInteger-testVisibleValueWidget.png'); $this->assertSession()->pageTextContains('body field_' . $this->fieldName . ' !visible empty'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change the number field to show the body. $this->changeField($this->fieldSelector, $this->validValue); - $this->createScreenshot($this->screenshotPath . '06-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Set an empty value to hide body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-testNumberInteger-testVisibleValueWidget.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldParagraphsTest.php b/tests/src/FunctionalJavascript/ConditionalFieldParagraphsTest.php index ec79c33521c84e0ebfc680d38eb8d062aa455133..e78de5fd530953a7c9f83d72570151c8a1b1a8a9 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldParagraphsTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldParagraphsTest.php @@ -29,11 +29,6 @@ class ConditionalFieldParagraphsTest extends ConditionalFieldTestBase implements 'entity_reference_revisions', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/paragraphs/'; - /** * The field name used in the test. * diff --git a/tests/src/FunctionalJavascript/ConditionalFieldRadiosTest.php b/tests/src/FunctionalJavascript/ConditionalFieldRadiosTest.php index 4ec20099004e32fe073fa0873fc371341d5cbc9d..720ef4d71636e11342dac91ec2d378110a9b2e56 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldRadiosTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldRadiosTest.php @@ -21,11 +21,6 @@ class ConditionalFieldRadiosTest extends ConditionalFieldTestBase implements use EntityReferenceFieldCreationTrait; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/radios/'; - /** * The test's name to use in file names. * @@ -176,7 +171,6 @@ class ConditionalFieldRadiosTest extends ConditionalFieldTestBase implements } while ($term_id_2 == $term_id); // Visit a ConditionalFields configuration page for `Article` Content type. $this->createCondition('body', 'field_' . $this->taxonomyName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); $data = [ 'condition' => 'value', 'values_set' => ConditionalFieldsInterface::CONDITIONAL_FIELDS_DEPENDENCY_VALUES_AND, @@ -191,22 +185,18 @@ class ConditionalFieldRadiosTest extends ConditionalFieldTestBase implements $this->drupalGet('admin/structure/conditional_fields/node/article'); $this->assertSession() ->pageTextContains('body field_' . $this->taxonomyName . ' visible value'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 0, '01. Article Body field is visible'); // Change a select value set to show the body. $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id, $term_id); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeSelect('#edit-field-' . $this->taxonomyName . '-' . $term_id); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php b/tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php index 717ef83f3196a596af354f34f8c9dc8c062c7949..610ae468a674c00c0cb51391f1c2b8285671f356 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php @@ -26,11 +26,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem 'options', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/select_multiple/'; - /** * The field name used in the test. * @@ -105,7 +100,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -118,33 +112,26 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '06-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '07-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -156,7 +143,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -169,43 +155,34 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '06-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [3]); - $this->createScreenshot($this->screenshotPath . '07-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 3]); - $this->createScreenshot($this->screenshotPath . '08-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '09-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -217,7 +194,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -230,38 +206,30 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0, 3]); - $this->createScreenshot($this->screenshotPath . '06-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '07-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '08-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -273,7 +241,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -286,43 +253,34 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should be show the body. $this->changeField($this->fieldSelector, [0, 3]); - $this->createScreenshot($this->screenshotPath . '06-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [3]); - $this->createScreenshot($this->screenshotPath . '07-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '08-body-visible-when-controlled-field-has-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '09-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -334,7 +292,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -347,43 +304,34 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should be show the body. $this->changeField($this->fieldSelector, [0, 3]); - $this->createScreenshot($this->screenshotPath . '06-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [3]); - $this->createScreenshot($this->screenshotPath . '07-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '08-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '09-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); } @@ -395,7 +343,6 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-add-list-options-filed-conditions.png'); // Set up conditions. $data = [ @@ -408,43 +355,34 @@ class ConditionalFieldSelectMultipleTest extends ConditionalFieldTestBase implem ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-post-add-list-options-filed-conditions.png'); - // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-submit-list-options-filed-conditions.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-body-invisible-when-controlled-field-has-no-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [0]); - $this->createScreenshot($this->screenshotPath . '05-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should be show the body. $this->changeField($this->fieldSelector, [0, 3]); - $this->createScreenshot($this->screenshotPath . '06-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelector, [3]); - $this->createScreenshot($this->screenshotPath . '07-body-invisible-when-controlled-field-has-wrong-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelector, [0, 1]); - $this->createScreenshot($this->screenshotPath . '08-body-visible-when-controlled-field-has-value.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelector, ['_none']); - $this->createScreenshot($this->screenshotPath . '09-body-invisible-when-controlled-field-has-no-value-again.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldSelectTest.php b/tests/src/FunctionalJavascript/ConditionalFieldSelectTest.php index 17fa606c3b946a06c19670182a3d675d50546c53..79314522671dfd3d864471aa7062e0cb3f60a73c 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldSelectTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldSelectTest.php @@ -26,11 +26,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con 'options', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/select/'; - /** * The field names used in the test. * @@ -148,8 +143,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ '[name="condition"]' => 'value', @@ -165,11 +158,9 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->getSession()->wait(1000, '!jQuery.active'); $this->getSession() ->executeScript("jQuery('#conditional-field-edit-form').submit();"); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); @@ -177,22 +168,18 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $wrong_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '06-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -202,7 +189,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } @@ -236,8 +222,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ '[name="condition"]' => 'value', @@ -253,11 +237,9 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->getSession()->wait(1000, '!jQuery.active'); $this->getSession() ->executeScript("jQuery('#conditional-field-edit-form').submit();"); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); @@ -265,22 +247,18 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04.' . $fieldName . '. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $wrong_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is visible'); // Change a select value set to show the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '06-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '06.' . $fieldName . '. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '07.' . $fieldName . '. Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -290,7 +268,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } @@ -316,8 +293,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ 'condition' => 'value', @@ -328,31 +303,25 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); $this->clickLink('Edit'); - $this->createScreenshot($this->screenshotPath . '03.5-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04.' . $fieldName . '. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $test_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '07.' . $fieldName . '. Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -362,7 +331,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } @@ -394,8 +362,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ 'condition' => 'value', @@ -406,11 +372,9 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); @@ -418,22 +382,18 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04.' . $fieldName . '. Article Body field is visible'); // Change a select value set that should be visible the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $wrong_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '07.' . $fieldName . '. Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -443,7 +403,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } @@ -475,8 +434,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ 'condition' => 'value', @@ -487,11 +444,9 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); @@ -499,22 +454,18 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '04.' . $fieldName . '. Article Body field is visible'); // Change a select value set that should be visible the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is not visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $wrong_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '07.' . $fieldName . '. Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -524,7 +475,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } @@ -550,8 +500,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con foreach ($this->fieldNames as $fieldName) { $this->createCondition('body', $fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $fieldName . '_' . __FUNCTION__ . '.png'); - // Set up conditions. $data = [ 'condition' => 'value', @@ -562,11 +510,9 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $fieldName . '_' . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->assertSession() ->pageTextContains('body ' . $fieldName . ' visible value'); @@ -574,22 +520,18 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04.' . $fieldName . '. Article Body field is visible'); // Change a select value set that should not show the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '05.' . $fieldName . '. Article Body field is not visible'); // Change a select value set that should be show the body. $this->changeField($this->fieldSelectors[$fieldName], $correct_values[$fieldName]); - $this->createScreenshot($this->screenshotPath . '05-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '06.' . $fieldName . '. Article Body field is not visible'); // Change a select value set to hide the body again. $this->changeField($this->fieldSelectors[$fieldName], '_none'); - $this->createScreenshot($this->screenshotPath . '07-' . $fieldName . '_' . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '07.' . $fieldName . '. Article Body field is visible'); // Return back to ConditionalFields configuration page for Article CT. @@ -599,7 +541,6 @@ class ConditionalFieldSelectTest extends ConditionalFieldTestBase implements Con $this->click('li > button > .dropbutton-arrow'); $this->clickLink('Delete'); $this->submitForm([], 'Confirm'); - $this->createScreenshot($this->screenshotPath . '08-' . $fieldName . '_' . __FUNCTION__ . '.png'); } } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldTestBase.php b/tests/src/FunctionalJavascript/ConditionalFieldTestBase.php index f32d6657497b10670cf896b07d4ba91cc7a878a0..39703e7b7756752feaffc2222b915e5aa9d04414 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldTestBase.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldTestBase.php @@ -14,13 +14,6 @@ abstract class ConditionalFieldTestBase extends WebDriverTestBase { */ protected $defaultTheme = 'stark'; - /** - * Path to create screenshot. - * - * @var string - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/'; - /** * {@inheritdoc} */ diff --git a/tests/src/FunctionalJavascript/ConditionalFieldTextTextareaTest.php b/tests/src/FunctionalJavascript/ConditionalFieldTextTextareaTest.php index e7b96156f8a358b4f4cac4526d64c1fd1a347ad4..910430c9c8813374910f3f4c9f5bf6858129a064 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldTextTextareaTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldTextTextareaTest.php @@ -15,11 +15,6 @@ use Drupal\field\Entity\FieldStorageConfig; */ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/textarea/'; - /** * The test's name to use in file names. * @@ -113,7 +108,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = 'drupal test textarea'; @@ -126,28 +120,23 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Change field that should not show the body. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $text); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); } @@ -159,7 +148,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = [$this->randomMachineName(), $this->randomMachineName()]; @@ -172,38 +160,31 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); } @@ -215,7 +196,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ['drupal textarea text first', 'drupal textarea text second']; @@ -228,38 +208,31 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); } @@ -271,7 +244,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $data = [ @@ -287,33 +259,27 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen $text_with_expression = 'The field has data=2 text'; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Change field that should not show the body. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, $text_without_expression); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $text_with_expression); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); } @@ -325,7 +291,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ["first string", "second string"]; $data = [ @@ -337,33 +302,27 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); } @@ -375,7 +334,6 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition($this->targetFieldName, 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = [$this->randomMachineName(), $this->randomMachineName()]; $data = [ @@ -387,33 +345,27 @@ class ConditionalFieldTextTextareaTest extends ConditionalFieldTestBase implemen 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains($this->targetFieldName . ' field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is invisible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is not visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden($this->targetFieldWrap, 50, 'Article \'' . $this->targetFieldName . '\' field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldTextWithSummaryTest.php b/tests/src/FunctionalJavascript/ConditionalFieldTextWithSummaryTest.php index 61731eef7bec8961a027f4c9d6079e0564507bd0..9692764e247100aed5cd3ee31671972651d1c226 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldTextWithSummaryTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldTextWithSummaryTest.php @@ -15,11 +15,6 @@ use Drupal\field\Entity\FieldStorageConfig; */ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/text_with_summary/'; - /** * The test's name to use in file names. * @@ -97,7 +92,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = 'drupal test text_with_summary'; @@ -115,31 +109,25 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple $this->getSession()->wait(1000, '!jQuery.active'); $this->getSession()->executeScript("jQuery('#conditional-field-edit-form').submit();"); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); $this->clickLink('Edit'); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Change field that should not show the body. - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, $text); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '02. Article Body field is not visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '03. Article Body field is visible'); } @@ -151,7 +139,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ['drupal text_with_summary text first', 'drupal text_with_summary text second']; @@ -165,36 +152,29 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); $this->clickLink('Edit'); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, 'drupal.org'); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, implode('\r\n', $text)); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change field value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '04. Article Body field is visible'); } @@ -206,7 +186,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ['drupal text_with_summary text first', 'drupal text_with_summary text second']; @@ -219,41 +198,33 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); $this->clickLink('Edit'); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '01. Article Body field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '02. Article Body field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '03. Article Body field is not visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '08-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, '04. Article Body field is not visible'); // Change field value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '09-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, '08. Article Body field is visible'); } @@ -265,7 +236,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = 'text_'; @@ -278,11 +248,9 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. @@ -290,17 +258,14 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Change field that should not show the body. $this->changeField($this->fieldSelector, 'wrong text'); - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Check that the field Body is visible. $this->changeField($this->fieldSelector, 'text_correct'); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, 'wrong text'); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } @@ -312,7 +277,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ['drupal text_with_summary text first', 'drupal text_with_summary text second']; @@ -325,33 +289,27 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change field that should not show the body again. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); } @@ -363,7 +321,6 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple // Visit a ConditionalFields configuration page for Content bundles. $this->createCondition('body', 'field_' . $this->fieldName, 'visible', 'value'); - $this->createScreenshot($this->screenshotPath . '01-' . $this->testName . __FUNCTION__ . '.png'); // Set up conditions. $text = ['drupal text_with_summary text first', 'drupal text_with_summary text second']; @@ -376,38 +333,31 @@ class ConditionalFieldTextWithSummaryTest extends ConditionalFieldTestBase imple 'effect' => 'show', ]; $this->submitForm($data, 'Save settings'); - $this->createScreenshot($this->screenshotPath . '02-' . $this->testName . __FUNCTION__ . '.png'); // Check if that configuration is saved. $this->drupalGet('admin/structure/types/manage/article/conditionals'); - $this->createScreenshot($this->screenshotPath . '03-' . $this->testName . __FUNCTION__ . '.png'); $this->assertSession()->pageTextContains('body ' . 'field_' . $this->fieldName . ' visible value'); // Visit Article Add form to check that conditions are applied. $this->drupalGet('node/add/article'); // Check that the field Body is not visible. - $this->createScreenshot($this->screenshotPath . '04-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change field that should not show the body. $this->changeField($this->fieldSelector, 'https://drupal.org'); - $this->createScreenshot($this->screenshotPath . '05-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[0]); - $this->createScreenshot($this->screenshotPath . '06-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change field value to show the body. $this->changeField($this->fieldSelector, $text[1]); - $this->createScreenshot($this->screenshotPath . '07-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilVisible('.field--name-body', 50, 'Article Body field is not visible'); // Change field value to hide the body again. $this->changeField($this->fieldSelector, ''); - $this->createScreenshot($this->screenshotPath . '08-' . $this->testName . __FUNCTION__ . '.png'); $this->waitUntilHidden('.field--name-body', 50, 'Article Body field is visible'); } diff --git a/tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php b/tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php index cde3796490d056470e94f70f91fdb0a63e90349d..826a10400024854970ef567184e479fcfe0426d5 100644 --- a/tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php +++ b/tests/src/FunctionalJavascript/ConditionalFieldTextfieldTest.php @@ -18,11 +18,6 @@ class ConditionalFieldTextfieldTest extends ConditionalFieldTestBase implements ConditionalFieldValueInterface, ConditionalFieldFilledEmptyInterface { - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/text/'; - /** * The field name used in the test. * diff --git a/tests/src/FunctionalJavascript/Entity/ConditionalFieldsUserTest.php b/tests/src/FunctionalJavascript/Entity/ConditionalFieldsUserTest.php index e91425e17ad12f5f99d4aac2f605331d0224d904..5dbf372716da49b91f3071b4003367ba1dfb10ea 100644 --- a/tests/src/FunctionalJavascript/Entity/ConditionalFieldsUserTest.php +++ b/tests/src/FunctionalJavascript/Entity/ConditionalFieldsUserTest.php @@ -37,11 +37,6 @@ class ConditionalFieldsUserTest extends ConditionalFieldTestBase { 'field_ui', ]; - /** - * {@inheritdoc} - */ - protected $screenshotPath = 'sites/simpletest/conditional_fields/user/'; - /** * {@inheritdoc} */ @@ -106,15 +101,12 @@ class ConditionalFieldsUserTest extends ConditionalFieldTestBase { // Check that configuration is saved. $this->drupalGet('admin/structure/conditional_fields/user/user'); - $this->createScreenshot($this->screenshotPath . '01-config-was-added.png'); $this->assertSession()->pageTextContains($this->dependent . ' ' . $this->dependee . ' visible checked'); // Visit user register form to check that conditions are applied. $this->drupalGet('admin/people/create'); - $this->createScreenshot($this->screenshotPath . '02-mail-not-visible.png'); $this->waitUntilHidden('.field--name-field-dependent', 50, 'Dependent field is not visible'); $this->changeSelect('#edit-field-dependee-value', TRUE); - $this->createScreenshot($this->screenshotPath . '03-mail-visible.png'); $this->waitUntilVisible('.field--name-field-dependent', 50, 'Dependent field is visible'); }