Beispiel #1
0
 function CheckInListLanding($name1, $isocode1, $symbol1)
 {
     $I = $this;
     $I->wait('1');
     $I->see($name1, './/*[@id="mainContent"]/section/div[2]/div/form/table/tbody/tr[last()]/td[2]/a');
     $I->see($isocode1, './/*[@id="mainContent"]/section/div[2]/div/form/table/tbody/tr[last()]/td[3]');
     $I->see($symbol1, './/*[@id="mainContent"]/section/div[2]/div/form/table/tbody/tr[last()]/td[4]');
     $RadioBut = $I->grabAttributeFrom(\CurrenciesPage::RadioButtonLine("last()"), 'checked');
     $I->comment("{$RadioBut}");
     $I->assertEquals($RadioBut, null);
     $ActiveBut = $I->grabAttributeFrom(\CurrenciesPage::ActiveButtonLine("last()"), 'class');
     $I->comment("{$ActiveBut}");
     $I->assertEquals($ActiveBut, "prod-on_off disable_tovar");
     $DeleteBut = $I->grabAttributeFrom(\CurrenciesPage::DeleteButtonLine("last()"), 'disabled');
     $I->comment("DeleteBut");
     $I->assertEquals($DeleteBut, null);
 }
Beispiel #2
0
 /**
  * Delete currencies with passed name
  * 
  * @param array|string $settedTodeleteName
  */
 public function deleteCurrencies($settedTodeleteName)
 {
     $I = $this;
     $I->amOnPage(\CurrenciesPage::$URL);
     $CurrenciesAmount = $I->grabClassCount($I, 'mainCurrency');
     for ($row = 1; $row <= $CurrenciesAmount; ++$row) {
         $findedCur = $I->grabTextFrom(\CurrenciesPage::CuccencyNameLine($row));
         if (is_string($settedTodeleteName) && $findedCur == $settedTodeleteName || is_array($settedTodeleteName) && in_array($findedCur, $settedTodeleteName)) {
             $I->click("//tr[{$row}]//td[7]//button");
             $I->waitForElementVisible("div#first .btn.btn-primary");
             $I->wait(1);
             $I->click("div#first .btn.btn-primary");
             $I->waitForElementNotVisible("div#first .btn.btn-primary");
             $I->wait(3);
             $row--;
             $CurrenciesAmount--;
         }
     }
 }
 public function DeleteCurUsedInPaymentMethods(CurrenciesTester $I)
 {
     //Проверка возможности удаления валюты, которая используется в способах оплаты
     $I->amOnPage("/admin/components/run/shop/currencies");
     $SymbolCur = $I->grabTextFrom(".//*[@class='']/tr[4]/td[4]");
     $id = $I->grabTextFrom(".//*[@class='']/tr[4]/td[1]");
     $I->comment("{$SymbolCur}");
     $I->comment("{$id}");
     $I->amOnPage('/admin/components/run/shop/paymentmethods/create');
     $I->waitForText('Создание способа оплаты');
     $I->fillField(PaymentCreatePage::$FieldName, 'Оплата');
     $I->click(PaymentCreatePage::$SelectCurrency);
     $I->click(PaymentCreatePage::SelectCurrency('4'));
     $I->wait('1');
     $SelectCur = $I->grabTextFrom(PaymentCreatePage::SelectCurrency('4'));
     $I->comment("{$SelectCur}");
     $SelectCur = trim(preg_replace("/\\s+/", " ", $SelectCur));
     $Cur = explode(" ", $SelectCur);
     foreach ($Cur as $key => $value) {
         if ($value) {
             $I->comment("{$key}: {$value}");
         }
     }
     $text = $Cur[2];
     $I->comment($text);
     $I->click(PaymentCreatePage::$ButtonCreate);
     $I->waitForText("Способ оплаты создан");
     $I->assertEquals($SymbolCur, $text);
     $I->amOnPage("/admin/components/run/shop/currencies");
     $I->click(CurrenciesPage::DeleteButtonLine('4'));
     $I->waitForElement(".//div[@class='modal hide fade in']");
     $I->see('Удалить валюту');
     $I->see('Удалить выбранную валюту?');
     $I->see('Удалить', './/*[@id="first"]/div[3]/a[1]');
     $I->see('Отменить', './/*[@id="first"]/div[3]/a[2]');
     $I->click('.//*[@id="first"]/div[3]/a[1]');
     $I->waitForElementVisible('.alert.in.fade.alert-error');
     $I->see('Невозможно удалить валюту. Эта валюта используется в Способах оплаты.');
     $I->waitForElementNotVisible('.alert.in.fade.alert-error');
     $I->amOnPage('/admin/components/run/shop/paymentmethods/index');
     $I->click(PaymentListPage::CheckboxLine('last()'));
     $I->wait('2');
     $I->click(PaymentListPage::$ButtonDelete);
     $I->waitForElement(".//*[@id='mainContent']/div/div[1]");
     $I->wait('1');
     $I->click(".//*[@id='mainContent']/div/div[1]/div[3]/a[1]");
     $I->waitForElementVisible('.alert.in.fade.alert-success');
     $I->see('Способ оплаты удален');
     $I->waitForElementNotVisible('.alert.in.fade.alert-success');
     $I->amOnPage("/admin/components/run/shop/currencies");
     $I->click(CurrenciesPage::DeleteButtonLine('4'));
     $I->waitForElement(".//div[@class='modal hide fade in']");
     $I->see('Удалить валюту');
     $I->see('Удалить выбранную валюту?');
     $I->see('Удалить', './/*[@id="first"]/div[3]/a[1]');
     $I->see('Отменить', './/*[@id="first"]/div[3]/a[2]');
     $I->click('.//*[@id="first"]/div[3]/a[1]');
     $I->waitForElementVisible('.alert.in.fade.alert-success');
     $I->see('Валюта успешно удалена');
     $I->waitForElementNotVisible('.alert.in.fade.alert-success');
     $rows = $I->grabTagCount($I, "tbody tr");
     for ($j = 1; $j <= $rows; $j++) {
         $idAfter = $I->grabTextFrom("//tbody/tr[{$j}]/td[1]");
         $I->comment($idAfter);
         if ($idAfter == $id) {
             $I->fail("NOT DELETED");
             break;
         }
     }
     InitTest::ClearAllCach($I);
 }
 /**
  * @guy CurrenciesTester\CurrenciesSteps
  */
 public function CreateAndExitButton(CurrenciesTester\CurrenciesSteps $I)
 {
     $name = "лира";
     $isocode = "лира";
     $symbol = "лира";
     $rate = "01030.2";
     $save = "saveexit";
     $I->CreateCurrency($name, $isocode, $symbol, $rate, $save);
     //        $I->waitForElementVisible('.alert.in.fade.alert-success');
     $I->waitForText('Валюта создана');
     //        $I->waitForElementNotVisible('.alert.in.fade.alert-success');
     $I->waitForText('Список валют');
     $name1 = "лира";
     $isocode1 = "лира";
     $symbol1 = "лира";
     $rate1 = "1030.2000";
     $I->CheckInListLanding($name1, $isocode1, $symbol1);
     $I->click(CurrenciesPage::CurrencyNameLine("last()"));
     $I->CheckInFields($name1, $isocode1, $symbol1, $rate1);
     InitTest::ClearAllCach($I);
 }
