Example #1
0
 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());
 }