/** * Returns an array of field values from an edit screen. * * @param string $itemName Name of item (user name, article title, and so on) * @param array $fieldNames Array of field labels to get values of. */ public function getFieldValues($className, $itemName, $fieldNames) { $this->clickItem($itemName); $this->editItem = $this->test->getPageObject($className); $result = array(); if (is_array($fieldNames)) { foreach ($fieldNames as $name) { $result[] = $this->editItem->getFieldValue($name); } } $this->editItem->saveAndClose(); return $result; }
/** * Checks for Type and calls special method for this field. * Otherwise, just calls parent::getFieldValue() * * @see AdminEditPage::getFieldValue() */ public function getFieldValue($label) { if ($label == 'Type') { return $this->getModuleType(); } else { return parent::getFieldValue($label); } }
public function setFieldValues($array) { if (isset($array['text'])) { $this->addArticleText($array['text']); unset($array['text']); } if (count($array) > 0) { parent::setFieldValues($array); } }
public function getFieldValue($label) { $result = false; if ($label == 'ID') { $result = $this->driver->findElement(By::id('jform_user_id'))->getAttribute('value'); } else { $result = parent::getFieldValue($label); } return $result; }
/** * function to set value * * @param string $label stores value of label * @param string $value stores value * * @return $this|void */ public function setFieldValue($label, $value) { if (strtolower($label) === 'menu item type') { $this->setMenuItemType($value); } elseif (in_array(strtolower($label), array('article', 'contact', 'newsfeed', 'weblink'))) { $this->setRequestVariable($value); } elseif (in_array(strtolower($label), array('category'))) { parent::setSelectValues(array('tab' => 'Details', 'id' => 'jform_request_id', 'value' => $value)); } else { parent::setFieldValue($label, $value); } return $this; }