Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface SmartElement extends SmartEntity<WebElement>, WebElement {
- void setValue(String text);
- /*
- а пусть метод возвращает SmartElement
- ну и вполне можно дореализовать doubleClick() & hover()
- */
- SmartElement shouldBe(Condition<WebElement>... conditions);
- SmartElement shoudHave(Condition<WebElement> condition);
- /*
- не shoudHave
- а shouldHave
- ну и параметр методу подправь тоже
- лучше
- не Condition<WebElement> condition
- а Condition<WebElement>... conditions
- тогда сможешь методы вызвать как для одного кондишена, так и для нескольких
- */
- }
- ************************************************
- public interface SmartCollection extends SmartEntity<List<WebElement>>, Iterable<SmartElement> {
- SmartCollection shoudBe(Condition<List<WebElement>>... conditions);
- SmartCollection shoudHave(Condition<List<WebElement>>... conditions);
- }
- /*
- shou___l___d
- тут тоже это поправь
- */
- ******************************
- @Override
- public Rectangle getRect() {
- return null;
- }
- /*
- пропустил
- */
- *****************************
- @Override
- public WebElement getWrappedEntity() {
- return getDriver().findElement(this.locator);
- }
- /*
- this.locator - тут можно и короче - locator
- нам тут можно не уточняться до this
- т к нету тут параметра метода locator
- и единственная переменная locator, которая доступна - это и есть this.locator
- */
- *************************************
- public abstract class AbstractCondition<V> extends Condition<V> {
- ...
- public abstract String expected();
- public abstract String actual();
- /*
- строки 350-376 прошлого ревью
- */
- *****************************************
- public interface SmartEntity<V> {
- V getWrappedEntity();
- String identity();
- }
- /*
- и тут можно - String identity();
- вынести в отдельный интерфейс DescribesEntity
- и уже SmartEntity<V> отнаследовать от DescribesEntity
- цель - разделить ответственности )
- Single Responsibility Principle
- */
Advertisement
Add Comment
Please, Sign In to add comment