-
-
Notifications
You must be signed in to change notification settings - Fork 521
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for By locators in Target objects and Action classes.
- Loading branch information
Showing
9 changed files
with
190 additions
and
5 deletions.
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
144 changes: 144 additions & 0 deletions
144
...b/src/main/java/net/serenitybdd/screenplay/questions/UnresolvedTargetWebElementState.java
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 |
---|---|---|
@@ -0,0 +1,144 @@ | ||
package net.serenitybdd.screenplay.questions; | ||
|
||
import net.serenitybdd.core.pages.WebElementState; | ||
|
||
/** | ||
* Created by john on 14/01/2016. | ||
*/ | ||
public class UnresolvedTargetWebElementState implements WebElementState { | ||
|
||
private final String name; | ||
|
||
public UnresolvedTargetWebElementState(String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "not so"; | ||
} | ||
|
||
@Override | ||
public boolean isVisible() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isCurrentlyVisible() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isCurrentlyEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void shouldBeVisible() { | ||
throw new AssertionError("Element should be visible"); | ||
} | ||
|
||
@Override | ||
public void shouldBeCurrentlyVisible() { | ||
throw new AssertionError("Element should be visible"); | ||
} | ||
|
||
@Override | ||
public void shouldNotBeVisible() {} | ||
|
||
@Override | ||
public void shouldNotBeCurrentlyVisible() {} | ||
|
||
@Override | ||
public boolean hasFocus() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean containsText(String value) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean containsOnlyText(String value) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean containsSelectOption(String value) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void shouldContainText(String textValue) { | ||
throw new AssertionError("Element should contain text " + textValue); | ||
} | ||
|
||
@Override | ||
public void shouldContainOnlyText(String textValue) { | ||
throw new AssertionError("Element should contain text " + textValue); | ||
} | ||
|
||
@Override | ||
public void shouldContainSelectedOption(String textValue) { | ||
throw new AssertionError("Element should contain selected option " + textValue); | ||
} | ||
|
||
@Override | ||
public void shouldNotContainText(String textValue) {} | ||
|
||
@Override | ||
public void shouldBeEnabled() { | ||
throw new AssertionError("Element should be enabled"); | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void shouldNotBeEnabled() { | ||
|
||
} | ||
|
||
@Override | ||
public String getSelectedVisibleTextValue() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getSelectedValue() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean isPresent() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void shouldBePresent() { | ||
throw new AssertionError("Element should be present"); | ||
} | ||
|
||
@Override | ||
public void shouldNotBePresent() { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isSelected() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String getTextValue() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public WebElementState expect(String errorMessage) { | ||
return null; | ||
} | ||
} |
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
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