SlideShare a Scribd company logo
Browser automation and testing API
Vishal D. Kariya
What You’ll Learn?
▪ Introduction
▪ Installation and configuration
▪ Getting started
▪ Interacting with elements
▪ Page
▪ Component
▪ Continuous Integration
▪ Questions
Introduction
▪ What is dusk?
▪ Dusk is an expressive, easy-to-use browser automation and testing tool.
▪ Dusk was first time introduced in Laravel 5.4.
▪ Current version of dusk is 2.0.7 with Laravel 5.5
▪ History
▪ Jeffrey Way's Integrated package was brought into the core in Laravel 5.1.
▪ Simple tests with visit() and see()
▪ What if any of your application's functionality relied on JavaScript, though? Sorry. Out of
luck!
What we can do with full browser automation?
▪ Simulate real browsers
▪ Test/Work with Async JavaScript applications
▪ Automate testing that applications work as expected
▪ Replace repetitive manual QA with automation
▪ Run tests in multiple browsers
▪ Advanced Web Scraping (i.e.. filtered reports)
PHP Tools in Browser Automation
▪ Behat / Mink
▪ PHP-Webdriver (https://github.com/facebook/php-webdriver)
▪ Codeception
▪ Laravel Dusk
▪ Steward
▪ Others
Why PHP for Web Browser Automation?
▪ Developers don’t have to learn a new language (good/bad)
▪ More participation in teams already writing PHP
▪ Reduce cross-language mental overhead
▪ Browser Automation can be closer to your domain logic
▪ PHP-Webdriver is Good Enough™ (and backed by Facebook)
Dusk Installation & Configuration
▪ What is required?
▪ Doesn’t require JDK or Selenium (you can still use them)
▪ Uses standalone ChromeDriver
▪ Xvfb
▪ Chrome Browser
Dusk Installation & Configuration
▪ Installation Steps:
1. Run command :
composer require --dev laravel/dusk
2. Register Dusk Service Provider:
3. Run Install command:
php artisan dusk:install
Getting Started
1. Run command :
composer require --dev laravel/dusk
2. Register Dusk Service Provider:
3. Run Install command:
php artisan dusk:install
4. Create Test:
php artisan dusk:make LoginTest
5. Run:
php artisan dusk
Interacting with elements
Interacting with elements: Links / Events
Interacting with elements: Form Inputs
Interacting with elements: waiting
Page
php artisan dusk:page Login
php artisan dusk:page HomePage
Navigating to Pages
Page Method
Components
Components
Using Components
Continuous Integration
▪ Travis CI
▪ Circle CI (1.2, 2.0)
▪ Codeship
https://laravel.com/docs/5.5/dusk#continuous-integration
Any Questions?
Thank You!

More Related Content

PDF
Angular - Chapter 7 - HTTP Services
PDF
Writing REST APIs with OpenAPI and Swagger Ada
PDF
Kogito: cloud native business automation
PPTX
Angular 2.0 forms
KEY
Web API Basics
PPTX
PPTX
Kelompok 6 mc murry 15
PPTX
web development.pptx
Angular - Chapter 7 - HTTP Services
Writing REST APIs with OpenAPI and Swagger Ada
Kogito: cloud native business automation
Angular 2.0 forms
Web API Basics
Kelompok 6 mc murry 15
web development.pptx

What's hot (20)

PPT
Angular Introduction By Surekha Gadkari
PDF
Angular
PPTX
Node.js Express
PPT
Ppt stoikiometri larutan
PDF
77190036 gas-ideal-sulies
PDF
Introduction to xcode
PDF
Angular Dependency Injection
PPTX
Angular modules in depth
PDF
Swagger / Quick Start Guide
PPTX
AROMATISITAS BENZENA & BENZENA TERSUBSTITUSI
PPT
Web servers (l6)
PDF
Meetup React Sanca - 29/11/18 - React Testing
PPTX
Design Beautiful REST + JSON APIs
PPTX
identifikasi alkohol,anhidrida, asil halida
PDF
React + Redux. Best practices
PPTX
Angular 2.0 Pipes
PPTX
Introducing Swagger
PDF
How Browsers Work
PDF
Présentation Angular 2
PPTX
Angular tutorial
Angular Introduction By Surekha Gadkari
Angular
Node.js Express
Ppt stoikiometri larutan
77190036 gas-ideal-sulies
Introduction to xcode
Angular Dependency Injection
Angular modules in depth
Swagger / Quick Start Guide
AROMATISITAS BENZENA & BENZENA TERSUBSTITUSI
Web servers (l6)
Meetup React Sanca - 29/11/18 - React Testing
Design Beautiful REST + JSON APIs
identifikasi alkohol,anhidrida, asil halida
React + Redux. Best practices
Angular 2.0 Pipes
Introducing Swagger
How Browsers Work
Présentation Angular 2
Angular tutorial
Ad

Similar to Laravel Dusk (20)

PDF
Laravel Forge: Hello World to Hello Production
PDF
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
PDF
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
PPTX
Flask and Introduction to web frameworks
PDF
Selenium Beyond The Nitty Gritty of Programming Languages
PPTX
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
PPTX
North American Collaboration Summit 2018 - SharePoint Framework, Angular and ...
PPTX
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
PDF
What is Laravel and Why Should You Choose it for Your Next Project?
PPTX
Selenium Introduction and IDE
PDF
Using Delphi as a no code development environment
PDF
Laravel CI / CD in Azure Web Apps - Global Azure Bootcamp Jakarta
PDF
All the Laravel Things – Up & Running to Making $$
PDF
Make web as webapp
PPTX
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
PPT
Open Source Web Technologies
PDF
Develop & Deploy your Laravel Application on Google Cloud Platforms
PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
PPT
Ria Applications And PHP
PPTX
Automated ui-testing
Laravel Forge: Hello World to Hello Production
ZendCon 2015 - Laravel Forge: Hello World to Hello Production
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
Flask and Introduction to web frameworks
Selenium Beyond The Nitty Gritty of Programming Languages
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
North American Collaboration Summit 2018 - SharePoint Framework, Angular and ...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
What is Laravel and Why Should You Choose it for Your Next Project?
Selenium Introduction and IDE
Using Delphi as a no code development environment
Laravel CI / CD in Azure Web Apps - Global Azure Bootcamp Jakarta
All the Laravel Things – Up & Running to Making $$
Make web as webapp
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
Open Source Web Technologies
Develop & Deploy your Laravel Application on Google Cloud Platforms
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Ria Applications And PHP
Automated ui-testing
Ad

Recently uploaded (20)

PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPTX
t_and_OpenAI_Combined_two_pressentations
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
DOC
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
PPTX
Digital Literacy And Online Safety on internet
PPTX
E -tech empowerment technologies PowerPoint
PPTX
Database Information System - Management Information System
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
Introduction to the IoT system, how the IoT system works
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPT
Ethics in Information System - Management Information System
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
Funds Management Learning Material for Beg
PPTX
Introduction to cybersecurity and digital nettiquette
PPTX
newyork.pptxirantrafgshenepalchinachinane
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Module 1 - Cyber Law and Ethics 101.pptx
Unit-1 introduction to cyber security discuss about how to secure a system
Mathew Digital SEO Checklist Guidlines 2025
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
t_and_OpenAI_Combined_two_pressentations
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
Digital Literacy And Online Safety on internet
E -tech empowerment technologies PowerPoint
Database Information System - Management Information System
presentation_pfe-universite-molay-seltan.pptx
Introduction to the IoT system, how the IoT system works
Design_with_Watersergyerge45hrbgre4top (1).ppt
Ethics in Information System - Management Information System
Sims 4 Historia para lo sims 4 para jugar
Funds Management Learning Material for Beg
Introduction to cybersecurity and digital nettiquette
newyork.pptxirantrafgshenepalchinachinane

Laravel Dusk

  • 1. Browser automation and testing API Vishal D. Kariya
  • 2. What You’ll Learn? ▪ Introduction ▪ Installation and configuration ▪ Getting started ▪ Interacting with elements ▪ Page ▪ Component ▪ Continuous Integration ▪ Questions
  • 3. Introduction ▪ What is dusk? ▪ Dusk is an expressive, easy-to-use browser automation and testing tool. ▪ Dusk was first time introduced in Laravel 5.4. ▪ Current version of dusk is 2.0.7 with Laravel 5.5 ▪ History ▪ Jeffrey Way's Integrated package was brought into the core in Laravel 5.1. ▪ Simple tests with visit() and see() ▪ What if any of your application's functionality relied on JavaScript, though? Sorry. Out of luck!
  • 4. What we can do with full browser automation? ▪ Simulate real browsers ▪ Test/Work with Async JavaScript applications ▪ Automate testing that applications work as expected ▪ Replace repetitive manual QA with automation ▪ Run tests in multiple browsers ▪ Advanced Web Scraping (i.e.. filtered reports)
  • 5. PHP Tools in Browser Automation ▪ Behat / Mink ▪ PHP-Webdriver (https://github.com/facebook/php-webdriver) ▪ Codeception ▪ Laravel Dusk ▪ Steward ▪ Others
  • 6. Why PHP for Web Browser Automation? ▪ Developers don’t have to learn a new language (good/bad) ▪ More participation in teams already writing PHP ▪ Reduce cross-language mental overhead ▪ Browser Automation can be closer to your domain logic ▪ PHP-Webdriver is Good Enough™ (and backed by Facebook)
  • 7. Dusk Installation & Configuration ▪ What is required? ▪ Doesn’t require JDK or Selenium (you can still use them) ▪ Uses standalone ChromeDriver ▪ Xvfb ▪ Chrome Browser
  • 8. Dusk Installation & Configuration ▪ Installation Steps: 1. Run command : composer require --dev laravel/dusk 2. Register Dusk Service Provider: 3. Run Install command: php artisan dusk:install
  • 9. Getting Started 1. Run command : composer require --dev laravel/dusk 2. Register Dusk Service Provider: 3. Run Install command: php artisan dusk:install 4. Create Test: php artisan dusk:make LoginTest 5. Run: php artisan dusk
  • 11. Interacting with elements: Links / Events
  • 14. Page php artisan dusk:page Login php artisan dusk:page HomePage
  • 20. Continuous Integration ▪ Travis CI ▪ Circle CI (1.2, 2.0) ▪ Codeship https://laravel.com/docs/5.5/dusk#continuous-integration