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
PRO
November 19, 2016
Programming
0
430
Dimitris Mitsis - Automated tests with CodeCeption - WordCamp Athens 2016
WordPress Greek Community
PRO
November 19, 2016
Tweet
Share
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
24
Orestis Samaras - Modern WordPress Development with Composer
wpgr
PRO
0
15
Eleni Tsertou - Ταχύτερο website με Persistent Object Cache: Μύθος ή Αλήθεια;
wpgr
PRO
0
17
George Korakas - WordPress Security 2025: From Real Threats to Practical Defenses
wpgr
PRO
0
15
Δημήτρης Καρβούνης - Πέρα από το Admin Panel: Πώς να μιλήσεις στο WordPress σαν Developer μέσω REST API
wpgr
PRO
0
13
Αναστασία Αδαμούδη - Δημιουργία σύνθετου μενού πλοήγησης σε block θέματα
wpgr
PRO
0
11
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
PRO
0
18
Jovana Smoljanovic Tucakov - AI vs. Human Content: What Works, What Backfires, and What’s Next
wpgr
PRO
0
15
Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website
wpgr
PRO
0
16
Other Decks in Programming
See All in Programming
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
310
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
How to stabilize UI tests using XCTest
akkeylab
0
130
AHC061解説
shun_pi
0
400
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
440
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
770
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
420
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
400
CSC307 Lecture 14
javiergs
PRO
0
480
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
150
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
300
Featured
See All Featured
We Are The Robots
honzajavorek
0
200
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
200
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.2k
Embracing the Ebb and Flow
colly
88
5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
140
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
How GitHub (no longer) Works
holman
316
150k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Scaling GitHub
holman
464
140k
Raft: Consensus for Rubyists
vanstee
141
7.4k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
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’ ]