SlideShare a Scribd company logo
Autotests
introduction
By Artur Babyuk
Agenda
● What is good auto QA test
● Codeception
○ Settings - YAML
○ Test code
○ Test organisation
○ Good practices
● Selenium, BrowserStack, PhpBrowser
● Jenkins
● And fun
What is good auto QA test?
Autotest is
1. Necessary
2. Stable
3. Simple
4. ...
Codeception
http://codeception.com/
https://gitlab.dyninno.net/qa-automation/TravelFrontendSeleniumTestingSystem
How we can run needed tests?
1. By file name or folder -> ./codecept run tests/acceptance/asap
2. By groups -> ./codecept run -g request -g phones
P.S. in documentation we see -> php codecept run -> ./codecept run do the same
thing
How to run tests on iOS or other platforms?
Settings
tests/acceptance.suite.yml
In config section:
Default settings for all envs
So by default we are using:
WebDriver at BrowserStack
Windows 10 + Chrome
Custom env
Envs:
nojs: with PhpBrowser
Testing asap.com project
local_asap: WebDriver
Running at our Selenium
Selenium vs PhpBrowser
Env (environment)
Is used for:
1. Testing host - run tests for prod, stage, or dev
2. Testing platform - run tests for iOS, Windows, Linux; Chrome or Safari
3. Testing resolution - run tests for laptops, full hd or 4K monitors
4. Tests executor - local Selenium, Selenium Grid, BrowserStack or PhpBrowser
5. Tests misc - GIFs of errors, Allure reporting...
Running tests for needed env
./codecept run acceptance --env local_asap
Combining all
./codecept run acceptance --env local_asap -g request --debug
P.S. --debug option for seeing all steps and additional information, but this make
tests slower
Jenkins
Is tool that executes tests (do the job) for you and where you can find test outputs
http://192.168.3.85/view/ASAP
Login: manager
Pass: xxxxxxx701
Create Jenkins job
1. Создать Item
2. Copy from -> use most green job name
3. Configure job at “Настройки” -> “Сборка” -> Exec command
4. Edit command where line ./codecept run …
Job :(
cd /home/gitlab-runner/TravelFrontendSeleniumTestingSystem/
git pull
./codecept run acceptance --env local_asap -g disclaimers
Autotests introduction - Codeception + PHP Basics
So, we can execute tests, how to write them?
Methodology
● Get the data from test subject
● Compare actual data with expected
Test are written in PHP
So we will use some PHP
Organizing tests
How can we get the test subject, if it is not
on current page???
1. Navigate to the page -> $I->amOnPage('/about');
2. Click -> $I->click('#nav a');
3. Fill forms -> $I->fillField('.user[email]','artur@babyuk.com');
4. Ask developers for help
What the heck just happened with $I-click()?
It is CSS selector, but there is many options
More info: https://blog.mozilla.org/webqa/2013/09/26/writing-reliable-locators-
for-selenium-and-webdriver-tests/
Comparing actual with expected
1. $I->see('Thank you'); $I->dontSee('Please enter email');
2. $I->seeElement('.success'); $I->dontSeeElement('.error');
3. $I->seeInCurrentUrl('/result-page'); $I->dontSeeInCurrentUrl('/oops');
4. Many other helper methods
But this is not so simple
There is problems - animation, network, designers and developers…
Some elements can lagg time to time or be not visible, but we need to autotest it
1. $I->wait(10);
2. $I->waitForElementVisible('.success', 10);
3. $I->waitForText('Success, we will contact you shortly', 30);
4. $I->waitForAllScriptsLoaded($I);
5. $I->scrollTo('footer');
Sometimes we need only to get data
1. $aLinkText = $I->grabMultiple('a');
2. $aLinks = $I->grabMultiple('a', 'href');
3. $url = $I->grabFromCurrentUrl();
4. $heading = $I->grabTextFrom('h1')
There is a lot of needed methods
http://codeception.com/docs/modules/WebDriver#Actions
You can also develop your common methods and put them here:
https://gitlab.dyninno.net/qa-
automation/TravelFrontendSeleniumTestingSystem/blob/master/tests/_support/
WebHelper.php
But tests are not so simple, how about
conditions?
https://clevertechie.com/php/5/php-if-else-statement
How about loops?
https://clevertechie.com/php/6/php-for-loop
How we can store expected results?
https://clevertechie.com/php/3/php-array
How we can loop an array?
https://clevertechie.com/php/8/php-foreach-loop
How about other useful functions?
1. count($elements);
2. strpos($airlineLogoHref, 'airlineNotFound') !== FALSE;
3. str_replace('-', ' ', $url);
4. preg_match('/[^A-Za-z0-9]/i', $onlyText);
5. empty($textOrArray);
6. date('m/d/Y', strtotime('+7 day'));
Autotests introduction - Codeception + PHP Basics
Home work

More Related Content

What's hot (20)

淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)
Kyle Lin
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
Neil Crosby
 