Beispiel #5
0
 /**
  * Grab all currencies
  * 
  * Grab all currencies in currencies list page and add them to array
  * If $settedTodeleteName passed olso delete currencies with this name
  * 
  * @param   AcceptanceTester $I
  * @param   array|string $settedTodeleteName set it, to delete one currency or array of currencies
  * @return  array   all creted currencies
  */
 protected function GrabAllCreatedCurrenciesOrDelete(AcceptanceTester $I, $settedTodeleteName = null)
 {
     $Currencies = [];
     $I->amOnPage(CurrenciesPage::$URL);
     $CurrenciesAmount = $I->grabClassCount($I, 'mainCurrency');
     for ($row = 1; $row <= $CurrenciesAmount; ++$row) {
         $findedCur = $I->grabTextFrom(CurrenciesPage::CuccencyNameLine($row));
         if (is_string($settedTodeleteName) && $findedCur == $settedTodeleteName || is_array($settedTodeleteName) && in_array($findedCur, $settedTodeleteName)) {
             $I->click("//tr[{$row}]//td[7]//button");
             $I->waitForElementVisible("div#first .btn.btn-primary");
             $I->wait(1);
             $I->click("div#first .btn.btn-primary");
             $I->waitForElementNotVisible("div#first .btn.btn-primary");
             $I->wait(3);
             $row--;
             $CurrenciesAmount--;
         } else {
             $Currencies[] = $findedCur;
         }
     }
     return $Currencies;
 }