Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Dimitris Mitsis - Automated tests with CodeCept...
Search
WordPress Greek Community
PRO
November 19, 2016
Programming
450
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dimitris Mitsis - Automated tests with CodeCeption - WordCamp Athens 2016
WordPress Greek Community
PRO
November 19, 2016
More Decks by WordPress Greek Community
See All by WordPress Greek Community
Filippos Karailanidis - Beyond ChatGPT: AI Toolkit for the WordPress Developer
wpgr
PRO
0
59
Orestis Samaras - Modern WordPress Development with Composer
wpgr
PRO
0
47
Eleni Tsertou - Ταχύτερο website με Persistent Object Cache: Μύθος ή Αλήθεια;
wpgr
PRO
0
45
George Korakas - WordPress Security 2025: From Real Threats to Practical Defenses
wpgr
PRO
0
62
Δημήτρης Καρβούνης - Πέρα από το Admin Panel: Πώς να μιλήσεις στο WordPress σαν Developer μέσω REST API
wpgr
PRO
0
46
Αναστασία Αδαμούδη - Δημιουργία σύνθετου μενού πλοήγησης σε block θέματα
wpgr
PRO
0
26
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
PRO
0
57
Jovana Smoljanovic Tucakov - AI vs. Human Content: What Works, What Backfires, and What’s Next
wpgr
PRO
0
66
Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website
wpgr
PRO
0
50
Other Decks in Programming
See All in Programming
SREの越境 / SRE Collaboration
y0hgi
2
300
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
170
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
140
AWSに止められる覚悟してますか?
morizo_1984
2
520
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
5.8k
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
200
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.9k
気持ちぃ〜角丸 Squircle
ryu1013
0
150
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
900
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
740
Designing for humans not robots
tammielis
254
26k
BBQ
matthewcrist
90
10k
How GitHub (no longer) Works
holman
316
150k
A Soul's Torment
seathinner
8
3.7k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The Invisible Side of Design
smashingmag
301
52k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
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’ ]