Front-end Automated Testing
Front-end Automated TestingFront-end Automated Testing
Front-end Automated Testing
Ruben Teijeiro
 
Frontend testing with Codeception
Frontend testing with CodeceptionFrontend testing with Codeception
Frontend testing with Codeception
Christian Keuerleber
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
Nicholas Zakas
 
Code ceptioninstallation
Code ceptioninstallationCode ceptioninstallation
Code ceptioninstallation
Andrii Lagovskiy
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
Eric Wendelin
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With Xdebug
Mark Niebergall
 
Testing in go
Testing in goTesting in go
Testing in go
Eduardo Felipe Ewert Bonet
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
Seth McLaughlin
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
Gavin Pickin
 
CommandBox & ForgeBox Package Management
CommandBox & ForgeBox Package ManagementCommandBox & ForgeBox Package Management
CommandBox & ForgeBox Package Management
Ortus Solutions, Corp
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Faichi Solutions
 
[CLIW] Web testing
[CLIW] Web testing[CLIW] Web testing
[CLIW] Web testing
Bogdan Gaza
 
Test your Javascript! v1.1
Test your Javascript! v1.1Test your Javascript! v1.1
Test your Javascript! v1.1
Eric Wendelin
 
Getting By Without "QA"
Getting By Without "QA"Getting By Without "QA"
Getting By Without "QA"
Dave King
 
Debugging and Profiling in WordPress: What is My Site Doing?
Debugging and Profiling in WordPress: What is My Site Doing?Debugging and Profiling in WordPress: What is My Site Doing?
Debugging and Profiling in WordPress: What is My Site Doing?
Peter Baylies
 
淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)淺談 Geb 網站自動化測試(JCConf 2014)
淺談 Geb 網站自動化測試(JCConf 2014)
Kyle Lin
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
Neil Crosby
 
Front-end Automated Testing
Front-end Automated TestingFront-end Automated Testing
Front-end Automated Testing
Ruben Teijeiro
 
High Performance JavaScript 2011
High Performance JavaScript 2011High Performance JavaScript 2011
High Performance JavaScript 2011
Nicholas Zakas
 
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API
Gavin Pickin
 
JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!JavaScript + Jenkins = Winning!
JavaScript + Jenkins = Winning!
Eric Wendelin
 
Debugging PHP With Xdebug
Debugging PHP With XdebugDebugging PHP With Xdebug
Debugging PHP With Xdebug
Mark Niebergall
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
Dev9Com
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
Seth McLaughlin
 
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLEAN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
AN EXERCISE IN CLEANER CODE - FROM LEGACY TO MAINTAINABLE
Gavin Pickin
 
CommandBox & ForgeBox Package Management
CommandBox & ForgeBox Package ManagementCommandBox & ForgeBox Package Management
CommandBox & ForgeBox Package Management
Ortus Solutions, Corp
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Faichi Solutions
 
[CLIW] Web testing
[CLIW] Web testing[CLIW] Web testing
[CLIW] Web testing
Bogdan Gaza
 
Test your Javascript! v1.1
Test your Javascript! v1.1Test your Javascript! v1.1
Test your Javascript! v1.1
Eric Wendelin
 
