Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Delete all our old webtest/ code from Piwik. The new way to test the …

…UI is our beloved Screenshot tests! https://github.com/piwik/piwik-ui-tests
  • Loading branch information...
commit 93b90cbfe39e40ae7f62118ab0fb6caa16480045 1 parent 97cc649
@mattab mattab authored
View
47 tests/webtest/config/webtest.example.properties
@@ -1,47 +0,0 @@
-################################################
-# Test suite configuration file
-################################################
-
-### WebTests config
-wt.home=/usr/local/canoo
-wt.config.host=127.0.0.1
-wt.config.port=80
-wt.config.protocol=http
-wt.config.basepath=/piwik
-
-wt.config.failOnError=true
-wt.config.haltOnError=true
-wt.config.haltOnFailure=true
-wt.config.enableJS=true
-wt.config.throwExceptionOnScriptError=true
-wt.config.browser=Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
-wt.config.verifyLinks=true
-wt.config.verifyImages=true
-wt.config.headless=false
-#wt.openResultFile.skip=true
-
-## General settings
-testcase.dir=./testcases
-
-# patterns for each level
-testcase.level0.pattern=*.xml
-testcase.level1.pattern=*.xml
-testcase.level2.pattern=*.xml
-testcase.level3.pattern=*.xml
-screens=manual_results
-
-## To turn on/off specific level of tests just uncomment/comment appropriate line below
-test.level0=true
-test.level1=true
-#test.level2=true
-#test.level3=true
-
-## db settings
-db.username=username
-db.password=password
-db.port=3306
-db.name=piwik
-db.host=127.0.0.1
-
-## Google API key
-google.apikey=
View
50 tests/webtest/test_suite.xml
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="Piwik" default="Level3" basedir=".">
-
- <target name="setup">
- <mkdir dir="${screens}" />
- </target>
-
- <target name="Level0" if="test.level0" depends="setup">
- <echo>Starting smoke tests...</echo>
- <subant failonerror="${wt.config.failOnError}" inheritall="true">
- <fileset dir="${testcase.dir}/level0" includes="${testcase.level0.pattern}"/>
- </subant>
- <echo>##################################</echo>
- <echo># 0 level smoke tests - FINISHED!#</echo>
- <echo>##################################</echo>
- </target>
-
- <target name="Level1" if="test.level1" depends="Level0">
- <echo>Starting setup tests...</echo>
- <subant failonerror="${wt.config.failOnError}" inheritall="true">
- <fileset dir="${testcase.dir}/level1" includes="${testcase.level1.pattern}"/>
- </subant>
- <echo>#################################</echo>
- <echo># 1st level tests - FINISHED! #</echo>
- <echo>#################################</echo>
- </target>
-
- <target name="Level2" if="test.level2" depends="Level1">
- <echo>Starting setup tests...</echo>
- <subant failonerror="${wt.config.failOnError}" inheritall="true">
- <fileset dir="${testcase.dir}/level2" includes="${testcase.level2.pattern}"/>
- </subant>
- <echo>###################################</echo>
- <echo># 2nd level test - FINISHED! #</echo>
- <echo>###################################</echo>
- </target>
-
- <target name="Level3" if="test.level3" depends="Level2">
- <echo>Starting UI tests - 3rd level...</echo>
- <echo>+-----------------------------------------+</echo>
- <echo>| WARNING! 3rd Level tests are optional |</echo>
- <echo>| and could fail without BUILD FAILED! |</echo>
- <echo>+-----------------------------------------+</echo>
- <subant failonerror="${wt.config.failOnError}" inheritall="true">
- <fileset dir="${testcase.dir}/level3" includes="${testcase.level3.pattern}"/>
- </subant>
- <echo>3rd level smoke tests finished - check for potential errors!</echo>
- </target>
-
-</project>
View
229 tests/webtest/testcases/level0/1.1-install.disabled
@@ -1,229 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Smoke test level0 - deploy test" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="install index">
- <steps>
- <echo>Installation</echo>
-
- &loadMacros;
-
- <echo>Piwik install - dbsetup: db.name: ${db.name}</echo>
- <sql
- driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://${db.host}:${db.port}/"
- userid="${db.username}"
- password="${db.password}"
- >
- <classpath>
- <pathelement location="${basedir}/../lib/java/mysql-connector-java-5.1.7.jar" />
- </classpath>
- <transaction>
- DROP DATABASE IF EXISTS ${db.name};
- </transaction>
- <transaction>
- CREATE DATABASE IF NOT EXISTS ${db.name};
- </transaction>
- </sql>
-
- <invoke description="get index" url="/" />
-
- <!-- 1. welcome -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Welcome!" />
- <verifyText description="check page text" text="This process is split up into 9 easy steps and will take around 5 minutes" />
-
-<!--
- &checkForErrors;
--->
- &verifyLinksAndImages;
-
- <retryClickLink description="wait for piwik.php tracking test" label="Next &raquo;" maxcount="10" seconds="1" />
-
- <!-- 2. systemCheck -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="System Check" />
- <verifyText description="check page text" text="Optional" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <not description="check if system check passed">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error.png']" />
- </not>
-
- <verifyXPath description="looking for ok image" xpath="//img[@src='plugins/Zeitgeist/images/ok.png']" />
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 3. databaseSetup -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Database Setup" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set database host (and port)" name="host" value="${db.host}:${db.port}" />
- <setInputField description="set database username" name="username" value="${db.username}" />
- <setInputField description="set database password" name="password" value="${db.password}" />
- <setInputField description="set database name" name="dbname" value="${db.name}" />
- <setInputField description="set database port" name="tables_prefix" value="canoo_" />
-
- <clickButton description="click 'Next »' button" label="Next »" />
-
- <!-- 4. databaseCheck -->
-<!--
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Database Check" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
--->
-
- <!-- 5. tablesCreation -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Tables created with success!" />
- <verifyXPath description="looking for success image" xpath="//img[@src='plugins/Zeitgeist/images/success_medium.png']" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 6. generalSetup -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Super User" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" name="login" value="piwik_login" />
- <setInputField description="set Piwik password" name="password" value="piwik_password" />
- <setInputField description="set repeated Piwik password" name="password_bis" value="piwik_password" />
- <setInputField description="set Piwik email" name="email" value="nobody@piwik.org" />
-
- <clickButton description="click 'Next »' button" label="Next »" />
-
- <!-- 7. firstWebsiteSetup -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Setup a Website" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik site name" name="siteName" value="Dummy Site Name" />
- <setInputField description="set Piwik URL" name="url" value="${wt.config.protocol}://${wt.config.host}:${wt.config.port}${wt.config.basepath}" />
- <setSelectField description="set Piwik timezone" name="timezone" value="UTC" />
-
- <clickButton description="click 'Next »' button" label="Next »" />
-
- <!-- 8. displayJavascriptCode -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="JavaScript Tracking code" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 9. finished -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Congratulations" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Continue to Piwik'" label="Continue to Piwik &raquo;" />
-
- <!-- logging in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- logged in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports - Dummy Site Name" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
-
- <!-- change language -->
-<!--
- <clickElement description="click 'Deutsch'" xpath="//select[@id='language']/option[@value='de']" />
-
- <verifyText description="check page text" text="Hallo" />
-
- <clickElement description="click 'Français'" xpath="//select[@id='language']/option[@value='fr']" />
-
- <verifyText description="check page text" text="Bonjour" />
-
- <clickElement description="click 'English'" xpath="//select[@id='language']/option[@value='en']" />
-
- <verifyText description="check page text" text="Hello" />
--->
- </steps>
- </webtest>
- </target>
-</project>
View
297 tests/webtest/testcases/level0/1.2-loginforms.disabled
@@ -1,297 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Smoke test level0 - deploy test" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="login forms">
- <config>
- <header name="piwik_auth" value="" />
- </config>
- <steps>
- <echo>Login Forms</echo>
-
- &loadMacros;
-
- <invoke description="get login form" url="/" />
-
- <!-- login (blank) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- login (invalid) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Username required" />
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Password required" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="invalid_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- lost password -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Username &amp; Password not correct" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Lost your password?'" label="Lost your password?" />
-
- <!-- send password reset (blank) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickButton description="click 'Send password reset' button" label="Send password reset" />
-
- <!-- send password reset (invalid) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Username or E-mail required" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="invalid" />
-
- <clickButton description="click 'Send password reset' button" label="Send password reset" />
-
- <!-- send password reset (ok) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Invalid username and/or e-mail address" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
-
- <clickButton description="click 'Send password reset' button" label="Send password reset" />
-
- <!-- sent -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- <ifStep description="check email was sent">
- <condition>
- <not>
- <verifyText description="check page text" text="Information to reset your password has been sent. Check your e-mail." />
- </not>
- </condition>
- <then>
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Unable to send mail." />
- </then>
- </ifStep>
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Sign in'" label="Sign in" />
-
- <!-- login -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- logged in; now, logout -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports - Dummy Site Name" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
- <verifyText description="check page text" text="Sign out" />
-
- <retryClickLink description="click 'Sign out'" label="Sign out" seconds="5" />
-
- <!-- logged out -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <not description="no auth cookie">
- <verifyCookie name="piwik_auth" regex="login"/>
- <verifyCookie name="piwik_auth" regex="token_auth"/>
- </not>
-
- <invoke description="get reset password form" url="/index.php?module=Login&amp;action=resetPassword" />
-
- <!-- reset password (blank) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
- <verifyText description="check page text" text="Password reset token:" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickButton description="click 'Change password' button" label="Change password" />
-
- <!-- reset password (password mismatch) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
- <verifyText description="check page text" text="Password reset token:" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Username required" />
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Password required" />
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Password (repeat) required" />
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Password reset token required" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="invalid1" />
- <setInputField description="set Piwik password bis" htmlId="form_password_bis" value="invalid2" />
- <setInputField description="set Piwik reset token" htmlId="form_token" value="invalid" />
-
- <clickButton description="click 'Change password' button" label="Change password" />
-
- <!-- reset password (invalid user) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
- <verifyText description="check page text" text="Password reset token:" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Passwords do not match." />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="invalid" />
- <setInputField description="set Piwik password" htmlId="form_password" value="invalid" />
- <setInputField description="set Piwik password bis" htmlId="form_password_bis" value="invalid" />
- <setInputField description="set Piwik reset token" htmlId="form_token" value="invalid" />
-
- <clickButton description="click 'Change password' button" label="Change password" />
-
- <!-- reset password (invalid token) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
- <verifyText description="check page text" text="Password reset token:" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Invalid username and/or e-mail address" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
- <setInputField description="set Piwik password bis" htmlId="form_password_bis" value="piwik_password" />
- <setInputField description="set Piwik reset token" htmlId="form_token" value="invalid" />
-
- <clickButton description="click 'Change password' button" label="Change password" />
-
- <!-- reset password (ok) -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
- <verifyText description="check page text" text="Password reset token:" />
-
- <verifyText description="check page text" text="&lt;strong&gt;Error&lt;/strong&gt;: Token is invalid or has expired." />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <generateResetToken output="piwik_reset_token" />
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="new_password" />
- <setInputField description="set Piwik password bis" htmlId="form_password_bis" value="new_password" />
- <setInputField description="set Piwik reset token" htmlId="form_token" value="${piwik_reset_token}" />
-
- <clickButton description="click 'Change password' button" label="Change password" />
-
- <!-- reset; now sign-in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Sign in" />
-
- <verifyText description="check page text" text="Password successfully changed!" />
-
- <clickLink description="click 'Sign in'" label="Sign in" />
-
- <!-- login with new password -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="new_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- logged in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports - Dummy Site Name" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
-
- </steps>
- </webtest>
- </target>
-</project>
View
63 tests/webtest/testcases/level0/1.3-unit-tests.disabled
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-
-]>
-
-<project name="Smoke test level0 - deploy test" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="unit tests">
- <config timeout="600" />
- <steps>
- <echo>Unit Tests</echo>
-
- &loadMacros;
-
- <echo>Piwik install - dbsetup: db.name: ${db.name}</echo>
- <sql
- driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://${db.host}:${db.port}/"
- userid="${db.username}"
- password="${db.password}"
- >
- <classpath>
- <pathelement location="${basedir}/../lib/java/mysql-connector-java-5.1.7.jar" />
- </classpath>
- <transaction>
- DROP DATABASE IF EXISTS ${db.name};
- </transaction>
- <transaction>
- CREATE DATABASE IF NOT EXISTS ${db.name};
- </transaction>
- </sql>
-
- <concat destfile="${basedir}/../../config/config.ini.php" append="true" fixlastline="true">
- <fileset file="${basedir}/../config/wt.template.ini" />
- <filterchain>
- <expandproperties />
- </filterchain>
- </concat>
-
- <invoke description="get all_tests" url="/tests/all_tests.php" />
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik - running all tests" />
- <verifyText description="check page text" text="Piwik unit tests" />
-
- <not description="total failure">
- <verifyText description="check for 0 passes" text="&lt;strong&gt;0&lt;/strong&gt; passes" />
- </not>
-
- <verifyText description="no failures" text="&lt;strong&gt;0&lt;/strong&gt; fails" />
-
- <verifyText description="no exceptions" text="&lt;strong&gt;0&lt;/strong&gt; exceptions" />
- </steps>
- </webtest>
- </target>
-</project>
View
195 tests/webtest/testcases/level0/1.4-javascript.xml
@@ -1,195 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Smoke test level0 - deploy test" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="piwik.js">
- <steps>
- <echo>Piwik JavaScript Test</echo>
-
- &loadMacros;
-
- <macrodef name="qunit" description="run qunit tests">
- <attribute name="expectedFail" default="0" />
- <sequential>
- <groovy>
- step.context.webClient.cache.clear()
- </groovy>
-
- <invoke description="get unit test" url="/tests/javascript/" />
- <verifyTitle description="check the title is parsed correctly" text="piwik.js: Unit Tests" />
-
- <retry description="wait for test to complete" maxcount="30">
- <sleep description="pause" seconds="1" />
- <verifyXPath description="check for result" xpath="//span[@class='failed']" />
- </retry>
-
- <verifyXPath description="check for not failed" xpath="//span[@class='failed']" text="@{expectedFail}" />
- <not description="check for at least 1 pass">
- <verifyXPath description="check for success" xpath="//span[@class='passed']" text="0" />
- </not>
- </sequential>
- </macrodef>
-
- <macrodef name="genstub" description="generate stub.tpl">
- <attribute name="path" />
- <sequential>
- <echo file="../javascript/stub.tpl">
-&lt;script src="frameworks/@{path}" type="text/javascript"&gt;&lt;/script&gt;
- </echo>
- </sequential>
- </macrodef>
-
- <macrodef name="genstub2" description="generate stub.tpl">
- <attribute name="path" />
- <attribute name="path2" />
- <sequential>
- <echo file="../javascript/stub.tpl">
-&lt;script src="frameworks/@{path}" type="text/javascript"&gt;&lt;/script&gt;
-&lt;script src="frameworks/@{path2}" type="text/javascript"&gt;&lt;/script&gt;
- </echo>
- </sequential>
- </macrodef>
-
- <macrodef name="googlestub" description="generate stub.tpl">
- <attribute name="lib" />
- <attribute name="version" default="1" />
- <sequential>
- <ifStep description="is google api key defined?">
- <condition>
- <not>
- <verifyProperty name="${google.apikey}" value="" propertyType="ant" />
- </not>
- </condition>
- <then>
- <echo file="../javascript/stub.tpl">
-&lt;script src="https://www.google.com/jsapi?key=${google.apikey}" type="text/javascript"&gt;&lt;/script&gt;
-&lt;script type="text/javascript"&gt;
- google.load("@{lib}", "@{version}");
-&lt;/script&gt;
- </echo>
- </then>
- <else>
- <echo>Google API key not defined; unable to load @{lib}, version @{version}</echo>
- <delete file="../javascript/stub.tpl" quiet="true" />
- </else>
- </ifStep>
-
- </sequential>
- </macrodef>
-
- <!--
- tracking tests are disabled in WebTest
-
- 1) when loading the iframe (click handler), it changes
- the "current" response to the iframe
-
- @see http://webtest-community.canoo.com/jira/browse/WT-428
-
- 2) GET requests for the web bug/beacon/pixel are ignored
- -->
- <!-- touch file="../javascript/enable_sqlite" / -->
-
- <delete file="../javascript/stub.tpl" quiet="true" />
- <qunit description="piwik.js standalone" />
-
- <genstub path="dojo/dojo-1.0.3.js" />
- <qunit description="piwik.js + dojo 1.0.3" />
-
- <genstub path="dojo/dojo-1.1.2.js" />
- <qunit description="piwik.js + dojo 1.1.2" />
-
- <genstub path="dojo/dojo-1.2.4.js" />
- <qunit description="piwik.js + dojo 1.2.4" />
-
- <genstub path="dojo/dojo-1.3.3.js" />
- <qunit description="piwik.js + dojo 1.3.3" />
-
- <genstub path="dojo/dojo-1.4.3.js" />
- <qunit description="piwik.js + dojo 1.4.3" />
-
- <genstub path="dojo/dojo-1.5.0.js" />
- <qunit description="piwik.js + dojo 1.5.0" />
-
- <genstub path="dojo/dojo-1.6.0.js" />
- <qunit description="piwik.js + dojo 1.6.0" />
-
- <googlestub lib="dojo" version="1" />
- <qunit description="piwik.js + dojo 1.x" />
-
- <!--
- <genstub2 path="ext/ext-base-2.3.0.js" path2="ext/extjs-2.3.0.js" />
- <qunit description="piwik.js + extjs 2.3.0" />
-
- <genstub2 path="ext/ext-base-3.3.1.js" path2="ext/extjs-3.3.1.js" />
- <qunit description="piwik.js + extjs 3.3.1" />
- -->
-
- <!--
- <genstub path="ext/ext-core-3.0.0.js" />
- <qunit description="piwik.js + ext-core 3.0.0" />
-
- <genstub path="ext/ext-core-3.1.0.js" />
- <qunit description="piwik.js + ext-core 3.1.0" />
-
- <googlestub lib="ext-core" version="3" />
- <qunit description="piwik.js + ext-core 3.x" />
- -->
-
- <genstub2 path="jquery/jquery-1.0.4.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.0.4" />
-
- <genstub2 path="jquery/jquery-1.1.4.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.1.4" />
-
- <genstub2 path="jquery/jquery-1.2.6.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.2.6" />
-
- <genstub2 path="jquery/jquery-1.3.2.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.3.2" />
-
- <genstub2 path="jquery/jquery-1.4.4.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.4.4" />
-
- <genstub2 path="jquery/jquery-1.5.1.js" path2="jquery/jquery.json-2.2.js" />
- <qunit description="piwik.js + jquery 1.5.1" />
-
- <genstub path="mootools/mootools-1.1.2.js" />
- <qunit description="piwik.js + mootools 1.1.2" />
-
- <genstub path="mootools/mootools-1.2.5.js" />
- <qunit description="piwik.js + mootools 1.2.5" />
-
- <genstub path="mootools/mootools-1.3.1.js" />
- <qunit description="piwik.js + mootools 1.3.1" />
-
- <googlestub lib="mootools" version="1.3" />
- <qunit description="piwik.js + mootools 1.3.x" />
-
- <genstub path="prototype/prototype-1.5.0.js" />
- <qunit description="piwik.js + prototype 1.5.0" />
-
- <genstub path="prototype/prototype-1.6.0.js" />
- <qunit description="piwik.js + prototype 1.6.0" />
-
- <genstub path="prototype/prototype-1.7.0.js" />
- <qunit description="piwik.js + prototype 1.7.0" />
-
- <googlestub lib="prototype" version="1" />
- <qunit description="piwik.js + prototype 1.x" />
-
- <genstub path="yui/yui-3.3.0.js" />
- <qunit description="piwik.js + yui 3.x" />
- </steps>
- </webtest>
- </target>
-</project>
View
28 tests/webtest/testcases/level0/1.5-jslint.xml
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Smoke test level0 - deploy test" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="jslint">
- <steps>
- <echo>JSLint</echo>
-
- <invoke description="get form" url="http://jslint.com/" />
- <loadfile description="load javascript" srcFile="../../js/piwik.js" property="js" encoding="UTF-8" />
- <setInputField description="paste javascript" xpath="//fieldset[@id='JSLINT_SOURCE']/textarea" value="${js}" />
- <clickButton description="click button" label="JSLint" />
- <sleep description="pause" seconds="1" />
- <verifyXPath description="check for errors" xpath="//fieldset[@id='JSLINT_ERRORS' and @style='display: none;']" />
- </steps>
- </webtest>
- </target>
-</project>
View
28 tests/webtest/testcases/level1/1.4-preinstall.xml
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Level 1 - pre-install 1.1.1" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="pre-install">
- <config>
- <option name="ThrowExceptionOnScriptError" value="false" />
- </config>
- <steps>
- <echo>Pre-install 1.1.1</echo>
-
- &loadMacros;
-
- <piwikPreInstall version="1.1.1" />
- </steps>
- </webtest>
- </target>
-</project>
View
227 tests/webtest/testcases/level1/1.5-install.xml
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Level 1 - install" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="install index">
- <steps>
- <echo>Installation</echo>
-
- &loadMacros;
-
- <echo>Piwik install - dbsetup: db.name: ${db.name}</echo>
- <sql
- driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://${db.host}:${db.port}/"
- userid="${db.username}"
- password="${db.password}"
- >
- <classpath>
- <pathelement location="${basedir}/../lib/java/mysql-connector-java-5.1.7.jar" />
- </classpath>
- <transaction>
- DROP DATABASE IF EXISTS ${db.name};
- </transaction>
- <transaction>
- CREATE DATABASE IF NOT EXISTS ${db.name};
- </transaction>
- </sql>
-
- <invoke description="get index" url="/" />
-
- <!-- 1. welcome -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Welcome!" />
- <verifyText description="check page text" text="This process is split up into 9 easy steps and will take around 5 minutes" />
-
-<!--
- &checkForErrors;
--->
- &verifyLinksAndImages;
-
- <retryClickLink description="wait for piwik.php tracking test" label="Next &raquo;" maxcount="10" seconds="1" />
-
- <!-- 2. systemCheck -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="System Check" />
- <verifyText description="check page text" text="Optional" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <not description="check if system check passed">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error.png']" />
- </not>
-
- <verifyXPath description="looking for ok image" xpath="//img[@src='plugins/Zeitgeist/images/ok.png']" />
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 3. databaseSetup -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Database Setup" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set database host (and port)" name="host" value="${db.host}:${db.port}" />
- <setInputField description="set database username" name="username" value="${db.username}" />
- <setInputField description="set database password" name="password" value="${db.password}" />
- <setInputField description="set database name" name="dbname" value="${db.name}" />
- <setInputField description="set database port" name="tables_prefix" value="canoo_" />
-
- <clickButton description="click 'Go!' button" label="Go!" />
-
- <!-- 4. databaseCheck -->
-<!--
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Database Check" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
--->
-
- <!-- 5. tablesCreation -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Tables created with success!" />
- <verifyXPath description="looking for success image" xpath="//img[@src='plugins/Zeitgeist/images/success_medium.png']" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 6. generalSetup -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="General Setup" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" name="login" value="piwik_login" />
- <setInputField description="set Piwik password" name="password" value="piwik_password" />
- <setInputField description="set repeated Piwik password" name="password_bis" value="piwik_password" />
- <setInputField description="set Piwik email" name="email" value="nobody@piwik.org" />
-
- <clickButton description="click 'Go!' button" label="Go!" />
-
- <!-- 7. firstWebsiteSetup -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Setup a Website" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik site name" name="siteName" value="Dummy Site Name" />
- <setInputField description="set Piwik URL" name="url" value="${wt.config.protocol}://${wt.config.host}:${wt.config.port}${wt.config.basepath}" />
- <setSelectField description="set Piwik timezone" name="timezone" value="UTC" />
-
- <clickButton description="click 'Go!' button" label="Go!" />
-
- <!-- 8. displayJavascriptCode -->
-
- <not description="check if no error">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if no warning">
- <verifyXPath description="looking for warning image" xpath="//img[@src='plugins/Zeitgeist/images/warning_medium.png']" />
- </not>
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="JavaScript Tracking tag" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Next'" label="Next &raquo;" />
-
- <!-- 9. finished -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Installation" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Congratulations" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <clickLink description="click 'Continue to Piwik'" label="Continue to Piwik &raquo;" />
-
- <!-- logging in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- logged in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
-
- <!-- change language -->
- <retryClickLink description="click 'Deutsch'" href="index.php?module=LanguagesManager&amp;action=saveLanguage&amp;language=de" seconds="5" />
-
- <verifyText description="check page text" text="Hallo" />
-
- <retryClickLink description="click 'Français'" href="index.php?module=LanguagesManager&amp;action=saveLanguage&amp;language=fr" seconds="5" />
-
- <verifyText description="check page text" text="Bonjour" />
-
- <retryClickLink description="click 'English'" href="index.php?module=LanguagesManager&amp;action=saveLanguage&amp;language=en" seconds="5" />
-
- <verifyText description="check page text" text="Hello" />
- </steps>
- </webtest>
- </target>
-</project>
View
25 tests/webtest/testcases/level1/1.6-update.xml
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE project [
- <!ENTITY time SYSTEM "../modules/time.xml">
- <!ENTITY checkForErrors SYSTEM "../modules/errors.xml">
- <!ENTITY verifyLinksAndImages SYSTEM "../modules/common_pages.xml">
- <!ENTITY loadMacros SYSTEM "../modules/macros.xml">
- <!ENTITY raquo "&#187;">
- <!ENTITY rsaquo "&#8250;" >
-]>
-
-<project name="Level 1 - auto update" basedir="." default="webtest">
- &time;
- <target name="webtest">
- <webtest name="auto update">
- <steps>
- <echo>Auto-Update</echo>
-
- &loadMacros;
-
- <piwikAutoUpdate />
- </steps>
- </webtest>
- </target>
-</project>
View
8 tests/webtest/testcases/modules/common_pages.xml
@@ -1,8 +0,0 @@
- <enableJavaScript description="Disable JS verification for external resources" enable="false" />
- <ifStep description="production tests" test="${wt.config.verifyLinks}">
- <verifyLinks />
- </ifStep>
- <ifStep description="production tests" test="${wt.config.verifyImages}">
- <verifyImages />
- </ifStep>
- <enableJavaScript description="Turn back JS verification for further testing" enable="true" />
View
6 tests/webtest/testcases/modules/errors.xml
@@ -1,6 +0,0 @@
-<not description="There should be no errors and no notices on output page">
- <verifyText description="Check errors" text="error:" />
- <verifyText description="Check errors" text="Fatal error" />
- <verifyText description="Check notices" text="Notice" />
- <verifyText description="Check warnings" text="Warning" />
-</not>
View
205 tests/webtest/testcases/modules/macros.xml
@@ -1,205 +0,0 @@
-<macrodef name="generateResetToken" description="generate reset token">
- <attribute name="output" default="piwik_reset_token" />
- <sequential>
- <exec executable="${php.executable}" dir="${basedir}" outputproperty="@{output}">
- <arg value="-r" />
- <arg value="@date_default_timezone_set('UTC'); &#36;ini = parse_ini_file('${basedir}/../../config/config.ini.php', true); &#36;passwd = md5('piwik_password'); echo hash('whirlpool', strftime('%Y%m%d%H', time()+24*60*60) . 'piwik_login' . 'nobody@piwik.org' . substr(&#36;passwd, 0, 16) . &#36;ini['superuser']['salt'] . substr(&#36;passwd, -16));" />
- </exec>
- </sequential>
-</macrodef>
-
-<macrodef name="retryClickLink" description="clickLink with retry and timeout">
- <attribute name="maxcount" default="1" />
- <attribute name="seconds" default="1" />
- <attribute name="description" default="" />
- <attribute name="label" default="" />
- <attribute name="href" default="" />
- <sequential>
- <retry description="@{description}" maxcount="@{maxcount}">
- <sleep description="pause" seconds="@{seconds}" />
- <clickLink description="click link" label="@{label}" href="@{href}" />
- </retry>
- </sequential>
-</macrodef>
-
-<macrodef name="piwikGetVersion" description="get Piwik version">
- <attribute name="propertyName" default="latestVersion" />
- <sequential>
- <get src="http://api.piwik.org/1.0/getLatestVersion/" dest="latestVersion.txt" />
- <loadfile srcFile="latestVersion.txt" property="@{propertyName}">
- <filterchain>
- <striplinebreaks />
- </filterchain>
- </loadfile>
- </sequential>
-</macrodef>
-
-<macrodef name="piwikPreInstall" description="pre-install Piwik">
- <attribute name="version" default="1.0" />
- <sequential>
- <!-- download Piwik and unzip -->
-
- <property environment="env" />
-
- <get src="http://builds.piwik.org/piwik-@{version}.zip" dest="piwik-@{version}.zip" />
-
- <unzip src="piwik-@{version}.zip" dest="${env.WORKSPACE}" />
-
- <delete includeemptydirs="true">
- <fileset dir="${basedir}/../.." includes="config/**" />
- <fileset dir="${basedir}/../.." includes="core/**" />
- <fileset dir="${basedir}/../.." includes="js/**" />
- <fileset dir="${basedir}/../.." includes="lang/**" />
- <fileset dir="${basedir}/../.." includes="libs/**" />
- <fileset dir="${basedir}/../.." includes="misc/**" />
- <fileset dir="${basedir}/../.." includes="plugins/**" />
- <fileset dir="${basedir}/../.." includes="tmp/**" />
- <fileset dir="${basedir}/../..">
- <include name="*" />
- <exclude name="tests" />
- </fileset>
- </delete>
-
- <move todir="${env.WORKSPACE}/build/">
- <fileset dir="${env.WORKSPACE}/piwik/" />
- </move>
-
- <replace file="${env.WORKSPACE}/build/config/global.ini.php">
- <replacefilter
- token="latest_version_url = http://builds.piwik.org/latest.zip"
- value="latest_version_url = http://${env.HTTP_HOST}/jenkins.private/jobs/Piwik/workspace/latest.zip" />
- <replacefilter
- token="api_service_url = http://api.piwik.org"
- value="api_service_url = http://${env.HTTP_HOST}/jenkins.private/jobs/Piwik/workspace" />
- </replace>
- <length file="${env.WORKSPACE}/build/config/global.ini.php" property="configLEN" />
- <checksum file="${env.WORKSPACE}/build/config/global.ini.php" property="configMD5" />
- <replaceregexp
- file="${env.WORKSPACE}/build/config/manifest.inc.php"
- match='"(config/global.ini.php)".*'
- replace='"\1" => array("${configLEN}", "${configMD5}"),'
- byline="true" />
- </sequential>
-</macrodef>
-
-<macrodef name="piwikAutoUpdate" description="auto-update Piwik">
- <sequential>
- <!-- logging in -->
-
- <invoke description="get index" url="/" />
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Lost your password?" />
-
- &checkForErrors;
- &verifyLinksAndImages;
-
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
-
- <!-- logged in -->
-
- <ifStep description="check if this version changed the page title">
- <condition>
- <not>
- <verifyProperty name="latestVersion" value="1.6" propertyType="ant" />
- </not>
- </condition>
- <then>
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports" />
- </then>
- <else>
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports - Dummy Site Name" />
- </else>
- </ifStep>
-
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
-
- <!-- update notice -->
-
- <verifyText description="check page text" text="New Update:" />
- <mouseOver description="expand header message" htmlId="header_message" />
- <verifyText description="check page text" text="Please update now!" />
-
- <enableJavaScript enable="false" />
- <clickLink description="click 'Please update now'" href="action=newVersionAvailable" />
-
- <!-- one click update -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Update" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Update Automatically" />
- <verifyText description="check page text" text="Download" />
-
- <clickButton description="click 'Update Automatically' Button" label="Update Automatically" />
-
- <!-- download, unzip -->
-
- <!-- invoke description="one click update" url="/index.php?module=CoreUpdater&amp;action=oneClickUpdate" /-->
-
- <!-- javascript needed for form to auto-post -->
-
- <clickButton description="simulate auto-post form" label="Continue" />
-
- <not description="check for errors">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <not description="check if zip archive passed">
- <verifyText description="check page text" text="Incompatible archive" />
- </not>
-
- <verifyText description="check page text" text="Piwik updated successfully!" />
- <clickButton description="click 'Continue to Piwik' button" label="Continue to Piwik" />
-
- <!-- db update? -->
-
- <ifStep description="check if db update required">
- <condition>
- <verifyText description="check page text" text="Database Upgrade Required" />
- </condition>
- <then>
- <clickButton description="click 'Upgrade Piwik' button" label="Upgrade Piwik" />
-
- <!-- db update done -->
-
- <not description="check for errors">
- <verifyXPath description="looking for error image" xpath="//img[@src='plugins/Zeitgeist/images/error_medium.png']" />
- </not>
-
- <verifyText description="check page text" text="Piwik has been successfully updated!" />
- <clickButton description="click 'Continue to Piwik' button" label="Continue to Piwik" />
- </then>
- </ifStep>
-
- <!-- logged out? -->
- <ifStep description="check if re-login required">
- <condition>
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Sign in" />
- </condition>
- <then>
- <setInputField description="set Piwik login" htmlId="form_login" value="piwik_login" />
- <setInputField description="set Piwik password" htmlId="form_password" value="piwik_password" />
-
- <!-- sign in -->
-
- <clickButton description="click 'Sign in' button" label="Sign in" />
- </then>
- </ifStep>
-
- <!-- logged in -->
-
- <verifyTitle description="check the title is parsed correctly" text="Piwik &rsaquo; Web Analytics Reports - Dummy Site Name" />
- <verifyText description="check page text" text="Piwik" />
- <verifyText description="check page text" text="Dashboard" />
- <verifyText description="check page text" text="Hello" />
-
- <not description="up to date">
- <verifyText description="check page text" text="New Update:" />
- </not>
- </sequential>
-</macrodef>
View
15 tests/webtest/testcases/modules/time.xml
@@ -1,15 +0,0 @@
- <tstamp>
- <format property="today.plus.one" pattern="yyyy-MM-dd"
- offset="1" unit="day" />
- </tstamp>
- <tstamp>
- <format property="today.plus.three" pattern="yyyy-MM-dd"
- offset="3" unit="day" />
- </tstamp>
- <tstamp>
- <format property="unique" pattern="yyMMddHHmmssS" />
- </tstamp>
- <tstamp>
- <format property="today.minus.two" pattern="yyyy-MM-dd"
- offset="-2" unit="day" />
- </tstamp>
Please sign in to comment.
Something went wrong with that request. Please try again.