Skip to content

Global functions and User Extensions rollup. #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 120 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
f588037
broke up the try test into individual cases
matthewkastor Dec 18, 2014
479e344
fixed typo in file name, deleted original try test
matthewkastor Dec 18, 2014
70aa4af
adds conditionally executed code for RC server
matthewkastor Dec 19, 2014
317ae25
sets whether on server or not by config.js
matthewkastor Dec 19, 2014
3824aa9
adds script for running tests on server
matthewkastor Dec 20, 2014
4caa6c4
fixes recursion issue
matthewkastor Dec 20, 2014
4eb0a1c
renamed test
matthewkastor Dec 20, 2014
c24a37c
conditional execution "editor" missing on server
matthewkastor Dec 20, 2014
c4bb767
Merge remote-tracking branch 'origin/master' into user-extensions-aug…
matthewkastor Dec 20, 2014
7b632d1
resolves conflicts
matthewkastor Dec 20, 2014
8c14aae
rebuilt with latest upstream master
matthewkastor Dec 20, 2014
ff3538d
changing guard
matthewkastor Dec 20, 2014
6cd1777
moved server augmentation code to config.js
matthewkastor Dec 21, 2014
9abb9c9
updated to run tests and open debug on fail
matthewkastor Dec 23, 2014
aa29c36
adds options to debug alternate test suites
matthewkastor Dec 23, 2014
a40fbcc
adds options to start autotest on other browsers
matthewkastor Dec 23, 2014
7cc23fb
adds parameter handler, help text, & awesome
matthewkastor Dec 24, 2014
13c22e7
added note about testing in all browsers at once
matthewkastor Dec 24, 2014
8c34856
refactoring for reuse in selbench
matthewkastor Dec 24, 2014
4e51723
minor tweaks
matthewkastor Dec 24, 2014
c9c581c
breaking down the if tests
matthewkastor Dec 25, 2014
30e556f
removing strict mode
matthewkastor Dec 27, 2014
e7f6f43
throwing errors in isManaged returns false
matthewkastor Dec 27, 2014
c144f36
removing patch to setNextCommand
matthewkastor Dec 27, 2014
1ae3354
rebuilds user extension with latest selbench
matthewkastor Dec 27, 2014
c90d591
updates readme test to fetch an accessible page
matthewkastor Dec 27, 2014
0bbac86
fix typo in error handler for server "try"
matthewkastor Dec 27, 2014
68f3502
server "try" error handler fix
matthewkastor Dec 27, 2014
389ae42
set firefox's proxy to localhost:4444
matthewkastor Dec 27, 2014
decefc3
Moved server root for debug tests
matthewkastor Dec 28, 2014
35e8f07
Updates server patch, now passing all but 2 tests
matthewkastor Dec 28, 2014
6da714d
added paths for testing file ops on the server
matthewkastor Dec 28, 2014
74afc44
merging "break up try test"
matthewkastor Dec 30, 2014
0441a20
breaks up the continue break test
matthewkastor Dec 30, 2014
3ef815b
moves storing path to test case that needs it
matthewkastor Dec 30, 2014
452f3f1
executes all command rows now
matthewkastor Dec 30, 2014
04efc59
Passing all tests
matthewkastor Dec 30, 2014
6968af4
Breaking up the exit tests
matthewkastor Dec 30, 2014
2d10fd1
exitTest now throws on failure
matthewkastor Dec 30, 2014
e645990
Adds a simple Selenese runner example
matthewkastor Dec 30, 2014
1af4a75
Updates the readme: about user-extensions.js
matthewkastor Dec 30, 2014
0b7d4e7
Adds readme about running the server tests
matthewkastor Dec 30, 2014
7884294
updates testing readme
matthewkastor Dec 30, 2014
c445781
updates test for error message in chrome & ie
matthewkastor Dec 30, 2014
8aed50b
updates uneval to JSON.stringify for all browsers
matthewkastor Dec 30, 2014
60ac6a8
doesn't delete results when running "all" browsers
matthewkastor Dec 30, 2014
4342ec3
checking in test results from all browsers
matthewkastor Dec 30, 2014
d9b5dad
checking in test results from all browsers
matthewkastor Dec 30, 2014
bed9bc4
Refactors "evlauateXpath" to work everywhere
matthewkastor Dec 31, 2014
4584ccd
All tests pass in all server environments and IDE.
matthewkastor Dec 31, 2014
9b8942d
updates docs on running tests
matthewkastor Dec 31, 2014
057179e
adds reg files to enable and disable proxy for IE
matthewkastor Dec 31, 2014
4779fa1
Error: infinite loop calling func from another case
matthewkastor Dec 31, 2014
5c0815a
removes unnecessary base url from test cases
matthewkastor Dec 31, 2014
1b2acc6
draft to add global functions
matthewkastor Jan 1, 2015
ac76002
draft 2
matthewkastor Jan 1, 2015
29e73e8
adding tests
matthewkastor Jan 1, 2015
e5a8f4e
revert selblocks.js to master
matthewkastor Jan 1, 2015
9358b32
issue fixed: functions aren't global
matthewkastor Jan 1, 2015
4ec8d62
Caching funcs from previous testCases
matthewkastor Jan 2, 2015
a7efd2f
Beginning specs for calling caseName.fn
matthewkastor Jan 2, 2015
071298b
updates test to use namespaced funcs
matthewkastor Jan 2, 2015
789c42b
reintroduces cross case bug
matthewkastor Jan 2, 2015
38c4046
adding active case property to cache
matthewkastor Jan 2, 2015
89a7571
offsetting command indexes
matthewkastor Jan 2, 2015
69d9d1c
It works!
matthewkastor Jan 2, 2015
9ac2036
removing unused function
matthewkastor Jan 2, 2015
a557cf0
Draft 1: define fn params
matthewkastor Jan 2, 2015
2226f6e
moved saving vars into doFunction
matthewkastor Jan 2, 2015
1939111
removed comment about fixed bug
matthewkastor Jan 2, 2015
5efbc6b
adds test for funcs with default values
matthewkastor Jan 2, 2015
a4f57d3
tests that default values respected
matthewkastor Jan 2, 2015
a17b481
overriding current command
matthewkastor Jan 3, 2015
64ba36e
changed test for leaking values
matthewkastor Jan 3, 2015
9df5a97
update doScript, since it's an alias to doFunction
matthewkastor Jan 3, 2015
51fd037
merging in branch "break up try test"
matthewkastor Jan 3, 2015
1fdc86c
parameters must be named to be scoped
matthewkastor Jan 3, 2015
e47b197
currentCommand should not be overridden
matthewkastor Jan 3, 2015
3b15b17
tests that "store" is not block scoped
matthewkastor Jan 3, 2015
49bf74a
Create basic test for SetLocal
matthewkastor Jan 3, 2015
baf71da
Adds local storage fns and ContextManager
matthewkastor Jan 3, 2015
6c5ed81
Updates tests
matthewkastor Jan 3, 2015
d432241
storeLocal and storeGlobal work, funcs have blocks
matthewkastor Jan 3, 2015
0062cc9
can't override doStore
matthewkastor Jan 4, 2015
e267e43
fuck it
matthewkastor Jan 4, 2015
29d1e89
Breaking change: store is block scoped
matthewkastor Jan 4, 2015
574d414
adds test for function can return value
matthewkastor Jan 4, 2015
ba85c77
pops callstack again, fn context trigger change
matthewkastor Jan 4, 2015
fbab35b
Refactor function test for local vars
matthewkastor Jan 4, 2015
3c8175d
adding block scope to loops
matthewkastor Jan 4, 2015
2c47b8e
improves return, storeEval in scope
matthewkastor Jan 4, 2015
1e7bcc1
update test for block scope
matthewkastor Jan 4, 2015
38f795b
update test for block scope
matthewkastor Jan 4, 2015
22673d0
bubbles any _result through contexts
matthewkastor Jan 4, 2015
a6dcf55
updated test
matthewkastor Jan 4, 2015
d0c2316
Adds tests for while scoping
matthewkastor Jan 4, 2015
a9ab71f
updates getEval on a few tests
matthewkastor Jan 5, 2015
b207dac
adds storeAt command and tests
matthewkastor Jan 5, 2015
890ea82
updates user extension to latest
matthewkastor Jan 5, 2015
d0a8390
merging global functions and user extensions
matthewkastor Jan 5, 2015
c025675
added global functions tests to main suite
matthewkastor Jan 5, 2015
f12aba4
allowing 3 minutes for default autotesting
matthewkastor Jan 5, 2015
ec9c009
cleaning up new tests
matthewkastor Jan 5, 2015
bd70032
get title, set highlighted row on server
matthewkastor Jan 5, 2015
61a5c48
Passes testing in all but IE
matthewkastor Jan 5, 2015
d1f4ecc
Fixes doCall bug in IE
matthewkastor Jan 5, 2015
7ee9e04
Refactoring tests to test just selblocks
matthewkastor Jan 5, 2015
b47f723
updates test suite
matthewkastor Jan 5, 2015
1716bb5
Passes testing everywhere.
matthewkastor Jan 5, 2015
b408f6d
Updates docs on testing the user-extensions.js
matthewkastor Jan 7, 2015
b58b0d4
Updates root readme.
matthewkastor Jan 7, 2015
47e8f2d
root readme, aesthetics
matthewkastor Jan 7, 2015
f58ff76
root readme, typos, notes
matthewkastor Jan 7, 2015
a47832e
adds notes about installing dev, or published
matthewkastor Jan 7, 2015
6e6bc8c
adds selblocks logo to readme
matthewkastor Jan 7, 2015
585358f
fixes typo
matthewkastor Jan 7, 2015
539f0a4
adds test for special keys vars
matthewkastor Jan 8, 2015
8a36d9b
fixes bug clearing special keys
matthewkastor Jan 8, 2015
5ad5a3f
server test results
matthewkastor Jan 8, 2015
0e889f6
nested global funcs bug
matthewkastor Jan 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,715 changes: 6,715 additions & 0 deletions IDE test results.html