Getting By Without "QA"
Getting By Without "QA"Getting By Without "QA"
Getting By Without "QA"
Dave King
 
Debugging and Profiling in WordPress: What is My Site Doing?
Debugging and Profiling in WordPress: What is My Site Doing?Debugging and Profiling in WordPress: What is My Site Doing?
Debugging and Profiling in WordPress: What is My Site Doing?
Peter Baylies
 

Similar to Autotests introduction - Codeception + PHP Basics (20)

Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
SusannSgorzaly
 
Codeception
CodeceptionCodeception
Codeception
少東 張
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
Andrei Burian
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Engineor
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Sauce Labs
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Getting Started With Selenium
Getting Started With SeleniumGetting Started With Selenium
Getting Started With Selenium
SmartBear
 
Awesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave HaeffnerAwesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave Haeffner
Sauce Labs
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
Jeremy Coates
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
Florent Batard
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
AOE
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
 
Pdx Se Intro To Se
Pdx Se Intro To SePdx Se Intro To Se
Pdx Se Intro To Se
An Doan
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeception
buddhieash
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
Codeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira FinanceCodeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira Finance
Fachrul Choliluddin
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Selenium Ide Tutorial
Selenium Ide TutorialSelenium Ide Tutorial
Selenium Ide Tutorial
metapix
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
SusannSgorzaly
 
Codeception presentation
Codeception presentationCodeception presentation
Codeception presentation
Andrei Burian
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup EdinburghAcceptance testing in php with Codeception - Techmeetup Edinburgh
Acceptance testing in php with Codeception - Techmeetup Edinburgh
Engineor
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
Sauce Labs
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Getting Started With Selenium
Getting Started With SeleniumGetting Started With Selenium
Getting Started With Selenium
SmartBear
 
Awesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave HaeffnerAwesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave Haeffner
Sauce Labs
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
Jeremy Coates
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
Florent Batard
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
AOE
 
How To Use Selenium Successfully
How To Use Selenium SuccessfullyHow To Use Selenium Successfully
How To Use Selenium Successfully
Dave Haeffner
 
Pdx Se Intro To Se
Pdx Se Intro To SePdx Se Intro To Se
Pdx Se Intro To Se
An Doan
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeception
buddhieash
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
Applitools
 
Codeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira FinanceCodeception @ New Business Dept Adira Finance
Codeception @ New Business Dept Adira Finance
Fachrul Choliluddin
 
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Workshop: Functional testing made easy with PHPUnit & Selenium (phpCE Poland,...
Ondřej Machulda
 
Selenium Ide Tutorial
Selenium Ide TutorialSelenium Ide Tutorial
Selenium Ide Tutorial
metapix
 
Ad

Recently uploaded (20)

IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | CertivoAI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdfWhat is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Making significant Software Architecture decisions
Making significant Software Architecture decisionsMaking significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptxMOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptxMicrosoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Open Source Software Development Methods
Open Source Software Development MethodsOpen Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdfHow to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - IntroductionIBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | CertivoAI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdfWhat is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
wAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptxwAIred_RabobankIgniteSession_12062025.pptx
wAIred_RabobankIgniteSession_12062025.pptx
SimonedeGijt
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Making significant Software Architecture decisions
Making significant Software Architecture decisionsMaking significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptxMOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptxMicrosoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Open Source Software Development Methods
Open Source Software Development MethodsOpen Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdfHow to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Ad

Autotests introduction - Codeception + PHP Basics

  • 2. Agenda ● What is good auto QA test ● Codeception ○ Settings - YAML ○ Test code ○ Test organisation ○ Good practices ● Selenium, BrowserStack, PhpBrowser ● Jenkins ● And fun
  • 3. What is good auto QA test?
  • 4. Autotest is 1. Necessary 2. Stable 3. Simple 4. ...
  • 6. How we can run needed tests? 1. By file name or folder -> ./codecept run tests/acceptance/asap 2. By groups -> ./codecept run -g request -g phones P.S. in documentation we see -> php codecept run -> ./codecept run do the same thing
  • 7. How to run tests on iOS or other platforms?
  • 8. Settings tests/acceptance.suite.yml In config section: Default settings for all envs So by default we are using: WebDriver at BrowserStack Windows 10 + Chrome
  • 9. Custom env Envs: nojs: with PhpBrowser Testing asap.com project local_asap: WebDriver Running at our Selenium
  • 11. Env (environment) Is used for: 1. Testing host - run tests for prod, stage, or dev 2. Testing platform - run tests for iOS, Windows, Linux; Chrome or Safari 3. Testing resolution - run tests for laptops, full hd or 4K monitors 4. Tests executor - local Selenium, Selenium Grid, BrowserStack or PhpBrowser 5. Tests misc - GIFs of errors, Allure reporting...
  • 12. Running tests for needed env ./codecept run acceptance --env local_asap
  • 13. Combining all ./codecept run acceptance --env local_asap -g request --debug P.S. --debug option for seeing all steps and additional information, but this make tests slower
  • 14. Jenkins Is tool that executes tests (do the job) for you and where you can find test outputs http://192.168.3.85/view/ASAP Login: manager Pass: xxxxxxx701
  • 15. Create Jenkins job 1. Создать Item 2. Copy from -> use most green job name 3. Configure job at “Настройки” -> “Сборка” -> Exec command 4. Edit command where line ./codecept run …
  • 16. Job :( cd /home/gitlab-runner/TravelFrontendSeleniumTestingSystem/ git pull ./codecept run acceptance --env local_asap -g disclaimers
  • 18. So, we can execute tests, how to write them?
  • 19. Methodology ● Get the data from test subject ● Compare actual data with expected
  • 20. Test are written in PHP So we will use some PHP
  • 22. How can we get the test subject, if it is not on current page??? 1. Navigate to the page -> $I->amOnPage('/about'); 2. Click -> $I->click('#nav a'); 3. Fill forms -> $I->fillField('.user[email]','[email protected]'); 4. Ask developers for help
  • 23. What the heck just happened with $I-click()? It is CSS selector, but there is many options More info: https://blog.mozilla.org/webqa/2013/09/26/writing-reliable-locators- for-selenium-and-webdriver-tests/
  • 24. Comparing actual with expected 1. $I->see('Thank you'); $I->dontSee('Please enter email'); 2. $I->seeElement('.success'); $I->dontSeeElement('.error'); 3. $I->seeInCurrentUrl('/result-page'); $I->dontSeeInCurrentUrl('/oops'); 4. Many other helper methods
  • 25. But this is not so simple There is problems - animation, network, designers and developers… Some elements can lagg time to time or be not visible, but we need to autotest it 1. $I->wait(10); 2. $I->waitForElementVisible('.success', 10); 3. $I->waitForText('Success, we will contact you shortly', 30); 4. $I->waitForAllScriptsLoaded($I); 5. $I->scrollTo('footer');
  • 26. Sometimes we need only to get data 1. $aLinkText = $I->grabMultiple('a'); 2. $aLinks = $I->grabMultiple('a', 'href'); 3. $url = $I->grabFromCurrentUrl(); 4. $heading = $I->grabTextFrom('h1')
  • 27. There is a lot of needed methods http://codeception.com/docs/modules/WebDriver#Actions You can also develop your common methods and put them here: https://gitlab.dyninno.net/qa- automation/TravelFrontendSeleniumTestingSystem/blob/master/tests/_support/ WebHelper.php
  • 28. But tests are not so simple, how about conditions? https://clevertechie.com/php/5/php-if-else-statement
  • 30. How we can store expected results? https://clevertechie.com/php/3/php-array
  • 31. How we can loop an array? https://clevertechie.com/php/8/php-foreach-loop
  • 32. How about other useful functions? 1. count($elements); 2. strpos($airlineLogoHref, 'airlineNotFound') !== FALSE; 3. str_replace('-', ' ', $url); 4. preg_match('/[^A-Za-z0-9]/i', $onlyText); 5. empty($textOrArray); 6. date('m/d/Y', strtotime('+7 day'));