UI Recorder is multi-platform UI test case recorder like Selenium IDE but more powerful than Selenium IDE!
UI Recorder is easy to use, even zero cost.
itestauipi |
Stngle |
yaniswang |
xudafeng |
undead25 |
stevobm |
---|---|---|---|---|---|
micosty |
ali-lion |
alibaba-oss |
felizalde |
portokallidis |
snapre |
paradite |
WingOfTime |
zquancai |
This project follows the git-contributor spec, auto updated at Sat Apr 30 2022 21:11:26 GMT+0800
.
Install NodeJs (version >= v7.x)
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
(Mac, Linux)
Install chrome
Install UI Recorder
npm install uirecorder mocha -g
Init test project
Create new folder
uirecorder init
Start record test case
edit hosts file
uirecorder sample/test.spec.js
Start WebDriver Server
Run test case
Run all case:
source run.sh
( Linux|Mac ) orrun.bat
( Windows )Run single case:
source run.sh sample/test.spec.js
( Linux|Mac ) orrun.bat sample/test.spec.js
( Windows )
Get reports & screenshots
./reports/index.html
./reports/index.xml (JUnit)
./reports/index.json
./screenshots/
Install & start macaca server:
Install Macaca
Connect your mobile or open emulator
macaca server --port 4444
Init test project
Create new folder
uirecorder init --mobile
Start record test case
uirecorder --mobile sample/test.spec.js
Run test case
Run all case:
source run.sh
( Linux|Mac ) orrun.bat
( Windows )Run single case:
source run.sh sample/test.spec.js
( Linux|Mac ) orrun.bat sample/test.spec.js
( Windows )
Get reports & screenshots
./reports/index.html
./reports/index.xml (JUnit)
./reports/index.json
./screenshots/
F5
key to start, press F10
key to run next lineHow to run selenium standalone server?
npm run server
Selenium Grid: https://github.com/SeleniumHQ/selenium/wiki/Grid2
F2etest: https://github.com/alibaba/f2etest
export webdriver=127.0.0.1:4444
or set webdriver=127.0.0.1:4444
(Windows)Tip: port is not required, For example: export webdriver=127.0.0.1
Add commands
source ./install.sh
source ./run.sh
Add reports
JUnit:
reports/index.xml
HTML:
reports/index.html
uirecorder init
and then input the blacklist from the command lineTip: blacklist is a regex, you can use it like this: /attr_\d+/
Record commons/login.mod.js
Record sample/test.spec.js
login.mod.js
in recorder start page or jump test case in pagelogin.mod.js
loaded, then recorder other stepssource run.sh
( Linux|Mac ) or run.bat
( Windows )
<input type="file">
or click <button role="upload">Upload file</button>
, the placeholder button must mark as upload
with role
or data-role
uploadfiles/
directoryedit config.json
{
"recorder": {
...
},
"webdriver": {
...
},
"vars": {
"productId": "123456",
"productName": "mp3"
}
}
http://xxx.com/product?id={{productId}}
http://xxx.com/product?id={{productId}}
{{productName}}
or aaa{{productName}}bbb
{{productName}}
or aaa{{productName}}bbb
Tip: All var string also support js template string, For example: {{productName}}, ${new Date().getTime()}, ${parseInt(testVars.a)+parseInt(testVars.b)}
Ctrl
or Command
buttonAdd Hover
Button, enter hover modeCtrl
or Command
buttonAdd Expect
ButtonEsc
button or click End Hover
Button, exit hover modeAdd Expect
, select type jscode
sync mode: return document.title
function mode:
function(){
var str = "aaa";
return str;
}
async mode:
function(done){
setTimeout(function(){
done(123);
}, 100);
}
uirecorder init
Hide before expect
uirecorder start
Some steps is not very important, but occasionally displayed, this steps will expect to success always.
Install GraphicsMagick
brew install graphicsmagick (Mac)
sudo apt-get install graphicsmagick (Linux)
Add expect with imgdiff
select expect type: imgdiff
select target element
Rebuild the baseline image
source run.sh sample/test.spec.js --rebuilddiff
(Mac | Linux)
run.bat sample/test.spec.js --rebuilddiff
(Windows)
export devices=xxx1,xxx2
(windows: set devices=xxx1,xxx2
)source run.sh
( Linux|Mac ) or run.bat
( Windows )uirecorder start --raw
sample/test.spec.js
, sample/test.spec.json
UIRecorder is released under the MIT license.