Large diffs are not rendered by default.

58 changes: 45 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,60 @@
SelBlocks 2
=========
# SelBlocks 2
![SelBlocks Logo](https://raw.githubusercontent.com/refactoror/SelBlocks/master/sel-blocks-fx_xpi/chrome/skin/selblocksLogo.png)

SelBlocks is a language extension for Selenium IDE
SelBlocks is a language extension for Selenese that works on both the Selenium IDE and Selenium standalone server. It allows intelligent, data driven, tests to be recorded and composed in Selenium IDE, then run on any browser supported by Selenium server. With SelBlocks there is no need to translate the tests into another language at all! Experience web application testing and automation that's so easy a child could do it. Seriously, we've taught kids how to use this.

It provides Selenium commands for javascript-like conditionals, looping, callable functions, error catching, and JSON/XML driven parameterization.
> My eight year old nephew's eyes got huge when he said *"You mean I can click __all__ the buttons?"* and I told him yes. Then showed him how to do it.
> -- Kastor

Features
## Features

* Variables can be configured via external XML and/or JSON files.
* Functions are namespaced. They can be defined in test libraries, then called from any test case in the suite with `testCaseTitle.functionName`.
* Command parameters are javascript expressions that are evaluated with Selenium variables in scope, which can therefore be referenced by their simple names, e.g.: <tt>i+1</tt>
* A function definition can appear anywhere, (they are skipped over in normal execution flow).
* Functions can be called recursively.
* Function and loop parameters use regular Selenium variables that are local to the block, overriding variables of the same name, and that are restored when the block exits.
* Adds the following control structures to Selenese:
* <code>if</code>, <code>elseIf</code>, <code>else</code>
* <code>try</code>, <code>catch</code>, <code>finally</code>, <code>throw</code>
* <code>for</code>, <code>foreach</code>, <code>while</code>, <code>continue</code>, <code>break</code>
* <code>call</code>, <code>function</code>, <code>return</code>
* <code>loadJsonVars</code>, <code>loadXmlVars</code>, <code>forJson</code>, <code>forXml</code>
* <code>goto</code>, <code>gotoIf</code>, <code>label</code>, <code>skipNext</code>
* <code>forJson</code>, <code>forXml</code>
* <code>exitTest</code>
* Function and loop parameters use regular Selenium variables that are local to the block, overriding variables of the same name, and that are restored when the block exits.
* Command parameters are javascript expressions that are evaluated with Selenium variables in scope, which can therefore be referenced by their simple names, e.g.: <tt>i+1</tt>
* Variables can be configured via external XML and/or JSON files.
* A function definition can appear anywhere, (they are skipped over in normal execution flow).
* Functions can be called recursively.
* Adds the following variable declarators to Selenese:
* *Scoped `store` command*
* <code>storeLocal</code> : stores variables in the current block scope, the builtin `store` command now creates local variables as well.
* <code>storeGlobal</code> : stores variables in global scope
* <code>storeAt</code> : stores variable values in the parent scope where they were defined, or creates a global variable if no parent scope defined it.
* <code>loadJsonVars</code> : creates variables in the current block scope, as defined by the given JSON file or URL.
* <code>loadXmlVars</code> : creates variables in the current block scope, as defined by the given XML file or URL.
* *Scoped storeEval* : built in Selenese command, storeEval stores the result of evaluating the given javascript.
* SelBlocks adds : <code>storeEvalLocal</code>, <code>storeEvalGlobal</code>, and <code>storeEvalAt</code>
* *Scoped storeText* : stores the text of the located element.
* SelBlocks adds : <code>storeLocalText</code>, <code>storeGlobalText</code>, and <code>storeAtText</code>
* *Scoped storeAttribute* : stores the value of the located attribute.
* SelBlocks adds : <code>storeLocalAttribute</code>, <code>storeGlobalAttribute</code>, and <code>storeAtAttribute</code>

## Installation

The [Firefox installer](https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-sel-blocks/) is the latest published release. It is available from the firefox addons site, or just search for it in your addons menu.

To install the latest development version, clone this repository and put a file in your firefox extensions directory called `[email protected]`. In that file just paste the full path to the `sel-blocks-fx_xpi` directory. Now, you'll be able to get the cutting edge latest stuff by pulling it in whenever you want. As an added bonus, when you switch branches the extension will load with that branch's code.

The Selenium server extension file is at "/user extension/user-extensions.js". Grab a copy and follow the directions in the SeleniumHTMLRunner.cmd file.

## Documentation

Find the docs at http://refactoror.wikia.com/wiki/Selblocks_Reference

## Author

* [Chris Noe](https://github.com/refactoror)

[Firefox Installer](https://addons.mozilla.org/en-US/firefox/addon/selenium-ide-sel-blocks/) / [Documentation](http://refactoror.wikia.com/wiki/Selblocks_Reference)
## Contributors

Contributors
* [Matthew Kastor](https://github.com/matthewkastor)

If you would like to contribute code to SelBlocks, you can do so by forking this project, and then submitting a pull request. Contributed code must be able to pass the full test suite, and should include additional tests to prove the correctness of the new or modified code.

Expand Down
10 changes: 10 additions & 0 deletions build/createSelblocksUserExtensions.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
SETLOCAL
SET extensionsDir=%~dp0..\sel-blocks-fx_xpi\chrome\content\extensions
SET userExtensionDir=%~dp0..\user extension

SET copylist="%userExtensionDir%\scripts\config.js"+"%extensionsDir%\name-space.js"+"%extensionsDir%\logger.js"+"%extensionsDir%\function-intercepting.js"+"%extensionsDir%\xpath-processing.js"+"%extensionsDir%\expression-parser.js"+"%extensionsDir%\selenium-executionloop-handleAsExitTest.js"+"%extensionsDir%\selenium-executionloop-handleAsTryBlock.js"+"%extensionsDir%\selblocks.js"

copy %copylist% /B "%userExtensionDir%\user-extensions.js" /B
ENDLOCAL
EXIT /B %ERRORLEVEL%
5 changes: 5 additions & 0 deletions sel-blocks-fx_xpi/chrome/content/extensions/name-space.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// SelBlocks name-space
var selblocks = { name: "SelBlocks" };

// I don't want to redeclare the variable when the user-extension is generated
// I don't want the scripts to blow up when the firefox extension is used.
// This is an alias on the global scope that references the global scope.
globalContext = this;

(function($$){

/* Starting with FF4 lots of objects are in an XPCNativeWrapper,
Expand Down
Loading