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); }
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); }