public function ThunderJavascriptTestBase::setRawFieldValue in Thunder 8.5
Same name and namespace in other branches
- 8.2 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
- 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
- 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
- 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
- 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
- 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::setRawFieldValue()
Set value directly to field value, without formatting applied.
Parameters
string $fieldName: Field name.
string $rawValue: Raw value for field.
1 call to ThunderJavascriptTestBase::setRawFieldValue()
- MediaImageModifyTest::testImageEdit in tests/
src/ FunctionalJavascript/ MediaImageModifyTest.php - Test Image modifications (edit fields).
File
- tests/
src/ FunctionalJavascript/ ThunderJavascriptTestBase.php, line 341
Class
- ThunderJavascriptTestBase
- Base class for Thunder Javascript functional tests.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function setRawFieldValue($fieldName, $rawValue) {
// Set date over jQuery, because browser drivers handle input value
// differently. fe. (Firefox will set it as "value" for field, but Chrome
// will use it as text for that input field, and in that case final value
// depends on format used for input field. That's why it's better to set it
// directly to value, independently from format used.
$this
->getSession()
->executeScript("jQuery('[name=\"{$fieldName}\"]').val('{$rawValue}')");
}