public function setSolution($solution) { $this->solution = $this->test->byXpath("//*[@data-ftid='oro_workflow_transition_proposed_solution']"); $this->solution->clear(); $this->solution->value($solution); return $this; }
public function setSolution($solution) { $this->solution = $this->test->byId('oro_workflow_transition_proposed_solution'); $this->solution->clear(); $this->solution->value($solution); return $this; }
public function submit() { $this->searchButton->click(); sleep(1); $this->waitPageToLoad(); $this->waitForAjax(); return $this; }
public function tab($tab) { $this->test->moveto($this->tabs->element($this->test->using('xpath')->value("ul/li/a[normalize-space(.) = '{$tab}']"))); $this->tabs->element($this->test->using('xpath')->value("ul/li/a[normalize-space(.) = '{$tab}']"))->click(); $this->waitPageToLoad(); $this->waitForAjax(); $this->xpathMenu = "//div[@id = 'main-menu']/ul" . "/li[a[normalize-space(.) = '{$tab}']]"; return $this; }
public function setOwner($owner) { $this->owner->click(); $this->waitForAjax(); $this->test->byXPath("//div[@id='select2-drop']/div/input")->value($owner); $this->waitForAjax(); $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$owner}')]", "Owner autocomplete doesn't return search value"); $this->test->byXPath("//div[@id='select2-drop']//div[contains(., '{$owner}')]")->click(); return $this; }
/** * @param $capabilityName array of Capability ACL resources * @param $accessLevel * * @return $this */ public function setCapability($capabilityName, $accessLevel) { foreach ($capabilityName as $name) { $xpath = $this->test->byXpath("//div[strong/text() = '{$name}']/following-sibling::div//a"); $this->test->moveto($xpath); $xpath->click(); $this->waitForAjax(); $this->accessLevel = $this->test->select($this->test->byXpath("//div[strong/text() = '{$name}']/following-sibling::div//select")); $this->accessLevel->selectOptionByLabel($accessLevel); } return $this; }
public function setGroups($groups = array()) { foreach ($groups as $group) { $this->groups->element($this->test->using('xpath')->value("div[label[normalize-space(text()) = '{$group}']]/input"))->click(); } return $this; }
public function selectEntity($type, $entity) { $this->opportunity = $this->test->byXpath("(//button[contains(@class, 'entity-select-btn')])[last()]"); $this->opportunity->click(); $this->waitPageToLoad(); $this->waitForAjax(); $this->test->byXpath("//div[@class='filter-container']//*[contains(@class,'filter-criteria-selector')]" . "[contains(., '{$type} name')]")->click(); $filter = $this->test->byXpath("//div[contains(@class, 'filter-item oro-drop open-filter' )]//input[@name='value']"); $filter->clear(); $filter->value($entity); $this->test->byXPath("//div[contains(@class, 'filter-item oro-drop open-filter' )]//button[contains(., 'Update')]")->click(); $this->waitForAjax(); $this->test->byXpath("//table[@class='grid table-hover table table-bordered table-condensed']//td[contains(., '{$entity}')]")->click(); sleep(1); $this->waitPageToLoad(); $this->waitForAjax(); return $this; }
public function setReportsTo($reportsTo) { $this->reportsTo->click(); $this->waitForAjax(); $this->test->byXpath("//div[@id='select2-drop']/div/input")->value($reportsTo); $this->waitForAjax(); $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$reportsTo}')]", "Reports to autocomplete doesn't return search value"); $this->test->byXpath("//div[@id='select2-drop']//div[contains(., '{$reportsTo}')]")->click(); return $this; }
public function setCampaign($campaign) { $this->test->moveto($this->campaign); $this->campaign->click(); $this->waitForAjax(); $this->test->byXpath("//div[@id='select2-drop']/div/input")->value($campaign); $this->waitForAjax(); $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$campaign}')]", "Campaign autocomplete doesn't return search value"); $this->test->byXpath("//div[@id='select2-drop']//div[contains(., '{$campaign}')]")->click(); return $this; }
/** * @param \PHPUnit_Extensions_Selenium2TestCase_Element $clickElement * @param string $waitForSelector * @param boolean $displayCheck * @return \PHPUnit_Extensions_Selenium2TestCase_Element|null */ protected function clickAndWait(\PHPUnit_Extensions_Selenium2TestCase_Element $clickElement, $waitForSelector, $displayCheck = false) { $this->execute(['script' => 'window.scrollTo(' . $clickElement->location()['x'] . ', ' . $clickElement->location()['y'] . ');', 'args' => []]); $clickElement->click(); try { $element = $this->waitUntil(function (BaseSeleniumTestCase $testCase) use($waitForSelector, $displayCheck) { try { $element = $testCase->byCssSelector($waitForSelector); if (!$displayCheck || $element->displayed()) { return $element; } } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { // nothing to do } return null; }, $this->timeout); } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { $element = null; } return $element; }
/** * Method configure user IMAP sync * @param array $imapSetting * @return $this */ public function setImap($imapSetting) { $this->test->byXpath("//div[@class='control-group imap-config check-connection control-group-checkbox']" . "//input[@data-ftid='oro_user_user_form_imapConfiguration_useImap']")->click(); $this->waitForAjax(); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_imapHost']")->value($imapSetting['host']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_imapPort']")->value($imapSetting['port']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_user']")->value($imapSetting['user']); $this->test->byXPath("//input[@data-ftid='oro_user_user_form_imapConfiguration_password']")->value($imapSetting['password']); $this->encryption = $this->test->select($this->test->byXpath("//*[@data-ftid='oro_user_user_form_imapConfiguration_imapEncryption']")); $this->encryption->selectOptionByLabel($imapSetting['encryption']); $this->test->byXPath("//button[@id='oro_user_user_form_imapConfiguration_check_connection']")->click(); $this->waitForAjax(); $this->waitPageToLoad(); $this->test->byXPath("//div[@class='control-group folder-tree " . "control-group-oro_email_email_folder_tree']//input[@class='check-all']")->click(); return $this; }
public function getDueDate() { $this->dueDate = $this->test->byXpath("//*[@data-ftid='orocrm_task_dueDate']/.." . "/following-sibling::*//input[contains(@class,'datepicker-input')]"); $this->dueTime = $this->test->byXpath("//*[@data-ftid='orocrm_task_dueDate']/.." . "/following-sibling::*//input[contains(@class,'timepicker-input')]"); return $this->dueDate->value() . ' ' . $this->dueTime->value(); }
public function setLoadFixtures() { $this->loadFixtures->click(); return $this; }
public function getFormValues(\PHPUnit_Extensions_Selenium2TestCase_Element $form) { // $this->accessing(); // todo: why not? $values = array(); foreach ($form->elements($this->using('tag name')->value('input')) as $input) { /** @var \PHPUnit_Extensions_Selenium2TestCase_Element $input */ $values[$input->attribute('name')] = $input->value(); } foreach ($form->elements($this->using('tag name')->value('textarea')) as $textarea) { /** @var \PHPUnit_Extensions_Selenium2TestCase_Element $textarea */ $values[$textarea->attribute('name')] = $textarea->value(); } foreach ($form->elements($this->using('tag name')->value('select')) as $select) { /** @var \PHPUnit_Extensions_Selenium2TestCase_Element $select */ $values[$select->attribute('name')] = $select->value(); } return $values; }
/** * @param $class * @param PHPUnit_Extensions_Selenium2TestCase_Element $element */ public function assertElementHasClass($class, \PHPUnit_Extensions_Selenium2TestCase_Element $element) { $classes = explode(' ', $element->attribute('class')); $this->assertContains($class, $classes); }
/** * Retrieve relative xpath from context to element * * @param \PHPUnit_Extensions_Selenium2TestCase_Element $element * @param \PHPUnit_Extensions_Selenium2TestCase_Element $context * @param string $path * @param bool $includeLastIndex * @return null */ protected function getRelativeXpath(\PHPUnit_Extensions_Selenium2TestCase_Element $element, \PHPUnit_Extensions_Selenium2TestCase_Element $context, $path = '', $includeLastIndex = true) { if ($element->equals($context)) { return '.' . $path; } $parentLocator = new Locator('..', Locator::SELECTOR_XPATH); $parentElement = $element->element($this->getSearchCriteria($parentLocator)); $childrenLocator = new Locator('*', Locator::SELECTOR_XPATH); $index = 1; $tag = $element->name(); if (!$includeLastIndex) { return $this->getRelativeXpath($parentElement, $context, '/' . $tag); } foreach ($parentElement->elements($this->getSearchCriteria($childrenLocator)) as $child) { if ($child->equals($element)) { return $this->getRelativeXpath($parentElement, $context, '/' . $tag . '[' . $index . ']' . $path); } if ($child->name() == $tag) { ++$index; } } return null; }
public function getDescription() { return $this->description->value(); }
/** * @param string $title * @return $this */ public function setDefaultTitle($title) { $this->defaultTitle->value($title); return $this; }
public function getAccountName() { return $this->accountName->value(); }
public function getDueDate() { return $this->dueDate->value(); }
/** * @return string */ public function getBusinessUnitName() { return $this->businessUnitName->value(); }
public function getLabel() { return $this->label->value(); }
/** * @return PHPUnit_Extensions_Selenium2TestCase_Element_Select */ public function select(PHPUnit_Extensions_Selenium2TestCase_Element $element) { $tag = $element->name(); if ($tag !== 'select') { throw new InvalidArgumentException("The element is not a `select` tag but a `{$tag}`."); } return PHPUnit_Extensions_Selenium2TestCase_Element_Select::fromElement($element); }
public function getName() { return $this->name->value(); }
public function sendKeys(\PHPUnit_Extensions_Selenium2TestCase_Element $element, $keys) { if ($this->fileDetectorFunction && call_user_func($this->fileDetectorFunction, $keys)) { $remote_file = $this->file($keys); $element->value($remote_file); } else { $element->click(); $this->keys($keys); } }
public function getCloseDate() { return $this->closeDate->value(); }
/** * @return array instances of PHPUnit_Extensions_Selenium2TestCase_Element */ public function elements(PHPUnit_Extensions_Selenium2TestCase_ElementCriteria $criteria) { $values = $this->postCommand('elements', $criteria); $elements = array(); foreach ($values as $value) { $elements[] = PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue($value, $this->url->descend('element'), $this->driver); } return $elements; }
/** * @param array WebElement JSON object * @return PHPUnit_Extensions_Selenium2TestCase_Element */ public function elementFromResponseValue($value) { return PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue($value, $this->getSessionUrl()->descend('element'), $this->driver); }
/** * @param $email * @return $this */ public function setEmail($email) { $this->email->clear(); $this->email->value($email); return $this; }