Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Dimitris Mitsis - Automated tests with CodeCept...
Search
WordPress Greek Community
November 19, 2016
Programming
0
410
Dimitris Mitsis - Automated tests with CodeCeption - WordCamp Athens 2016
WordPress Greek Community
November 19, 2016
Tweet
Share
More Decks by WordPress Greek Community
See All by WordPress Greek Community
Thanassis Zannias - Flexible WordPress Dev Environment with Docker
wpgr
0
11
Andreas Karavanas - AI Supercharged Landing Pages
wpgr
0
16
Όμορφα, γρήγορα και οικονομικά websites με WordPress
wpgr
0
19
Unlocking creativity - Marilia Darilli
wpgr
0
49
Έλλη Μουχτάρη - Χτίσε το προσωπικό σου brand και απόκτησε τους πελάτες που θες
wpgr
0
33
Ioannis Kastorinis - WooCommerce technical automations in the real world
wpgr
0
49
Christos Paloukas - Cache me if you can, a journey through caching layers in WordPress
wpgr
0
55
Ευάγγελος Πάλλης - Malware Cleanup & Protection
wpgr
0
63
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
0
44
Other Decks in Programming
See All in Programming
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
260
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
740
TanStack DB ~状態管理の新しい考え方~
bmthd
2
390
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
0
230
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
160
Langfuseと歩む生成AI活用推進
licux
3
320
Go言語での実装を通して学ぶLLMファインチューニングの仕組み / fukuokago22-llm-peft
monochromegane
0
110
オープンセミナー2025@広島「君はどこで動かすか?」アンケート結果
satoshi256kbyte
0
230
Trem on Rails - Prompt Engineering com Ruby
elainenaomi
1
100
AWS発のAIエディタKiroを使ってみた
iriikeita
1
140
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
220
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
100
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Automating Front-end Workflow
addyosmani
1370
200k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
GraphQLとの向き合い方2022年版
quramy
49
14k
Music & Morning Musume
bryan
46
6.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
GitHub's CSS Performance
jonrohan
1032
460k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Transcript
#wcAth2016 Δημήτρης Μήτσης Αυτοματοποιημένα test με το CodeCeption
Δημήτρης Μήτσης WPML DEVELOPMENT • QUALITY ASSURANCE • PERFORMANCE TESTING
AUTOMATED TESTING • Use of special software to compare the
actual output of an application with the one we expect
Manual tests Integration tests Unit Tests
NEEDS FOR AUTOMATED TESTING • Expedite procedure of quality control
• Quick releases • Integration with WordPress • Integration with 3rd party plugins
UNIT-TEST • TEST DRIVEN DEVELOPMENT (TDD) • PHPUnit Unit testing:
tests if specific parts of the application output the expected result for a given input
BENEFITS OF UNIT-TESTS • Enforce coding standards • Full awareness
of the stack-trace Avoid phrases like: “Works but I don’t know why” White-box testing
2 UnitTests – 0 Integration tests
• Avoid regressions (re-appearance of the same bug) • Ensure
that existing functionality remains • Frequency of updates SIMPLE NEEDS FOR AUTOMATED TESTING
UPDATES FOR WP SEO, WC & WP IN 2016
BEST COFFEE OF YOUR WEEK
CODECEPTION • Testing framework for PHP applications • Easy and
simple to use • Modular and extensible • Promotes design patterns
Unit Tester The geek! Knows the application inside- out Functional
Tester The tester who understands the application but has access to the interface too Acceptance Tester The user which can only test what he sees in the screen CODECEPTION Black box testing Grey box testing White box testing Integration tests
INSTALLATION OF CODECEPTION Requirements • Selenium Standalone • WordPress (website)
(locally or in server) • Browser • Composer • Phar αρχείο (executable) Installation
CODECEPTION – BOOTSTRAP $ wget http://codeception.com/codecept.phar $ php codecept.phar bootstrap
None
None
None
None
None
CODECEPTION – MANUAL TEST STEPS • Create a test product
• View product in the front-end • Add product to cart • Continue with checkout
CODECEPTION – GENERATE TEST $ php codecept.phar generate:cept acceptance WooCommerceBasic
/tests/acceptance/WooCommerceBasicCept.php
None
EMPTY CEST $ codeception.com/docs/06-ModulesAndHelpers#hooks
CODECEPTION – BOOTSTRAP
CODECEPTION –
CODECEPTION –
CODECEPTION – $
CODECEPTION –
php codecept.phar run acceptance --steps java -jar selenium-standalone.jar
CODECEPTION – LOCATORS • CSS ID click(“#css-id”) • CSS
CLASS click(“.css-class”) • TEXT click(“Text”) • xPath click(“//div[@xpath]”) Firebug and FirePath are your friends
CODECEPTION & SELENIUM IDE Two Firefox Add-ons • SeleniumIDE •
CodeCeption Formatters
CODECEPTION HELPERS tests/_support/ΑcceptanceTester.php
CODECEPTION Remember to build after editing this file! php codecept.phar
build
CODECEPTION
CODECEPTION – DESIGN PATTERNS Page Objects & Step Objects •
Each PageObject emphasizes only on one page and its elements. • Each StepObject emphasizes on similar recurring steps
CODECEPTION – PAGE OBJECTS • Locators are defined • Common
steps associated to one page are also defined in the PageObejct • They make tests easier to read
CODECEPTION php codecept.phar generate:pageobject EditProductPage
CODECEPTION
CODECEPTION
Q & A
THAT’S IT! HAPPY TESTING TINYURL.COM/
CODECEPTION – LINKS
CODECEPTION – TIPS <a id=”start_now” href=”...” >Link</a> $I->click( “#start_now” );
CODECEPTION – TIPS <div data-slug=”our-plugin” > // => Somewhere in
the DOM.. //div => ...there is a ...<div>... //div[ ] => ...and it has attributes... //div[ @data-slug=’our_plugin’ ]