Ejemplo n.º 1
0
 public function submit()
 {
     $this->searchButton->click();
     sleep(1);
     $this->waitPageToLoad();
     $this->waitForAjax();
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * @param $user
  * @return $this
  */
 public function setUser($user)
 {
     $this->user->click();
     $this->user->value($user);
     $this->waitForAjax();
     $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$user}')]", "Users autocomplete field doesn't return entity");
     $this->test->byXpath("//div[@id='select2-drop']//div[contains(., '{$user}')]")->click();
     return $this;
 }
Ejemplo n.º 3
0
 public function setB2BCustomer($customer)
 {
     $this->b2b_customer->click();
     $this->waitForAjax();
     $this->test->byXpath("//div[@id='select2-drop']/div/input")->value($customer);
     $this->waitForAjax();
     $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$customer}')]", "Account autocomplete doesn't return search value");
     $this->test->byXpath("//div[@id='select2-drop']//div[contains(., '{$customer}')]")->click();
     return $this;
 }
Ejemplo n.º 4
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.º 5
0
 public function setOwner($owner)
 {
     $this->owner = $this->test->byXPath("//div[starts-with(@id,'s2id_orocrm_account_form_owner')]/a");
     $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
 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.º 7
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.º 8
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.º 9
0
Archivo: Task.php Proyecto: CopeX/crm
 /**
  * @param $dueDate string Due date
  * @return $this
  * @throws \Exception
  */
 public function setDueDate($dueDate)
 {
     $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')]");
     $this->dueDate->clear();
     $this->dueTime->clear();
     $dueDateParts = [];
     if (preg_match('/^(.+\\d{4}),?\\s(\\d{1,2}\\:\\d{2}\\s\\w{2})$/', $dueDate, $dueDateParts)) {
         $this->dueDate->click();
         // focus
         $this->dueDate->value($dueDateParts[1]);
         $this->dueTime->click();
         // focus
         $this->dueTime->clear();
         $this->dueTime->value($dueDateParts[2]);
     } else {
         throw new Exception("Value {$dueDate} is not a valid date");
     }
     return $this;
 }
Ejemplo n.º 10
0
 /**
  * @param $tag
  * @return $this
  * @throws \Exception
  */
 public function setTag($tag)
 {
     if ($this->isElementPresent("//div[starts-with(@id,'s2id_oro_user_user_form_tags_autocomplete')]")) {
         $this->tags = $this->test->byXpath("//div[starts-with(@id,'s2id_oro_user_user_form_tags_autocomplete')]//input");
         $this->tags->click();
         $this->tags->value($tag);
         $this->waitForAjax();
         $this->assertElementPresent("//div[@id='select2-drop']//div[contains(., '{$tag}')]", "Tag's autocomplete doesn't return entity");
         $this->test->byXpath("//div[@id='select2-drop']//div[contains(., '{$tag}')]")->click();
         return $this;
     } else {
         throw new \Exception("Tag field can't be found");
     }
 }
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
 public function setLoadFixtures()
 {
     $this->loadFixtures->click();
     return $this;
 }
Ejemplo n.º 13
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);
     }
 }