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 DeleteCurUsedInProducts(CurrenciesTester $I) { //Проверка возможности удаления валюты, которая используется в товарах $I->amOnPage("/admin/components/run/shop/currencies"); $I->click(CurrenciesPage::RadioButtonLine('1')); $I->wait('1'); $IsoCur = $I->grabTextFrom(".//*[@class='']/tr[3]/td[3]"); $id = $I->grabTextFrom(".//*[@class='']/tr[3]/td[1]"); $SymbCur = $I->grabTextFrom(".//*[@class='']/tr[3]/td[4]"); $I->comment("{$IsoCur}"); $I->comment("{$id}"); $I->comment("{$SymbCur}"); $MainCurIso = $I->grabTextFrom(".//*[@class='']/tr[1]/td[3]"); $this->MainCurSymb = $I->grabTextFrom(".//*[@class='']/tr[1]/td[4]"); $I->comment("{$MainCurIso}"); $I->comment("{$this->MainCurSymb}"); $I->click(CurrenciesPage::CurrencyNameLine('1')); $I->waitForText('Редактирование валют'); $I->fillField(CurrenciesPage::$Rate, '1'); $I->click(CurrenciesPage::$SaveAndExitButton); $I->waitForText('Список валют'); $I->click(CurrenciesPage::CurrencyNameLine('3')); $I->waitForText('Редактирование валют'); $I->fillField(CurrenciesPage::$Rate, '2'); $I->click(CurrenciesPage::$SaveAndExitButton); $I->waitForText('Список валют'); $I->amOnPage('/admin/components/run/shop/products/create'); $I->waitForText('Создание товара'); $this->price = 100; $I->fillField('.//*[@id="Name"]', 'Товар2'); $I->fillField(".//*[@id='ProductVariantRow_0']/td[2]/input", "{$this->price}"); $I->click(".//*[@id='ProductVariantRow_0']/td[3]/select"); $I->click(".//*[@id='ProductVariantRow_0']/td[3]/select/option[3]"); $I->wait('1'); $IsoProduct = $I->grabTextFrom(".//*[@id='ProductVariantRow_0']/td[3]/select/option[3]"); $I->comment("{$IsoProduct}"); $I->click(CurrenciesPage::$SaveButton); $I->waitForText("Продукт был успешно создан"); $I->assertEquals($IsoProduct, $IsoCur); $I->amOnPage("/"); $I->fillField(".//*[@id='inputString']", 'товар2'); $I->click("html/body/div[1]/div[1]/header/div[2]/div/div/div[2]/div[2]/div/form/span/button"); $I->wait('1'); $k = $I->grabTextFrom(".//*[@id='items-catalog-main']/li/div[1]/div[2]/span/span/span/span[1]"); $sym = $I->grabTextFrom(".//*[@id='items-catalog-main']/li/div[1]/div[2]/span/span/span/span[2]"); $i = $k * 2; $I->comment("{$i}", "{$k}", "{$sym}"); $I->assertEquals($i, $this->price); $I->assertEquals($sym, $this->MainCurSymb); $I->amOnPage("/admin/components/run/shop/currencies"); $I->click(CurrenciesPage::CurrencyNameLine('3')); $I->waitForText('Редактирование валют'); $I->fillField(CurrenciesPage::$Rate, '4'); $I->click(CurrenciesPage::$SaveAndExitButton); $I->waitForText('Список валют'); $I->waitForElementVisible('.alert.in.fade.alert-success'); $I->see('Изменения сохранены'); $I->waitForElementNotVisible('.alert.in.fade.alert-success'); $I->click(CurrenciesPage::$VerifyPrices); $I->waitForElementVisible('.alert.in.fade.alert-success'); $I->see('Цены обновлены', '.alert.in.fade.alert-success'); $I->amOnPage("/"); $I->fillField(".//*[@id='inputString']", 'товар2'); $I->click("html/body/div[1]/div[1]/header/div[2]/div/div/div[2]/div[2]/div/form/span/button"); $I->wait('1'); $k3 = $I->grabTextFrom(".//*[@id='items-catalog-main']/li/div[1]/div[2]/span/span/span/span[1]"); $sym3 = $I->grabTextFrom(".//*[@id='items-catalog-main']/li/div[1]/div[2]/span/span/span/span[2]"); $i3 = $k3 * 4; $I->comment("{$i3}", "{$k3}", "{$sym3}"); $I->assertEquals($i3, $this->price); $I->assertEquals($sym, $this->MainCurSymb); $I->amOnPage("/admin/components/run/shop/currencies"); $I->click(CurrenciesPage::DeleteButtonLine('3')); $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->waitForElement(".//*[@id='recount']"); $I->wait('1'); $I->see('Пересчет'); $I->see('Валюта используется в товарах. Пересчитать?'); $I->see('Пересчитать', ".//*[@id='recount']/div[3]/a[1]"); $I->see('Отменить', ".//*[@id='recount']/div[3]/a[2]"); $I->click(".//*[@id='recount']/div[3]/a[1]"); $I->waitForElementVisible('.alert.in.fade.alert-success'); $I->see('Преобразование завершено. Сейчас валюта может быть удалена'); $I->waitForElementNotVisible('.alert.in.fade.alert-success'); $I->click(CurrenciesPage::DeleteButtonLine('3')); $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; } } $I->click(CurrenciesPage::$VerifyPrices); $I->waitForElementVisible('.alert.in.fade.alert-success'); $I->see('Цены обновлены'); $I->waitForElementNotVisible('.alert.in.fade.alert-success'); }