Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void assertLoaded() {
- assertTrue(condition1,"condition 1 failed");
- assertTrue(condition2,"condition 2 failed");
- }
- protected boolean isLoadedBoolean() {
- try {
- assertLoaded();
- return true;
- }
- catch (Error e) {
- return false;
- }
- protected void assertLoaded() {
- assertTrue(condition1,"condition 1 failed");
- assertTrue(condition2,"condition 2 failed");
- }
- protected boolean isLoadedBoolean() {
- return condition1 && condition2;
- }
- public class PageLoadCheckFailure {
- public String reason;
- ... other interesting data ...
- public PageLoadCheckFailure(reason, ... other interesting data ...) {
- this.reason = reason;
- etc.
- }
- public String getReason() {
- return reason;
- }
- ... getters for other interesting data ...
- }
- protected PageLoadCheckFailure checkWhetherLoaded() {
- if (!condition1) {
- return new PageLoadCheckFailure("condition 1 failed", ... other interesting data...);
- }
- if (!condition2) {
- return new PageLoadCheckFailure("condition 1 failed", ... other interesting data...);
- }
- return nil;
- }
- protected void assertLoaded() {
- PageLoadCheckFailure result = checkWhetherLoaded();
- if (result != nil) {
- Assert.fail(result.toString());
- }
- }
- protected boolean isLoadedBoolean() {
- return checkWhetherLoaded() == nil;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement