Skip to content

Commit

Permalink
Move "type" to SourceType
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
valfirst authored and barancev committed Nov 25, 2017
1 parent f267357 commit b039ab1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Interaction createKeyUp(int codePoint) {
public Map<String, Object> encode() {
Map<String, Object> toReturn = new HashMap<>();

toReturn.put("type", "key");
toReturn.put("type", getInputType().getType());
toReturn.put("id", name);

return toReturn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SourceType getInputType() {
public Map<String, Object> encode() {
Map<String, Object> toReturn = new HashMap<>();

toReturn.put("type", "pointer");
toReturn.put("type", getInputType().getType());
toReturn.put("id", name);

Map<String, Object> parameters = new HashMap<>();
Expand Down
16 changes: 13 additions & 3 deletions java/client/src/org/openqa/selenium/interactions/SourceType.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@
* One of the allowing types for an {@link InputSource}.
*/
public enum SourceType {
KEY,
NONE,
POINTER,
KEY("key"),
NONE(null),
POINTER("pointer");

private final String type;

SourceType(String type) {
this.type = type;
}

public String getType() {
return type;
}
}

0 comments on commit b039ab1

Please sign in to comment.