/** * @param $from * @param $to * @return ResultsPage */ public function Search($from, $to) { $i = $this->actor; $i->fillField(self::FROM_FIELD, $from); $i->fillField(self::TO_FIELD, $to); $i->click('#search'); $i->waitForElement(self::HOTEL_CHKBOX, 60); $i->click(self::AIRBNB_CHKBOX); $i->click(self::SEARCH_BUTTON); return ResultsPage::of($i); }
/** * Search with default date * * @param $from * @param $to * @return ResultsPage */ public function Search($from, $to) { $i = $this->actor; //Fill from and to fields and click search button $i->fillField(self::FROM_FIELD, $from); $i->fillField(self::TO_FIELD, $to); $i->click('#search'); $i->click(self::SEARCH_BUTTON); //Wait for page to load $i->waitForJS('return document.readyState === \'complete\''); return ResultsPage::of($i); }
public function verifyTrainPriceIsSortedInAscendingOrder() { $i = $this->actor; $amount1 = 0; $pageCount = 1; do { if ($pageCount != 1) { // Go to next result page ResultsPage::goToNextResultPage(); } //Get number of result trains on given page $count = ResultsPage::noOfTrainResultsOnPage(); for ($k = 1; $k <= $count; $k++) { //Get train fare for each result $amount2 = self::getTrainFare($k); //Assert results are sorted in terms of price (cheapest first) $i->assertTrue($amount1 <= $amount2); $amount1 = $amount2; } $pageCount++; } while (self::isElementNextPagePresent()); }