-
Notifications
You must be signed in to change notification settings - Fork 65
Add opposite checking steps part2 #68
Merged
GannaChernyshova
merged 8 commits into
alfa-laboratory:master
from
snfrolov:add-opposite-checking-steps-part2
May 25, 2018
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2d3dbb3
Merge pull request #1 from alfa-laboratory/master
snfrolov 555e89e
Merge pull request #2 from alfa-laboratory/master
snfrolov 70b5c31
add opposite checking steps and test, update selenide
75a362a
delete step
cf2be8d
исправлены замечания
449dc36
исправлены замечания Ани
72edbf2
resolve merge conflict
fe01fa0
вернул обратно тесты
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -588,6 +588,17 @@ public void checkElemClassContainsExpectedValue(String elementName, String expec | |
, currentClassValue.toLowerCase(), containsString(expectedClassValue.toLowerCase())); | ||
} | ||
|
||
/** | ||
* Проверка, что элемент не содержит указанный класс | ||
*/ | ||
@Тогда("^элемент \"([^\"]*)\" не содержит класс со значением \"(.*)\"$") | ||
public void checkElemClassNotContainsExpectedValue(String elementName, String expectedClassValue) { | ||
SelenideElement currentElement = akitaScenario.getCurrentPage().getElement(elementName); | ||
assertThat(String.format("Элемент [%s] содержит класс со значением [%s]", elementName, expectedClassValue), | ||
currentElement.getAttribute("class").toLowerCase(), | ||
Matchers.not(containsString(getPropertyOrStringVariableOrValue(expectedClassValue).toLowerCase()))); | ||
} | ||
|
||
/** | ||
* Выполняется переход в конец страницы | ||
*/ | ||
|
@@ -651,6 +662,15 @@ public void fieldIsDisable(String elementName) { | |
assertTrue(String.format("Элемент [%s] доступен для редактирования", elementName), element.is(Condition.disabled)); | ||
} | ||
|
||
/** | ||
* Проверка, что поле редактируемо | ||
*/ | ||
@Тогда("^(?:поле|элемент) \"([^\"]*)\" (?:доступно|доступен) для редактирования$") | ||
public void fieldIsEnabled(String elementName) { | ||
SelenideElement element = akitaScenario.getCurrentPage().getElement(elementName); | ||
assertFalse(String.format("Элемент [%s] недоступен для редактирования", elementName), element.is(Condition.disabled)); | ||
} | ||
|
||
/** | ||
* Проверка, что список со страницы совпадает со списком из переменной | ||
* без учёта порядка элементов | ||
|
@@ -663,6 +683,18 @@ public void compareListFromUIAndFromVariable(String listName, String listVariabl | |
assertThat(String.format("Список со страницы [%s] не совпадает с ожидаемым списком из переменной [%s]", listName, listVariable), actualList, equalTo(expectedList)); | ||
} | ||
|
||
/** | ||
* Проверка, что список со страницы не совпадает со списком из переменной | ||
* без учёта порядка элементов | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
@Тогда("^список \"([^\"]*)\" со страницы не совпадает со списком \"([^\"]*)\"$") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. кажется это не очень конкретный шаг. если хотя бы по одному элементу произойдет не совпадение - шаг пройдет и будет не понятно, это корректное поведение или нет. проверками того, что список соответствует ожидаемому или содержит/не содержит элемент можно покрыть все нужные кейсы There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. УДалил |
||
public void compareListFromPageAndFromVariableNotEquals(String listName, String listVariable) { | ||
HashSet<String> expectedList = new HashSet<>((List<String>) akitaScenario.getVar(listVariable)); | ||
HashSet<String> actualList = new HashSet<>(akitaScenario.getCurrentPage().getAnyElementsListTexts(listName)); | ||
assertThat(String.format("Список со страницы [%s] совпадает с ожидаемым списком из переменной [%s]", listName, listVariable), actualList, Matchers.not(equalTo(expectedList))); | ||
} | ||
|
||
/** | ||
* Проверка, что на странице не отображаются редактируемые элементы, такие как: | ||
* -input | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
излишне. когда в поле вводится значение неявно происходит проверка того, что оно редактируемо. соответственно, поле можно и желательно проверять введя туда тест и проверив, что он отобразился как ожидалось.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Удалил