Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public function setSolution($solution)
 {
     $this->solution = $this->test->byId('oro_workflow_transition_proposed_solution');
     $this->solution->clear();
     $this->solution->value($solution);
     return $this;
 }
Ejemplo n.º 3
0
 public function submit()
 {
     $this->searchButton->click();
     sleep(1);
     $this->waitPageToLoad();
     $this->waitForAjax();
     return $this;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 /**
  * @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;
 }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 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;
 }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 11
0
 /**
  * @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;
 }
Ejemplo n.º 12
0
 /**
  * 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;
 }
Ejemplo n.º 13
0
Archivo: Task.php Proyecto: CopeX/crm
 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();
 }
Ejemplo n.º 14
0
 public function setLoadFixtures()
 {
     $this->loadFixtures->click();
     return $this;
 }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 16
0
 /**
  * @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);
 }
Ejemplo n.º 17
0
 /**
  * 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;
 }
Ejemplo n.º 18
0
 public function getDescription()
 {
     return $this->description->value();
 }
Ejemplo n.º 19
0
 /**
  * @param string $title
  * @return $this
  */
 public function setDefaultTitle($title)
 {
     $this->defaultTitle->value($title);
     return $this;
 }
Ejemplo n.º 20
0
 public function getAccountName()
 {
     return $this->accountName->value();
 }
Ejemplo n.º 21
0
Archivo: Task.php Proyecto: dairdr/crm
 public function getDueDate()
 {
     return $this->dueDate->value();
 }
Ejemplo n.º 22
0
 /**
  * @return string
  */
 public function getBusinessUnitName()
 {
     return $this->businessUnitName->value();
 }
Ejemplo n.º 23
0
 public function getLabel()
 {
     return $this->label->value();
 }
Ejemplo n.º 24
0
 /**
  * @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);
 }
Ejemplo n.º 25
0
 public function getName()
 {
     return $this->name->value();
 }
Ejemplo n.º 26
0
 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);
     }
 }
Ejemplo n.º 27
0
 public function getCloseDate()
 {
     return $this->closeDate->value();
 }
Ejemplo n.º 28
0
 /**
  * @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;
 }
Ejemplo n.º 29
0
 /**
  * @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);
 }
Ejemplo n.º 30
0
 /**
  * @param $email
  * @return $this
  */
 public function setEmail($email)
 {
     $this->email->clear();
     $this->email->value($email);
     return $this;
 }