Referent: Tobias Schneck, ConSol Software GmbH
### start the docker container via x-forwarding
docker run -it -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw rasch/inkscape
### start the docker container with VNC interface
# connect via URL: http://localhost:6911/vnc_auto.html?password=vncpassword
docker run -it -p 5911:5901 -p 6911:6901 consol/centos-xfce-vnc
docker run -it -p 5912:5901 -p 6912:6901 consol/ubuntu-xfce-vnc
Kategorie |
|||
Beschränkung auf den Browser | |||
Web Tests (DOM basiert) | |||
Open Source & Java API | |||
Automatisierbarkeit & Ergebnisauswertung über DB / Nagios / CI-Tools |
|||
Unterstützung bei Testerstellung (Recorder, Screenshot-Finder) |
|
|
// tc.js
/*************************************
* Initialization of the JAVA backend
* and set warning and critical time
*************************************/
_dynamicInclude($includeFolder);
var testCase = new TestCase(60, 70);
var env = new Environment();
var appNotepad = new Application("gedit");
var region = new Region();
/******************************
* Description of the test case
******************************/
try {
//...
/************************************************
* Exception handling and shutdown of test case
**********************************************/
} catch (e) {
testCase.handleException(e);
} finally {
testCase.saveResult();
}
// tc.js
/************************
* Call Sahi Functions
***********************/
_navigateTo("http://labs.consol.de/lang/en");
_highlight(_link("Projects"));
_click(_link("Projects"));
_highlight(_link("check_mysql_health"));
_click(_link("check_mysql_health"));
_highlight(_link("check_oracle_health"));
_click(_link("check_oracle_health"));
_setValue(_textbox("s"), "nagios");
_click(_link("Home[1]"));
testCase.endOfStep("project", 20);
// tc.js
/*** calculator app ***/
var calculatorApp = new Application("galculator")
.setSleepTime(1);
.open();
testCase.endOfStep("Open Calculator", 3);
/*** calculate 525 + 100 ***/
var calculatorRegion = calculatorApp.getRegion();
calculatorRegion.type("525");
env.sleep(2);
calculatorRegion.find("plus.png")
.click()
.type("100")
.find("calculate")
.click();
testCase.endOfStep("calculate 525 +100", 20);
// tc.js
/**********
* TAB+ALT
*********/
function switchWindow() {
env.type(Key.TAB, Key.ALT);
}
/***************
* Go back to notepad
**************/
function backToNotepad() {
switchWindow();
env.type("Finish!\n\n");
}
// tc.js
/************************
* Some Variables
***********************/
var $cl_home = "http://labs.consol.de/lang/en";
var $cl_projekte = "Projects";
var $cl_c_mysql_h = "check_mysql_health";
var $cl_c_oracle_h = "check_oracle_health";
/************************
* Step for Notepad
***********************/
appNotepad.open();
env.type("Welcome to Sakuli!\n")
.type("I will help you to test your projects, like webapplications...\n")
.sleep(2);
testCase.endOfStep("notepad", 20);
/************************
* Step for labs.consol
***********************/
switchWindow();
_navigateTo($cl_home);
_highlight(_link($cl_projekte));
_click(_link($cl_projekte));
env.sleep(5).takeScreenshot("C:\\sakuli\\testscreenshot_after_5sec.png");
_highlight(_link($cl_c_mysql_h));
_click(_link($cl_c_mysql_h));
_highlight(_link($cl_c_oracle_h));
_click(_link($cl_c_oracle_h));
_setValue(_textbox("s"), "nagios");
_click(_link("Home[1]"));
testCase.endOfStep("project", 20);
/*****************
* print test client
*****************/
backToNotepad();
env.type("I can also test client applications, like gedit...\n")
.sleep(2);
testCase.endOfStep("print_test_client", 10);
# start the docker container
docker run -it -p 5911:5901 -p 6911:6901 consol/sakuli-centos-xfce
docker run -it -p 5912:5901 -p 6912:6901 consol/sakuli-ubuntu-xfce
# start in parallel via docker-compose
docker-compose -f docker-compose_example_xfce.yml up
ssh cclusr@10.4.14.131
# start single container via docker-compose on remote host
cd ~/sakuli-example-testautomation-day/docker_e2e
docker-compose rm -f sakuli-cm_check_links && docker-compose up sakuli-cm_check_links
|
https://github.com/ConSol/sakuli
https://github.com/ConSol/sakuli-example-testautomation-day |
|
https://twitter.com/sakuli_e2e | |
https://twitter.com/consol_de |
|