diff options
Diffstat (limited to 'node_modules/selenium-webdriver/lib/actions.js')
-rw-r--r-- | node_modules/selenium-webdriver/lib/actions.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/node_modules/selenium-webdriver/lib/actions.js b/node_modules/selenium-webdriver/lib/actions.js index 7200b08d6..1b059bbbf 100644 --- a/node_modules/selenium-webdriver/lib/actions.js +++ b/node_modules/selenium-webdriver/lib/actions.js @@ -65,9 +65,12 @@ function checkModifierKey(key) { * Class for defining sequences of complex user interactions. Each sequence * will not be executed until {@link #perform} is called. * - * Example: + * This class should not be instantiated directly. Instead, obtain an instance + * using {@link ./webdriver.WebDriver#actions() WebDriver.actions()}. * - * new ActionSequence(driver). + * Sample usage: + * + * driver.actions(). * keyDown(Key.SHIFT). * click(element1). * click(element2). @@ -107,7 +110,7 @@ class ActionSequence { /** * Executes this action sequence. * - * @return {!./promise.Promise} A promise that will be resolved once + * @return {!./promise.Thenable} A promise that will be resolved once * this sequence has completed. */ perform() { @@ -117,9 +120,10 @@ class ActionSequence { let actions = this.actions_.concat(); let driver = this.driver_; return driver.controlFlow().execute(function() { - actions.forEach(function(action) { - driver.schedule(action.command, action.description); + let results = actions.map(action => { + return driver.schedule(action.command, action.description); }); + return Promise.all(results); }, 'ActionSequence.perform'); } @@ -377,9 +381,12 @@ class ActionSequence { * Class for defining sequences of user touch interactions. Each sequence * will not be executed until {@link #perform} is called. * - * Example: + * This class should not be instantiated directly. Instead, obtain an instance + * using {@link ./webdriver.WebDriver#touchActions() WebDriver.touchActions()}. + * + * Sample usage: * - * new TouchSequence(driver). + * driver.touchActions(). * tapAndHold({x: 0, y: 0}). * move({x: 3, y: 4}). * release({x: 10, y: 10}). @@ -415,7 +422,7 @@ class TouchSequence { /** * Executes this action sequence. - * @return {!./promise.Promise} A promise that will be resolved once + * @return {!./promise.Thenable} A promise that will be resolved once * this sequence has completed. */ perform() { @@ -425,9 +432,10 @@ class TouchSequence { let actions = this.actions_.concat(); let driver = this.driver_; return driver.controlFlow().execute(function() { - actions.forEach(function(action) { - driver.schedule(action.command, action.description); + let results = actions.map(action => { + return driver.schedule(action.command, action.description); }); + return Promise.all(results); }, 'TouchSequence.perform'); } |