-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #467: moved ErrorCause and ErrorType to their own file
- Loading branch information
Showing
5 changed files
with
57 additions
and
60 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
core/src/main/java/com/seleniumtests/core/testanalysis/ErrorCause.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,47 @@ | ||
package com.seleniumtests.core.testanalysis; | ||
|
||
public class ErrorCause { | ||
|
||
private ErrorType type; | ||
private String description; | ||
|
||
public ErrorCause(ErrorType type, String description) { | ||
this.type = type; | ||
this.description = description; | ||
} | ||
|
||
public ErrorType getType() { | ||
return type; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == null) { | ||
return false; | ||
} | ||
|
||
if (obj instanceof ErrorCause && this == obj) { | ||
return true; | ||
} | ||
|
||
ErrorCause cause = (ErrorCause)obj; | ||
return cause.description != null && cause.description.equals(description) && cause.type == type; | ||
|
||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
if (description != null) { | ||
return description.hashCode(); | ||
} else { | ||
return 0; | ||
} | ||
|
||
} | ||
|
||
|
||
} |
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
9 changes: 9 additions & 0 deletions
9
core/src/main/java/com/seleniumtests/core/testanalysis/ErrorType.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,9 @@ | ||
package com.seleniumtests.core.testanalysis; | ||
|
||
|
||
public enum ErrorType { | ||
ERROR_MESSAGE, // error message displayed | ||
ERROR_IN_FIELD, // some field shows an error (it's coloured in red) | ||
APPLICATION_CHANGED, // compared to the page we expect, the page we are on is slightly different | ||
SELENIUM_ERROR // we are not on the right page to perform our actions, it may be due to a problem when clicking during previous step | ||
} |
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