Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void open(WebDriver driver, String url)
- /*
- забыл убрать параметр WebDriver driver
- */
- *******************************
- public static ExpectedCondition<List<WebElement>> listNthElementHasText(final By elementsLocator, final int index, final String text) {
- if (text.equals(0) & index < 0) {
- throw new IllegalArgumentException("Array of expected texts is empty.");
- }
- /*
- это с прошлого раза осталось
- см ревью к прошлой работе
- я бы если и стала реализовывать
- то что-то вот такое
- */
- if (text.isEmpty()) {
- throw new IllegalArgumentException("Expected text is empty.");
- }
- if (index < 0)) {
- throw new IllegalArgumentException("Index is negative.");
- }
- /*
- почему 2 if-a - т к нам нужно описать проблемы эти по-разному
- или один if (с условием (text.isEmpty() || (index < 0)))
- но тогда описать нужно проблему по-другому
- что-то типа
- Expected text shoul be not empty
- Index should be >= 0
- http://stackoverflow.com/questions/3321526/should-i-use-string-isempty-or-equalsstring
- https://docs.oracle.com/javase/tutorial/java/nutsandbolts/op2.html (раздел The Conditional Operators)
- http://stackoverflow.com/questions/1795808/and-and-or-in-if-statements
- */
- **********************************************
Advertisement
Add Comment
Please, Sign In to add comment