Skip to content

Commit

Permalink
Commented patch. There are some items that merit discussion before me…
Browse files Browse the repository at this point in the history
…rging.

Updated Selenium API from 0.8.0 to 1.0.1. Fixed typo on storeSelectOptions.
Not sure the selenium action 'store' can be supported.
  • Loading branch information
dshaw committed Oct 12, 2010
1 parent d915946 commit 24e9662
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -196,7 +196,7 @@ Keep in mind you can extend the prototype as needed for your test. An example of

- Sauce Labs [Supported Browsers](http://saucelabs.com/products/docs/sauce-ondemand/browsers)
- Introduction to [Selenese](http://seleniumhq.org/docs/02_selenium_basics.html)
- Selenium [Command Reference](http://release.seleniumhq.org/selenium-core/0.8.0/reference.html).
- Selenium [Command Reference](http://release.seleniumhq.org/selenium-core/1.0.1/reference.html).


## License
Expand Down
77 changes: 67 additions & 10 deletions lib/soda/client.js
Expand Up @@ -251,51 +251,97 @@ exports.createClient = function(options){
*/

exports.commands = [
'addSelection'
, 'assertElementNotPresent'
// rc
'getNewBrowserSession'
, 'setContext'
, 'testComplete'
// selenium actions
, 'addLocationStrategy'
, 'addScript'
, 'addSelection'
, 'allowNativeXpath'
, 'altKeyDown'
, 'altKeyUp'
//, 'assertElementNotPresent' - should be an accessor

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

not sure what you mean. I use this often, whats wrong with it as a method?

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

Moved to accessors to be built out to assertElementNotPresent, verifyElementNotPresent and waitForElementNotPresent.

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

oh sorry I thought you meant accessors as in getters/setters

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

NP

, 'answerOnNextPrompt'
, 'assignId'
, 'break'
, 'captureEntirePageScreenshot'
, 'check'
, 'chooseCancelOnNextConfirmation'
, 'chooseOkOnNextConfirmation'
, 'click'
, 'clickAt'
, 'clickAndWait'
, 'clickAt'
, 'clickAtAndWait'
, 'close'
, 'contextMenu'
, 'contextMenuAt'
, 'controlKeyDown'
, 'controlKeyUp'
, 'createCookie'
, 'deleteAllVisibleCookies'
, 'deleteCookie'
, 'deselectPopUp'
, 'doubleClick'
, 'doubleClickAt'
, 'dragAndDrop'
, 'dragAndDropToObject'
, 'echo'
, 'fireEvent'
, 'focus'
, 'goBack'
, 'getNewBrowserSession'
, 'highlight'
, 'ignoreAttributesWithoutValue'
, 'keyDown'
, 'keyPress'
, 'keyUp'
, 'metaKeyDown'
, 'metaKeyUp'
, 'mouseDown'
, 'mouseDownAt'
, 'mouseDownRight'
, 'mouseDownRightAt'
, 'mouseMove'
, 'mouseMoveAt'
, 'mouseOut'
, 'mouseOver'
, 'mouseUp'
, 'mouseUpAt'
, 'mouseUpRight'
, 'mouseUpRightAt'
, 'open'
, 'openWindow'
, 'pause'

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

.pause() throws "unknown command" on both Sauce OnDemand and Sauce RC.

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

hmmm, probably best to leave it out for now

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

Strangely, it is in Sauce IDE, but we don't use that environment from Soda. Screenshot

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

hmm strange lol id leave it out if it does not work with RC / Sauce IMO, I test locally tons with RC so it would be a bit annoying if some things were only supported by Sauce

, 'refresh'
, 'removeAllSelections'
, 'removeScript'
, 'removeSelection'
, 'rollup'
, 'runScript'
, 'select'
, 'selectFrame'
, 'selectPopUp'
, 'selectWindow'
, 'setContext'
, 'setBrowserLogLevel'
, 'setCursorPosition'
, 'setMouseSpeed'
, 'setSpeed'
, 'setTimeout'
, 'shiftKeyDown'
, 'shiftKeyUp'
, 'store' // NOTE: not sure this can be supported in Soda. Variables accessed with ${var}.

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

Going to back out store for now. See notes below.

, 'submit'
, 'type'
, 'testComplete'
, 'typeKeys'
, 'uncheck'
, 'useXpathLibrary'
, 'waitForCondition'
, 'waitForFrameToLoad'
, 'waitForPageToLoad'
, 'waitForPopUp'
, 'windowFocus'
, 'windowMaximize'
, 'setSpeed'
];

/**
Expand All @@ -305,7 +351,9 @@ exports.commands = [
*/

exports.accessors = [
'Alert'
'ErrorOnNext'
, 'FailureOnNext'
, 'Alert'
, 'AllButtons'
, 'AllFields'
, 'AllLinks'
Expand All @@ -317,6 +365,7 @@ exports.accessors = [
, 'BodyText'
, 'Confirmation'
, 'Cookie'
, 'CookieByName'
, 'CursorPosition'
, 'ElementHeight'
, 'ElementIndex'
Expand All @@ -327,7 +376,8 @@ exports.accessors = [
, 'Expression'
, 'HtmlSource'
, 'Location'
, 'LogMessages'
, 'LogMessages' // Not in 1.0.1 docs
, 'MouseSpeed'
, 'Prompt'
, 'SelectedId'
, 'SelectedIds'
Expand All @@ -337,17 +387,22 @@ exports.accessors = [
, 'SelectedLabels'
, 'SelectedValue'
, 'SelectedValues'
, 'SelectedOptions'
, 'SelectOptions' // typo s/Selected/Select/
, 'Speed'
, 'Table'
, 'Text'
, 'Title'
, 'Value'
, 'WhetherThisFrameMatchFrameExpression'
, 'WhetherThisWindowMatchWindowExpression'
, 'XpathCount'
, 'AlertPresent'
, 'Checked'
, 'ConfirmationPresent'
, 'CookiePresent'
, 'Editable'
, 'ElementPresent'
, 'ElementNotPresent' // Selenium breaks naming convention FTL.

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

Broken naming convention. This will produce assertElementNotPresent method removed from the list of commands above, as well as verifyElementNotPresent and waitForElementNotPresent... and some junk: assertNotElementNotPresent, verifyNotElementNotPresent.

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

it is still a valid command though no? although oddly named

, 'Ordered'
, 'PromptPresent'
, 'SomethingSelected'
Expand All @@ -363,6 +418,7 @@ exports.accessors = [
* - get
* - assert
* - assertNot
* - store
* - verify
* - verifyNot
* - waitFor
Expand All @@ -382,6 +438,7 @@ exports.accessors.map(function(cmd){
'get' + cmd
, 'assert' + cmd
, 'assertNot' + cmd
, 'store' + cmd

This comment has been minimized.

Copy link
@dshaw

dshaw Oct 12, 2010

Author Owner

I haven't had time to explore how we might reference the Selenium stored variables. Plus, get + cmd works great with assert and I find it really productive. So, I'm inclined not to include store until we know it works.

This comment has been minimized.

Copy link
@tj

tj Oct 12, 2010

I havent touched store either, any command can take a callback even when chained so for things similar to that I had just been building up expressions in js-land and going that route

, 'verify' + cmd
, 'verifyNot' + cmd
, 'waitFor' + cmd
Expand Down

1 comment on commit 24e9662

@tj
Copy link

@tj tj commented on 24e9662 Oct 12, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool thanks man looks good. I was obviously looking at older docs that came up in google. Some of the commands are really annoying since they dont follow the conventions, kinda silly but oh well. Let me know when you want me to merge this :)

Please sign in to comment.