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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
WordPress Greek Community
PRO
November 19, 2016
Programming
440
0
Share
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
39
Orestis Samaras - Modern WordPress Development with Composer
wpgr
PRO
0
27
Eleni Tsertou - Ταχύτερο website με Persistent Object Cache: Μύθος ή Αλήθεια;
wpgr
PRO
0
31
George Korakas - WordPress Security 2025: From Real Threats to Practical Defenses
wpgr
PRO
0
36
Δημήτρης Καρβούνης - Πέρα από το Admin Panel: Πώς να μιλήσεις στο WordPress σαν Developer μέσω REST API
wpgr
PRO
0
25
Αναστασία Αδαμούδη - Δημιουργία σύνθετου μενού πλοήγησης σε block θέματα
wpgr
PRO
0
17
Νίκος Μαυράκης - Κοστολογώντας τη δημιουργικότητα
wpgr
PRO
0
34
Jovana Smoljanovic Tucakov - AI vs. Human Content: What Works, What Backfires, and What’s Next
wpgr
PRO
0
32
Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website
wpgr
PRO
0
27
Other Decks in Programming
See All in Programming
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
1.1k
今さら聞けないCancellationToken
htkym
0
180
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
6
6.2k
Cloudflare で始める Data Platform
ta93abe
0
290
GitHub Copilot CLIのいいところ
htkym
2
980
[BalkanRuby 2026] Drop your app/services!
palkan
3
670
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
170
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
1.7k
Sans tests, vos agents ne sont pas fiables
nabondance
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
670
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
230
Featured
See All Featured
KATA
mclloyd
PRO
35
15k
Amusing Abliteration
ianozsvald
1
180
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.7k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
390
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
240
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
340
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
250
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
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’ ]