diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/scenario/DSL.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/scenario/DSL.js b/src/scenario/DSL.js index 3b049dc6..a64f8548 100644 --- a/src/scenario/DSL.js +++ b/src/scenario/DSL.js @@ -1,5 +1,6 @@ angular.scenario.dsl.browser = { navigateTo: function(url){ + var location = this.location; return $scenario.addFuture('Navigate to: ' + url, function(done){ var self = this; this.testFrame.load(function(){ @@ -15,8 +16,22 @@ angular.scenario.dsl.browser = { this.testFrame[0].contentWindow.location.reload(); } else { this.testFrame.attr('src', url); + location.setLocation(url); } }); + }, + location: { + href: "", + hash: "", + toEqual: function(url) { + return (this.hash == "" ? (url == this.href) : + (url == (this.href + "/#/" + this.hash))); + }, + setLocation: function(url) { + var urlParts = url.split("/#/"); + this.href = urlParts[0] || ""; + this.hash = urlParts[1] || ""; + } } }; |
