Skip to content
Browse files

Auto-generating commands

  • Loading branch information...
1 parent 8a65a75 commit b4053863b4314407f333f9bfa64763beb17f1b1f @tj tj committed Sep 3, 2010
Showing with 135 additions and 4 deletions.
  1. +2 −2 examples/google.js
  2. +133 −2 lib/soda/client.js
View
4 examples/google.js
@@ -16,9 +16,9 @@ browser.session(function(err){
browser.open('/', function(err, res){
browser.type('q', 'Hello World', function(err, res){
browser.clickAndWait('btnG', function(err, res){
- browser.command('assertTitle', ['Hello World - Google Search'], function(err, res){
+ browser.assertTitle('Hello World - Google Search', function(err, res){
if (err) throw err;
- browser.command('testComplete', [], function(err, res){
+ browser.testComplete(function(err, res){
console.log('done');
});
});
View
135 lib/soda/client.js
@@ -140,9 +140,140 @@ exports.createClient = function(options){
*/
exports.commands = [
- 'open'
- , 'type'
+ // actions
+ 'addSelection'
+ , 'answerOnNextPrompt'
+ , 'check'
+ , 'chooseCancelOnNextConfirmation'
+ , 'click'
+ , 'clickAt'
, 'clickAndWait'
+ , 'close'
+ , 'deleteCookie'
+ , 'dragAndDrop'
+ , 'fireEvent'
+ , 'goBack'
+ , 'keyDown'
+ , 'keyPress'
+ , 'keyUp'
+ , 'mouseDown'
+ , 'mouseDownAt'
+ , 'mouseMove'
+ , 'mouseMoveAt'
+ , 'mouseOut'
+ , 'mouseOver'
+ , 'mouseUp'
+ , 'mouseUpAt'
+ , 'open'
+ , 'refresh'
+ , 'removeSelection'
+ , 'select'
+ , 'selectFrame'
+ , 'selectWindow'
+ , 'setContext'
+ , 'setCursorPosition'
+ , 'setTimeout'
+ , 'submit'
+ , 'type'
+ , 'testComplete'
+ , 'uncheck'
+ , 'waitForCondition'
+ , 'waitForPageToLoad'
+ , 'waitForPopUp'
+ , 'windowFocus'
+ , 'windowMaximize'
+ // assertions
+ , 'assertAlert'
+ , 'assertAllButtons'
+ , 'assertAllFields'
+ , 'assertAllLinks'
+ , 'assertAllWindowIds'
+ , 'assertAllWindowNames'
+ , 'assertAllWindowTitles'
+ , 'assertAttribute'
+ , 'assertAttributeFromAllWindows'
+ , 'assertBodyText'
+ , 'assertConfirmation'
+ , 'assertCookie'
+ , 'assertCursorPosition'
+ , 'assertElementHeight'
+ , 'assertElementIndex'
+ , 'assertElementPositionLeft'
+ , 'assertElementPositionTop'
+ , 'assertElementWidth'
+ , 'assertEval'
+ , 'assertExpression'
+ , 'assertHtmlSource'
+ , 'assertLocation'
+ , 'assertLogMessages'
+ , 'assertPrompt'
+ , 'assertSelectedId'
+ , 'assertSelectedIds'
+ , 'assertSelectedIndex'
+ , 'assertSelectedIndexes'
+ , 'assertSelectedLabels'
+ , 'assertSelectedValue'
+ , 'assertSelectedOptions'
+ , 'assertTable'
+ , 'assertText'
+ , 'assertTitle'
+ , 'assertWhetherThisFrameMatchFrameExpression'
+ , 'assertAlertPresent'
+ , 'assertChecked'
+ , 'assertConfirmationPresent'
+ , 'assertEditable'
+ , 'assertElementPresent'
+ , 'assertOrdered'
+ , 'assertPromptPresent'
+ , 'assertSomethingSelected'
+ , 'assertTextPresent'
+ , 'assertVisible'
+ // verifications
+ , 'verifyAlert'
+ , 'verifyAllButtons'
+ , 'verifyAllFields'
+ , 'verifyAllLinks'
+ , 'verifyAllWindowIds'
+ , 'verifyAllWindowNames'
+ , 'verifyAllWindowTitles'
+ , 'verifyAttribute'
+ , 'verifyAttributeFromAllWindows'
+ , 'verifyBodyText'
+ , 'verifyConfirmation'
+ , 'verifyCookie'
+ , 'verifyCursorPosition'
+ , 'verifyElementHeight'
+ , 'verifyElementIndex'
+ , 'verifyElementPositionLeft'
+ , 'verifyElementPositionTop'
+ , 'verifyElementWidth'
+ , 'verifyEval'
+ , 'verifyExpression'
+ , 'verifyHtmlSource'
+ , 'verifyLocation'
+ , 'verifyLogMessages'
+ , 'verifyPrompt'
+ , 'verifySelectedId'
+ , 'verifySelectedIds'
+ , 'verifySelectedIndex'
+ , 'verifySelectedIndexes'
+ , 'verifySelectedLabels'
+ , 'verifySelectedValue'
+ , 'verifySelectedOptions'
+ , 'verifyTable'
+ , 'verifyText'
+ , 'verifyTitle'
+ , 'verifyWhetherThisFrameMatchFrameExpression'
+ , 'verifyAlertPresent'
+ , 'verifyChecked'
+ , 'verifyConfirmationPresent'
+ , 'verifyEditable'
+ , 'verifyElementPresent'
+ , 'verifyOrdered'
+ , 'verifyPromptPresent'
+ , 'verifySomethingSelected'
+ , 'verifyTextPresent'
+ , 'verifyVisible'
];
/**

0 comments on commit b405386

Please sign in to comment.
Something went wrong with that request. Please try again.