Test your websites with this simple GUI based scripted webtester. Generate simple testscripts directly from surfng on the webpage, enhance them with your commands, with variables, loops, checks, … and finally run automated web tests.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
2.0 KiB
66 lines
2.0 KiB
9 years ago
|
## @file This is a test script to test and to show the features of the webtester framework.
|
||
|
|
||
|
testsuite Test WebTester Commands
|
||
|
|
||
|
testcase Test Certificate Load
|
||
|
# Load a SwissSign root certificate, so that it is accepted in the
|
||
|
# following tests. Normally this is only necessary if you use
|
||
|
# self-signed certificates, that are unknown by qt.
|
||
|
ca-certificate SwissSign_Silver_CA_-_G2.pem
|
||
|
|
||
|
testcase Test Variable Definition
|
||
|
# set a variable to a value
|
||
|
set ARG4 = Argument number 4
|
||
|
# set a variable to the output of a system command
|
||
|
set WORKDIR
|
||
|
execute pwd
|
||
|
|
||
|
testcase Test Function Call
|
||
|
# call a test function with three comma separated arguments
|
||
|
# - either with single quotes, allmust be quoted
|
||
|
call test '1', 'hello world', 'here is a comma, so it must be quoted', 'ARG4'
|
||
|
# - or with double quotes, but the two types cannot be mixed
|
||
|
call test "2", "hello world", "here's a comma, so it must be quoted", "ARG4"
|
||
|
# - or with no quotes
|
||
|
call test 3, hello world, here's no comma and no quotes, ARG4
|
||
|
|
||
|
testcase Test Function Definition
|
||
|
## Just a test function
|
||
|
## @param ARG1 an argument
|
||
|
## @param ARG2 another argument
|
||
|
## @param ARG3 another argument
|
||
|
## @param ARG4 another argument
|
||
|
function test ARG1, ARG2, ARG3, ARG4
|
||
|
if ARG1 = 1
|
||
|
# this is the first function call (or at leas declared to be the first)
|
||
|
echo This is the first call of function "test"
|
||
|
echo called funtion test ARG1, ARG2, ARG3, ARG4
|
||
|
|
||
|
testcase Test Checks
|
||
|
# check comparisions of values
|
||
|
# fist set some variables to test
|
||
|
set TEXT = Hello world, this is a test.
|
||
|
set TWO = 2
|
||
|
# then so some checks
|
||
|
check TWO = 2
|
||
|
check 2 = TWO
|
||
|
check TWO = TWO
|
||
|
check TEXT = Hello world, this is a test.
|
||
|
check TEXT ^ hello world
|
||
|
check TEXT ~ [hH]ello.*test
|
||
|
check TEXT ~ world
|
||
|
check 1 < TWO
|
||
|
check TWO < 3
|
||
|
check 3 > TWO
|
||
|
|
||
|
testcase Test Setting Clicktype
|
||
|
# there are two clicktypes:
|
||
|
# - normal javascript this.click(); call
|
||
|
# - Qt emulated real mouse click
|
||
|
clicktype realmouse
|
||
|
clicktype javascript
|
||
|
|
||
|
testcase Test Load Client Certificate
|
||
|
# define a client certificate to authenticate to a server
|
||
|
#client-certificate certfile.pem keyfile.pem mypassword
|