Skip to content

Commit

Permalink
Merge 3bedd87 into d074b3a
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal Hameed committed Mar 25, 2016
2 parents d074b3a + 3bedd87 commit 9f7bb74
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,29 @@ public WebElement findElement(SearchContext context) {
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByAttribute other = (ByAttribute) obj;
if (attribute == null) {
if (other.attribute != null)
return false;
} else if (!attribute.equals(other.attribute))
return false;
if (word == null) {
if (other.word != null)
return false;
} else if (!word.equals(other.word))
return false;
return true;
}

@Override
public String toString() {
return "ByAttribute(\"" + attribute + "\"): " + word;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,34 @@ public WebElement findElement(SearchContext context) {
return ((FindsByXPath) context).findElementByXPath(".//*["
+ attributeContains(attribute, word) + "]");
}

@Override
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByPartialAttribute other = (ByPartialAttribute) obj;
if (attribute == null) {
if (other.attribute != null)
return false;
} else if (!attribute.equals(other.attribute))
return false;
if (word == null) {
if (other.word != null)
return false;
} else if (!word.equals(other.word))
return false;
return true;
}

@Override
public String toString() {
return "ByPartialAttribute(\"" + attribute + "\"): " + word;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,29 @@ public WebElement findElement(SearchContext context) {
return ((FindsByXPath) context).findElementByXPath(".//*["
+ textContains(text) + "]");
}

@Override
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByPartialVisibleText other = (ByPartialVisibleText) obj;
if (text == null) {
if (other.text != null)
return false;
} else if (!text.equals(other.text))
return false;
return true;
}

@Override
public String toString() {
return "ByPartialVisibleText: " + text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,29 @@ public WebElement findElement(SearchContext context) {
return ((FindsByXPath) context).findElementByXPath(".//*["
+ textContainsIgnoringCase(text) + "]");
}

@Override
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByPartialVisibleTextIgnoreCase other = (ByPartialVisibleTextIgnoreCase) obj;
if (text == null) {
if (other.text != null)
return false;
} else if (!text.equals(other.text))
return false;
return true;
}

@Override
public String toString() {
return "ByPartialVisibleTextIgnoreCase: " + text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,34 @@ public List<WebElement> findElements(SearchContext context) {

return result;
}

@Override
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByVisibleText other = (ByVisibleText) obj;
if (byPartialVisibleText == null) {
if (other.byPartialVisibleText != null)
return false;
} else if (!byPartialVisibleText.equals(other.byPartialVisibleText))
return false;
if (text == null) {
if (other.text != null)
return false;
} else if (!text.equals(other.text))
return false;
return true;
}

@Override
public String toString() {
return "ByVisibleText: " + text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,35 @@ public List<WebElement> findElements(SearchContext context) {

return result;
}

@Override
public int hashCode() {
return toString().hashCode();
}


@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ByVisibleTextIgnoreCase other = (ByVisibleTextIgnoreCase) obj;
if (byPartialVisibleTextIgnoreCase == null) {
if (other.byPartialVisibleTextIgnoreCase != null)
return false;
} else if (!byPartialVisibleTextIgnoreCase
.equals(other.byPartialVisibleTextIgnoreCase))
return false;
if (text == null) {
if (other.text != null)
return false;
} else if (!text.equals(other.text))
return false;
return true;
}

@Override
public String toString() {
return "ByVisibleTextIgnoreCase: " + text;
Expand Down

0 comments on commit 9f7bb74

Please sign in to comment.