examples is test
This commit is contained in:
25
test/ca.pem
Normal file
25
test/ca.pem
Normal file
@@ -0,0 +1,25 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIEMTCCAxmgAwIBAgIJAPE0R7DheN2SMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
VQQGEwJDSDESMBAGA1UECAwJWsODwrxyaWNoMRMwEQYDVQQHDApXaW50ZXJ0aHVy
|
||||
MSgwJgYDVQQKDB9odHRwczovL2Rldi5tYXJjLndhZWNrZXJsaW4ub3JnMSgwJgYD
|
||||
VQQDDB9odHRwczovL2Rldi5tYXJjLndhZWNrZXJsaW4ub3JnMSIwIAYJKoZIhvcN
|
||||
AQkBFhNtYXJjQHdhZWNrZXJsaW4ub3JnMB4XDTE1MTAxMDE0MTMyM1oXDTE1MTEw
|
||||
OTE0MTMyM1owga4xCzAJBgNVBAYTAkNIMRIwEAYDVQQIDAlaw4PCvHJpY2gxEzAR
|
||||
BgNVBAcMCldpbnRlcnRodXIxKDAmBgNVBAoMH2h0dHBzOi8vZGV2Lm1hcmMud2Fl
|
||||
Y2tlcmxpbi5vcmcxKDAmBgNVBAMMH2h0dHBzOi8vZGV2Lm1hcmMud2FlY2tlcmxp
|
||||
bi5vcmcxIjAgBgkqhkiG9w0BCQEWE21hcmNAd2FlY2tlcmxpbi5vcmcwggEiMA0G
|
||||
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI7jMSFLEkPOo6Y6X9tNAmgmoAUvYk
|
||||
9eFb6Ujvk9hcZFriLNPsHXBiMNP78OxDUSAbip5CxEWa3F6i+GbBV+oiPrdIv1GG
|
||||
W0jfKTQHMlEPdSc4mREickN/LMiZ/RA9/Z1ZSNxfNkV3tNr7nFbvRZx9wj1EMwOD
|
||||
ynsuT06QZ/1H9LLU00EbeoE7VS/Ef/kE0YvQcZFbMu7hdMunQQ6Q3mXu1+hs5M9j
|
||||
4ZnYUpvevpQGdCA1ekBXAxX0ekY1nTQ2iwzX/xWJK86JdMZOUj+BtidOrz+SVgCB
|
||||
faPVDRERpj7HKJeQfkHz/KAdjsFY2Zc54sbIGKKG5MZ6dUDoeXhxi2EfAgMBAAGj
|
||||
UDBOMB0GA1UdDgQWBBT5zUd7OzoG3GHY8EyZ3AbYU9pHxTAfBgNVHSMEGDAWgBT5
|
||||
zUd7OzoG3GHY8EyZ3AbYU9pHxTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUA
|
||||
A4IBAQCFTKmX9bSALBUogsuMtda+tjYzbc0re9kisTTziUBVzs/N38GFzC8NIq35
|
||||
hD81we/CvqpF9SVV0vGraW+83T618gW8bGbLQaCkyd4tqglSJechKKVSCAEJ5NlV
|
||||
LW+ci/+Ge2MYISipJej3JwXq4Dy2YSUNKTi+NGuuZ1XOuTSBbiKBV1cdIrXvT8CV
|
||||
YgcKG1yDEbHvoqOIorH3DYtINrHF7HdsL6QdWBwlTHIJQScyLpmKBWuwTnSwLGPQ
|
||||
o1Klb+ZghSQx2bmAtjNLowGyEjeYNDusr800wESWIaV5DruNU2uNISbP9O7jhQVJ
|
||||
Mc5hQ+EcggMkg86dY6EFzp4ydpHq
|
||||
-----END CERTIFICATE-----
|
18
test/client.key
Normal file
18
test/client.key
Normal file
@@ -0,0 +1,18 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Proc-Type: 4,ENCRYPTED
|
||||
DEK-Info: DES-EDE3-CBC,C98071015089F702
|
||||
|
||||
XwT94ie6eL0eUr/1HqIcEOYnhn79TCSKMBTnQgjW4Am6jVZ9AUJw3EJbeC3hiA86
|
||||
+T14C4FIhhNxC6yzmDHjVMWAb1bKJqYHKwktE5e0dPV4u3WRSma/w15TtXriP+Nt
|
||||
YEQnMkjRrS1BmI0uLoGLtNgnTq/IdICPIKcYCUFPu1F0kbx6+ZRJfkLwYN+b3Xe7
|
||||
iRpXo/mk3P+FDVdY80K+MsERcewWlD6FB0APLSKDtc/BHht8no63Cozn/ogwkJmI
|
||||
rFlA1svhQ2Evtu5IYSHxBbVjzBfAnwJjqGuE97YRE/ATbbu699WCjoT2Py4JD/08
|
||||
PJPIcLo+usdfPvz9mpLxnnI4FOq3KcJlPUzg+VfQZ6foPRlr3nnTLgGLda4UQDTf
|
||||
ElKIBczLvw9HMT/iEng5dfeLuxENZ4XmMCTjkqXq8kexc9el8oqtObTNs0bbhyAs
|
||||
35f91CYzSTOsCT0CWMbkk6tAwtbWJPmaEGFtaixiyYCdDVR8W01wyYdmyMLoTLFG
|
||||
NHmZGiTJcvgZkf2XA/qX1SDonCoWqJ457PsZtdLgti5fFnqEqfkjt1eltceODl3p
|
||||
JvfPJvt/ZAVJPxqcp2uHqZ3TGmiKirWvd4iwKMjMSvAQVMimJ2/Y30PR+QhzuJY/
|
||||
A5vpLfqDXHm3nRgy7yrNe7FYXvCjzNbVTFZ96oh1c4wy88RG0xxbcl+lUcNRCX9C
|
||||
sqeOpTJu1g4SUUzop+pGEXtwIpnSsPTsZ6LPDRq6LI4kkUMltwXoxfWu7hbr/nS7
|
||||
GBru8hZRF3mx2yRqqYiZnMQR/lZAG5AThkeKFbsSWOEoOCAQnnzX6A==
|
||||
-----END RSA PRIVATE KEY-----
|
20
test/client.pem
Normal file
20
test/client.pem
Normal file
@@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDQDCCAigCAQMwDQYJKoZIhvcNAQELBQAwga4xCzAJBgNVBAYTAkNIMRIwEAYD
|
||||
VQQIDAlaw4PCvHJpY2gxEzARBgNVBAcMCldpbnRlcnRodXIxKDAmBgNVBAoMH2h0
|
||||
dHBzOi8vZGV2Lm1hcmMud2FlY2tlcmxpbi5vcmcxKDAmBgNVBAMMH2h0dHBzOi8v
|
||||
ZGV2Lm1hcmMud2FlY2tlcmxpbi5vcmcxIjAgBgkqhkiG9w0BCQEWE21hcmNAd2Fl
|
||||
Y2tlcmxpbi5vcmcwHhcNMTUxMDEwMTQxODE5WhcNMTUxMTA5MTQxODE5WjCBoDEL
|
||||
MAkGA1UEBhMCQ0gxEjAQBgNVBAgMCVrDg8K8cmljaDETMBEGA1UEBwwKV2ludGVy
|
||||
dGh1cjEoMCYGA1UECgwfaHR0cHM6Ly9kZXYubWFyYy53YWVja2VybGluLm9yZzEa
|
||||
MBgGA1UEAwwRTWFyYyBXw4PCpGNrZXJsaW4xIjAgBgkqhkiG9w0BCQEWE21hcmNA
|
||||
d2FlY2tlcmxpbi5vcmcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALGZ1nGC
|
||||
RHEStwua0bD04ImB19LwG1IyqG9tEXOgmtFZzit8xsfzcovMQv26yCgtlxiSSalP
|
||||
HFfvZ7K3AIdT5JmoImzQv4RHMCYKTFjMTLdkAzHt2KOTQ7lpH3pueV0szLYYAlPB
|
||||
Y13yN1C+NEK4gB3EqDSOv5PH4VBcujRK+gwrAgMBAAEwDQYJKoZIhvcNAQELBQAD
|
||||
ggEBALRENDQLg2shfXSW4xG/oPad4XaFMLeynS9pQgX2+uHUYdb4m1c/fhCv9mXl
|
||||
Y5Cj0zgFcO5ugvE91OiYog+9AZ/W/LAvD883IeQkUW2VVHXP1uKt4a2Ru1WQj6vV
|
||||
79WEvQj5YaX9PP2pgRzeTXnASYrk3apfcx2D6ZZDICzpQLVaWQWyXXe43KG8JvvS
|
||||
uuCOw7f1fuAZfa6LyKeisUBf0tX1Ow8NeYJqJ12Vuesk+E7Tw98oUEffnps7rOnA
|
||||
eJilOOEcQYmjTdO2RfUVGRBoWIDeyivsMU3p0lNuQrjZaxewUjmIt+n/ZYFYd7yr
|
||||
EjI+25K++7QCVDGKT/X4Rddoc3o=
|
||||
-----END CERTIFICATE-----
|
20
test/makefile.am
Normal file
20
test/makefile.am
Normal file
@@ -0,0 +1,20 @@
|
||||
## @id $Id$
|
||||
#
|
||||
# This file has been added by bootstrap.sh on Sat, 10 October 2015 12:52:56 +0200
|
||||
# Feel free to change it or even remove and rebuild it, up to your needs
|
||||
#
|
||||
## 1 2 3 4 5 6 7 8
|
||||
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
TESTS = test-commands.wt
|
||||
TEST_EXTENSIONS = .wt
|
||||
WT_LOG_COMPILER = xvfb-run -a ${top_builddir}/src/webrunner
|
||||
AM_WT_LOG_FLAGS = -x test-output.xml -p ${srcdir}
|
||||
|
||||
EXTRA_DIST = ${TESTS} ca.pem client.pem client.key
|
||||
|
||||
maintainer-clean-local:
|
||||
-rm -r attachments
|
||||
|
||||
CLEANFILES = test-output.xml
|
||||
MAINTAINERCLEANFILES = makefile.in
|
99
test/test-commands.wt
Normal file
99
test/test-commands.wt
Normal file
@@ -0,0 +1,99 @@
|
||||
## @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 ca.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 client.pem client.key password
|
||||
|
||||
testcase Test For Loop
|
||||
# test the for loop feature
|
||||
# first run with a gven list
|
||||
execute bash
|
||||
echo -n "test:" > testfile
|
||||
for VAR -> 1, 2, 3, 4
|
||||
execute bash
|
||||
echo -n "-VAR;">> testfile
|
||||
set RESULT
|
||||
execute bash
|
||||
cat testfile
|
||||
rm testfile
|
||||
check RESULT = test:-1;-2;-3;-4;
|
||||
# then run with a given global value
|
||||
set VAR = 5, 6, 7, 8, 9
|
||||
for VAR
|
||||
execute bash
|
||||
echo -n "-VAR;">> testfile
|
||||
set RESULT
|
||||
execute bash
|
||||
cat testfile
|
||||
rm testfile
|
||||
check RESULT = -5;-6;-7;-8;-9;
|
||||
# multi dimensional for loops
|
||||
# VAR colides with VARS1 and VARS2
|
||||
unset VAR
|
||||
set VARS1 = 1, 2, 3, 4
|
||||
set VARS2 = a, b, c, d
|
||||
set RESULT =
|
||||
for VARS1
|
||||
for VARS2
|
||||
set RESULT = RESULTVARS1VARS2
|
||||
check RESULT = 1a1b1c1d2a2b2c2d3a3b3c3d4a4b4c4d
|
Reference in New Issue
Block a user