public void checkPayOutErrorMsg(String payTool, String wallet, String sum, String errorMsg) { menuPage = new MenuPage(); menuPage.clickCashPage(); waitSleep(1500); Driver.get().switchTo().frame(Driver.get().findElement(By.cssSelector("#iframeBank + iframe"))); // paymentHistoryBtn.click(); // depositBtn.click(); payOutBtn.click(); switch (payTool) { case "qiwi": qiwiBtn.click(); break; case "skrill": skrillBtn.click(); break; case "webMoney": webMoneyBtn.click(); break; case "yandex": yandexBtn.click(); break; case "moneta": monetaBtn.click(); break; default: throw new AssertionError("unsupported payTool identifier"); } // #customerWalletFld.clear(); // #customerWalletFld.sendKeys(wallet); customerWalletFld.clear(); setTextJS(customerWalletFld, wallet); // *customerWalletFld.click(); // *customerWalletFld.sendKeys(Keys.END); // #payOutAmountFld.clear(); // #waitSleep(200); // #payOutAmountFld.sendKeys(sum); // *customerWalletFld.click(); payOutAmountFld.clear(); // #amountFld.sendKeys(sumToPay); setTextJS(payOutAmountFld, sum); payOutAmountFld.click(); payOutAmountFld.sendKeys(Keys.END); getMoneyBtn.click(); Assert.assertEquals(noMoneyMsg.getText(), errorMsg, "Error message was not as expected"); }
public void checkHistoryColumns( String numberText, String dateText, String sumText, String typeText, String walletText) { menuPage = new MenuPage(); menuPage.clickCashPage(); waitSleep(1500); Driver.get().switchTo().frame(Driver.get().findElement(By.cssSelector("#iframeBank + iframe"))); paymentHistoryBtn.click(); Assert.assertEquals(historyNumber.getText(), numberText); Assert.assertEquals(historyDate.getText(), dateText); Assert.assertEquals(historyAmount.getText(), sumText); Assert.assertEquals(historyoperType.getText(), typeText); Assert.assertEquals(historyWallet.getText(), walletText); }
public void fillInPayForm( String paySystem, String addParameter, String expAmountValues, String sumToPay) { menuPage = new MenuPage(); menuPage.clickCashPage(); wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("#iframeBank + iframe"))); Driver.get().switchTo().frame(Driver.get().findElement(By.cssSelector("#iframeBank + iframe"))); switch (paySystem) { case "credCards": checkCashPaylocator("//*[@alt='Bank Cards']"); creditCardBtn.click(); if (isElementPresent(By.xpath("//label[@for='new_card']"))) { addNewCard.click(); } wait.until(ExpectedConditions.visibilityOf(cardNumberField)); setTextJS(cardNumberField, addParameter); cardNumberField.click(); cardNumberField.sendKeys(Keys.END); setTextJS(cardHolderField, "TEST EGOR BATKOVICH"); cardHolderField.click(); cardHolderField.sendKeys(Keys.END); setTextJS(cvvField, "123"); cvvField.click(); cvvField.sendKeys(Keys.END); // cardHolderField.sendKeys(Keys.END); doubleClickValidThru(validThruNAME); break; case "qiwi": checkCashPaylocator("//*[@alt='Qiwi']"); qiwiBtn.click(); waitSleep(500); phoneFld.clear(); setTextJS(phoneFld, addParameter); break; case "yandex": checkCashPaylocator("//*[@alt='Yandex Money']"); yandexBtn.click(); break; case "webmoney": checkCashPaylocator("//*[@alt='WebMoney']"); webMoneyBtn.click(); break; case "psb": checkCashPaylocator("//*[@alt='PSB online']"); psbBtn.click(); break; case "alfa": checkCashPaylocator("//*[@alt='Alfa-Click']"); alfaclickBtn.click(); break; case "moneta": checkCashPaylocator("//*[@alt='Moneta.ru']"); monetaBtn.click(); break; case "liqpay": checkCashPaylocator("//*[@alt='LiqPay']"); liqPayBtn.click(); break; case "inercassa": checkCashPaylocator("//*[@alt='Interkassa']"); intercassaBtn.click(); break; case "sms": checkCashPaylocator("//*[@alt='Mobile Commerce']"); sMsBtn.click(); waitSleep(500); phoneFld.clear(); setTextJS(phoneFld, addParameter); break; case "skrill": checkCashPaylocator("//*[@alt='Moneybookers']"); skrillBtn.click(); break; case "w1": checkCashPaylocator("//*[@alt='W1.Ru']"); w1Btn.click(); break; } checkAmountValues(expAmountValues); customSumField.click(); customSumField.clear(); setTextJS(customSumField, sumToPay); customSumField.click(); customSumField.sendKeys(Keys.END); wait.until(ExpectedConditions.elementToBeClickable(submitPayButton)); submitPayButton.click(); }