aboutsummaryrefslogtreecommitdiffstats
path: root/src/scenario
diff options
context:
space:
mode:
authorElliott Sprehn2010-11-01 17:24:24 -0700
committerElliott Sprehn2010-11-01 17:24:24 -0700
commitfaa7d81b679346623c9f023042ddc40dee808e6f (patch)
treee3e364fd3687752ffe2d6e41a9510717b4700756 /src/scenario
parent6bb2cd6ee2a35768ac4422395596daf1438e62ff (diff)
downloadangular.js-faa7d81b679346623c9f023042ddc40dee808e6f.tar.bz2
Add browser().reload() to simulate a refresh from a user
Diffstat (limited to 'src/scenario')
-rw-r--r--src/scenario/dsl.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/scenario/dsl.js b/src/scenario/dsl.js
index b2270cea..4ac91068 100644
--- a/src/scenario/dsl.js
+++ b/src/scenario/dsl.js
@@ -31,6 +31,7 @@ angular.scenario.dsl('pause', function() {
* Usage:
* browser().navigateTo(url) Loads the url into the frame
* browser().navigateTo(url, fn) where fn(url) is called and returns the URL to navigate to
+ * browser().reload() refresh the page (reload the same URL)
* browser().location().href() the full URL of the page
* browser().location().hash() the full hash in the url
* browser().location().path() the full path in the url
@@ -52,6 +53,16 @@ angular.scenario.dsl('browser', function() {
});
};
+ chain.reload = function() {
+ var application = this.application;
+ return this.addFutureAction('browser reload', function($window, $document, done) {
+ var href = $window.location.href;
+ application.navigateTo(href, function() {
+ done(null, href);
+ }, done);
+ });
+ };
+
chain.location = function() {
var api = {};