Vous êtes sur la page 1sur 10

Build Testing Guide

Sikuli Script

Wednesday 30th July 2014


Version 1.00

Suite 6 Drag & Drop


45 Chichester Road

Build Testing Guide


Southend on Sea
Essex

Document Revisions

Version
Number

Date
30/07/2014

0.1

Document Changes
Initial Draft - Matthew Chapman

Build Testing Guide


Table of Contents
INTRODUCTION
WHAT IS SIKULI?
PROCESS OVERVIEW
THE STEPS
TESTING AN IMAGE
EXAMPLE: THE SCRIPT WILL FAIL IF THE IMAGE DOES NOT APPEAR
HOW IT KNOWS THE IMAGE FAILED
EXAMPLE: ASSERTING A SCREENSHOT EXISTS BEFORE CONTINUING
BUILD TESTING REQUIREMENTS
EXAMPLE: TESTING MULTIPLE AREAS AND APPROVAL EMAILS

Build Testing Guide


1 Introduction
1.1

What is Sikuli?

Until the 1980s, using a computer program meant memorizing a lot of commands
and typing them in a line at a time, only to get lines of text back. The graphical
user interface, or GUI, changed that. By representing programs, program
functions, and data as two-dimensional images like icons, buttons and
windows the GUI made intuitive and spatial what had been memory intensive and
laborious.
But while the GUI made things easier for computer users, it didnt make them any easier for
computer programmers. Underlying GUI components is a lot of computer code, and usually,
building or customizing a program, or getting different programs to work together, still
means manipulating that code. Researchers in MITs Computer Science and Artificial
Intelligence Lab hope to change that, with a system that allows people to write programs
using screen shots of GUIs. Ultimately, the system could allow casual computer users to
create their own programs without having to master a programming language.
Ezadspro is a GUI with a lot of computer code and is constantly updating with new features
and functionality on a daily basis. Due to this there is always a risk of the system not being
tested correctly before becoming live to its users. Using sikuli and creating a script we are
now able to test the GUI without going through thousands of lines of code.
In this guide will explain the process and steps we take to ensure each update is tested
thoroughly using Sikuli.

Build Testing Guide


1.2

Process Overview

Sikuli runs from a dedicated machine which automatically starts a process of logging into
Ezadspro to test once a new update has been developed. It then moves on to run different
commands to test the software by clicking, selecting and making sure the screenshots match
the live screen. This is called Screenshot driven computing.
Below is a typical sequence of events Sikuli will run to test cropping of an image:

2 The Steps
Sikuli doesnt just test certain types of errors but creates an environment on how an agent
would use the system. It replicates how a client would use the software with stock and
adverts before testing complicated tasks. Once all tests have been completed it resets its
adverts and notifies the team that the test was successful. If it is not successful it will send
an error report relating to the task it failed. This will cause the build to not be applied to any
live servers.

Build Testing Guide


2.1
Testing an image
Example: The script will fail if the image does not appear
Once sikuli has developed a testing environment it will move on to test complicated tasks
like checking an image is correctly placed. Please relate to 2.1.1 for exact steps on how it
does this.
2.1.1 How it knows the image failed
Example: Asserting a screenshot exists before continuing
1. click("

") (This opens the PDF of an item preview)

2. wait(4) (Waits until the PDF appears)

3. assert exists("
",20) (Checks the PDF preview for the following: Quad,
Image, Text and Quality)
4. type("q", KeyModifier.CTRL) (Quits adobe ready to move onto the next task)

5. assert exists("
PDF)

") (Checks the Ezadspro preview matches the

This is one of the small processes Sikuli runs, within these 5 steps it has covered testing a
large amount of potential errors within the system.

Build Testing Guide

Build Testing Guide


2.2
Build Testing Requirements
Example: Testing multiple areas and approval emails
Below is a more detailed guide on what we test and how, this is constantly growing with new
features.

Indicator
Log In
Change group
User preferences
Preferences
Add stock

Definition

Relates to the login screen making sure users can log in


successfully and see the stock window
Once logged into the stock window it will proceed to change
the group making sure it loads correctly
Loads the user preferences making sure every field is present
and that is saves correctly
Much like the user preferences it does the same for
preferences
Adds a stock item making sure the window loads correctly

Entering text into all


fields

Enters text into all available stock fields

Uploading an image

Uploads 2 images from a local machine

Image cropping

Checks the image crops correctly

Previewing an item (On


different items)

Previews the item to make sure text fields and images are
showing correctly

PDF preview for an item

Checks the PDF output is correct and matches the preview

Quadding on PDF

Checks the quad is in place between the town and price

Zoom on item preview

Zooms into the item and asserts that it is correct

Saving of stock items

Saves the item and checks all text is still present

Stock list search works

Searches for different items in the stock list making sure only
the desired results are returned

Build Testing Guide


Stock list sort works

Sorts the stock by price

Moving Items to the


archive

Moves items to the archive folder and counts amount left in


active

Loading archive

Loads the archive correctly

Deleting an item

Deletes the items in the archive

Loading deleted folder

Loads the deleted folder

Selecting stock using


both methods

Ezadspro has two ways of selecting stock it tests both


asserting they work correctly using colour recognition

Deselecting stock using


both methods

Deselects the stock using both methods and colour recognition

Duplicating stock

Duplicates stock ready for its new advert

Clicking new ad
Entering full ad details

Creates a new advert and checks all fields and backings are
available
Enters full ad details including the date of the build test

Flowing items on to the


page

Flows all previously created stock onto the advert and checks
they are correct

Clearing the items and


creating a layout

Clears all the stock from the advert and checks it is now blank

Dragging and dropping


items onto the page

Drags items from the advert stock list onto a random box on
the page

Swap items works

Swaps the item on the page to another template / module

Change item template


works

Changes the item in the drop down window and places it on


the advert

Edit stock item from ad


works

Edits the item from the advert directly checking all fields are
still correct

Deselecting stock using


shift

Deselects stock from the advert window and checks they have
reappeared in the stock list

Email proof of advert

Emails a proof of the advert to our support team who checks it


is correctly shown
Zooms on the advert comparing it to previous screenshots

Zooming on the ad
preview
Dropping a filler onto
the page

Drops a filler on the page checking the artwork and size is


correct

Creating a pdf preview

Creates a PDF preview using both methods

Build Testing Guide


both methods
Check for low res
images and overflowing
text flag
Approving an advert
Downloading a high res
advert

Crops an image to a very low DPI and checks the low res image
flag appears
Approves the advert monitoring all processes including email
delivery
Downloads the high res advert and checks through both pages

Resending email
delivery

Resends the email delivery and checks this was sent

Deapproving an advert

Deapproves the advert using colour recognition

Deleting an advert

Deletes all available adverts after its checks have been ran

View log works

Views the log making sure entries were creating from the
script

If you have any questions that are not addressed by this user guide, please contact
support@draganddrop.co.uk for additional information.

Vous aimerez peut-être aussi