MeetMagento - Acceptance tests in Magento

Preview:

DESCRIPTION

Create acceptance tests using Menta Framework. If you want to use it just download from GitHub https://github.com/AOEmedia/Menta_SampleProject

Citation preview

Tomasz GrzemskiTymoteusz Motylewski

Acceptance testing in Magento

@Grzemski

@tmotyl

Who we are?• Macopedia founders• Web Applications enthusiasts• Open Source Evangelists

Macopedia• Software House• Open Source and Scrum Lovers• Enterprise Web Applications• 3 offices in Poland (Poznan, Warsaw,

Cracow)

ContinuousIntegration

Deployment

Development

Delivery{Improvement

“Continuous”== “Doing stuff over and over again”

BuildsDeployment Tests Infrastructure

Setup

Devbox Setup

== “Automation”

Quality AssuranceContinuous

Everything sounds better with “continuous”

Developers

DB + Backup

Integration server

Unit tests Acceptance tests Load tests

Files

DB Settings

IntegrationServer

“Continuous”

Acceptance Tests

test automationis a developer’s task

Selenium for PHP• PHPUnit_Selenium• WebDriver-PHP• PHP-webdriver-bindings• PHP-webdriver• ...

Architecture

HTTPAUT

No direct access (DB, classes,…)

REST* (over HTTP)

*http://code.google.com/p/selenium/wiki/JsonWireProtocol

MentaSelenium 2 Testing Framework for PHP

Menta• Created by Fabrizio Branca from AOE

(Wiesbaden - Germany)• PHP Test Acceptance Framework• github.com / AOEmedia /

Menta_SampleProject

Menta Features

Components Session Management

?Bonus

Features :)Event / ObserverConfiguration

Management

PHPUnit integration

PHPUnit_Framework_TestCaseMenta_PHPUnit_Testcase_Selenium2ProjectY_Abstract_TestCase

Very thin layer on top of PHPUnit

ProjectY_TestCase_Registration ProjectY_TestCase_Checkout the “magic” happens in the components

Abstract test class

Components

Components!

Common Assert Wait Screenshot Selenium1Facade

Imap WebService W3C Validator Curl …

Some might not even require a Selenium session

Components

Component Libraries

Menta

Magento(your library)

Project-specific

Magento (community-provided)

General(your library)

Components Rewrites

PageObject_CartProjectZ_PageObject_Cart

extends

change locators

add functionality

change behavior

overwrite labels

Page Objects

represents services offered by a page or feature

is the only thing with a deep knowledge of

the HTML

clickCheckoutButton() isInCart($product) getTotals()

✔✔✔

Sessions Managment

Let Menta manage your sessions

auto-close

auto-start

incl. on exceptions and ctrl+c

Reusing sessions

Cleaning sessions

Screenshot Gallery

HTML ReportScreenshots (on demand

and on failure)

test description from phpdoc

additional messages

error details

Bonus!

Perceptual diffsBuild X

Build X-1

Perceptual Diff

Perceptual diffs

Selenium performance• Selenium GRID• Use cloud services

github.com / AOEmedia / Mentagithub.com / AOEmedia / Menta_SampleProject

Poznań Magento User Group19 listopada 17:30

pmug.pl

Recommended