Skip to content

Commit

Permalink
[js] Add W3C endpoints for alert and executeScipt
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Mar 17, 2017
1 parent 82b69bb commit e0c0992
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascript/node/selenium-webdriver/lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ const COMMAND_MAP = new Map([
/** @const {!Map<string, (CommandSpec|CommandTransformer)>} */
const W3C_COMMAND_MAP = new Map([
[cmd.Name.GET_ACTIVE_ELEMENT, get('/session/:sessionId/element/active')],
[cmd.Name.GET_ALERT_TEXT, get('/session/:sessionId/alert/text')],
[cmd.Name.SET_ALERT_TEXT, post('/session/:sessionId/alert/text')],
[cmd.Name.ACCEPT_ALERT, post('/session/:sessionId/alert/accept')],
[cmd.Name.DISMISS_ALERT, post('/session/:sessionId/alert/dismiss')],
[cmd.Name.GET_ELEMENT_ATTRIBUTE, (cmd) => {
return toExecuteAtomCommand(cmd, Atom.GET_ATTRIBUTE, 'id', 'name');
}],
Expand All @@ -265,6 +269,8 @@ const W3C_COMMAND_MAP = new Map([
[cmd.Name.IS_ELEMENT_DISPLAYED, (cmd) => {
return toExecuteAtomCommand(cmd, Atom.IS_DISPLAYED, 'id');
}],
[cmd.Name.EXECUTE_SCRIPT, post('/session/:sessionId/execute/sync')],
[cmd.Name.EXECUTE_ASYNC_SCRIPT, post('/session/:sessionId/execute/async')],
[cmd.Name.MAXIMIZE_WINDOW, post('/session/:sessionId/window/maximize')],
[cmd.Name.GET_WINDOW_POSITION, get('/session/:sessionId/window/position')],
[cmd.Name.SET_WINDOW_POSITION, post('/session/:sessionId/window/position')],
Expand Down

0 comments on commit e0c0992

Please sign in to comment.