/** * {@inheritdoc} */ public function fillField($labelContent, $value, Element $element = null) { if ('Family' === $labelContent && 'None' === $value) { $value = ''; } return parent::fillField($labelContent, $value, $element); }
/** * {@inheritdoc} */ public function fillField($locator, $value, Element $modal = null) { // Simply do not select a family if ('Family' === $locator && 'None' === $value) { return; } $select2Locator = sprintf('label:contains("%s") + .select2-container', $locator); $selectContainer = $this->spin(function () use($select2Locator) { return $this->find('css', $select2Locator); }); if ($selectContainer) { $this->fillSelect2Field($selectContainer, $value); } else { parent::fillField($locator, $value, $modal); } }