SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Brownie
                  Masaki Nakagawa / @ikasam_a

                           Yokohama.pm #8
                 (yokohama.pm.org/2011/10/yokohamapm-8.html)




2011   11   18
YAPC::Asia Tokyo 2011
                       yapcasia.org/2011/




2011   11   18
Perl Testing
                       Consideration
                          (seen from other languages)


                               Masaki Nakagawa

                 YAPC::Asia Tokyo 2011 (yapcasia.org/2011/talk/80)



2011   11   18
Rails Testing
                 •   Perspective
                     •   UnitTest, End-to-End

                 •   Frameworks
                     •   Test::Unit (+ Shoulda), RSpec, Cucumber

                 •   Browser Integration
                     •   Capybara (rack-test, Selenium, Envjs, ...)

                 •   Test Double
                     •   rspec-mocks, rr, WebMock

2011   11   18
Weakness
                 • Expectation and Verification
                  • vs. rr, rspec-mocks, mocha, ...
                 • Browser Integration API
                  • vs. Capybara, Webrat, ...
                 • Naming of Test Double modules
                  • Test::Mock::Guard is “Stub” module
2011   11   18
Comparision
                 • Pros
                  • TAP-based Test Description
                  • Many Helpful Modules
                 • Cons
                  • Non-Uniform Browser Integration
                  • Poor Expectation and Verification
2011   11   18
Capybara
                 github.com/jnicklas/capybara




2011   11   18
Capybara simulates how a real user would
                     interact with a web application.

                 It is agnostic about the driver running your
                 tests and currently comes with Rack::Test
                         and Selenium support built in.




2011   11   18
within("#session") do
     fill_in 'Login', :with => 'user@example.com'
     fill_in 'Password', :with => 'password'
   end
   click_link 'Sign in'




2011   11   18
The DSL

2011   11   18
Drivers
                     RackTest
                     Selenium
                     HtmlUnit
                 WebKit (QtWebKit)
                       Envjs
                    Zombie.js


2011   11   18
Brownie
                 github.com/masaki/Brownie




2011   11   18
Inspired by Capybara


2011   11   18
OO Style
   my $session = Brownie::Session->new;

   $session->visit(‘http://example.com’);

   $session->fill_in(Login => 'user@example.com');
   $session->fill_in(Password => 'password');
   $session->click_link('Sign in');




2011   11   18
DSL Style (Not yet)
   use Brownie::DSL;

   visit ‘http://example.com/’;

   fill_in Login => 'user@example.com';
   fill_in Password => 'password';
   click_link 'Sign in';




2011   11   18
Drivers
                 Selenium (Selenium::Remote::Driver)
                   Mechanize (WWW::Mechanize)

                    HtmlUnit (WWW::HtmlUnit)




2011   11   18
Vocabulary
                  visit, current_url, current_path,
                 status_code, response_headers,
                       title, source, screenshot,
                 click_link, click_button, click_on,
                   fill_in, choose, check, uncheck,
                     select, unselect, attach_file,
                  execute_script, evaluate_script,
                    find_element, find_elements,

2011   11   18
DEMO

2011   11   18
Future

                 • Mechanize Driver (!!!)
                 • Scoping (within “selector” => sub { ... })
                 • Embedded Selenium Server      (Alien::SeleniumRC)

                 • HtmlUnit Driver

2011   11   18
Patches and Collaborators
                       Welcome !!!



2011   11   18
Thank you



2011   11   18

Contenu connexe

Tendances

Continuous inspection with Sonar
Continuous inspection with SonarContinuous inspection with Sonar
Continuous inspection with Sonar
gaudol
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
Maveryx
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
Iosif Itkin
 

Tendances (20)

Integration Testing in Python
Integration Testing in PythonIntegration Testing in Python
Integration Testing in Python
 
API Testing following the Test Pyramid
API Testing following the Test PyramidAPI Testing following the Test Pyramid
API Testing following the Test Pyramid
 
Continuous inspection with Sonar
Continuous inspection with SonarContinuous inspection with Sonar
Continuous inspection with Sonar
 
When develpment met test(shift left testing)
When develpment met test(shift left testing)When develpment met test(shift left testing)
When develpment met test(shift left testing)
 
Treat your servers like your Ruby App: Infrastructure as Code
Treat your servers like your Ruby App: Infrastructure as CodeTreat your servers like your Ruby App: Infrastructure as Code
Treat your servers like your Ruby App: Infrastructure as Code
 
Mobile Apps development best practices. TDD, CI, CD
Mobile Apps development best practices. TDD, CI, CDMobile Apps development best practices. TDD, CI, CD
Mobile Apps development best practices. TDD, CI, CD
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
 
open sta testing Certification
open sta testing Certificationopen sta testing Certification
open sta testing Certification
 
FIT and JBehave - Good, Bad and Ugly
FIT and JBehave - Good, Bad and UglyFIT and JBehave - Good, Bad and Ugly
FIT and JBehave - Good, Bad and Ugly
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)Cerberus : Framework for Manual and Automated Testing (Web Application)
Cerberus : Framework for Manual and Automated Testing (Web Application)
 
A journey with Target Platforms
A journey with Target PlatformsA journey with Target Platforms
A journey with Target Platforms
 
Real Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrapReal Java EE Testing with Arquillian and ShrinkWrap
Real Java EE Testing with Arquillian and ShrinkWrap
 
Exactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in KostromaExactpro Systems for KSTU Students in Kostroma
Exactpro Systems for KSTU Students in Kostroma
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Realtime selenium interview questions
Realtime selenium interview questionsRealtime selenium interview questions
Realtime selenium interview questions
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Model-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelModel-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next Level
 
Test driven development_continuous_integration
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
 
Unit Testing in Swift
Unit Testing in SwiftUnit Testing in Swift
Unit Testing in Swift
 

Similaire à Brownie

Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
Vlad Maniak
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Tools
guest05c09d
 
Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02
Kdeepapal Mishra
 

Similaire à Brownie (20)

Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Selenium
SeleniumSelenium
Selenium
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design DocumentPushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
 
Play ja kansai
Play ja kansaiPlay ja kansai
Play ja kansai
 
Selenium withnet
Selenium withnetSelenium withnet
Selenium withnet
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Rails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & ToolsRails Application Optimization Techniques & Tools
Rails Application Optimization Techniques & Tools
 
Basic Selenium Training
Basic Selenium TrainingBasic Selenium Training
Basic Selenium Training
 
Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02Selenium digitalinfobytes-120829005812-phpapp02
Selenium digitalinfobytes-120829005812-phpapp02
 
AWValuePitch, 7_12
AWValuePitch, 7_12AWValuePitch, 7_12
AWValuePitch, 7_12
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts Build Java Web Application Using Apache Struts
Build Java Web Application Using Apache Struts
 
Isomorphic JavaScript with Nashorn
Isomorphic JavaScript with NashornIsomorphic JavaScript with Nashorn
Isomorphic JavaScript with Nashorn
 

Plus de Masaki Nakagawa

2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform
Masaki Nakagawa
 

Plus de Masaki Nakagawa (10)

YAPCと俺 (吉祥寺.pm #17)
YAPCと俺 (吉祥寺.pm #17)YAPCと俺 (吉祥寺.pm #17)
YAPCと俺 (吉祥寺.pm #17)
 
10年モノ熟成Perlとの付き合い方
10年モノ熟成Perlとの付き合い方10年モノ熟成Perlとの付き合い方
10年モノ熟成Perlとの付き合い方
 
レシピブログのサービス設計と今後の展望
レシピブログのサービス設計と今後の展望レシピブログのサービス設計と今後の展望
レシピブログのサービス設計と今後の展望
 
DeNAが取り組む Software Engineer in Test
DeNAが取り組む Software Engineer in TestDeNAが取り組む Software Engineer in Test
DeNAが取り組む Software Engineer in Test
 
5minQues - SWET近況報告
5minQues - SWET近況報告5minQues - SWET近況報告
5minQues - SWET近況報告
 
WebサービスのソフトウェアQAと自動テスト戦略
WebサービスのソフトウェアQAと自動テスト戦略WebサービスのソフトウェアQAと自動テスト戦略
WebサービスのソフトウェアQAと自動テスト戦略
 
2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform2014-04-22 Ques #4 Automation Testing of Mobage Platform
2014-04-22 Ques #4 Automation Testing of Mobage Platform
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using Perl
 
Carton について何か話す
Carton について何か話すCarton について何か話す
Carton について何か話す
 
As an Test Engineer
As an Test EngineerAs an Test Engineer
As an Test Engineer
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Brownie

  • 1. Brownie Masaki Nakagawa / @ikasam_a Yokohama.pm #8 (yokohama.pm.org/2011/10/yokohamapm-8.html) 2011 11 18
  • 2. YAPC::Asia Tokyo 2011 yapcasia.org/2011/ 2011 11 18
  • 3. Perl Testing Consideration (seen from other languages) Masaki Nakagawa YAPC::Asia Tokyo 2011 (yapcasia.org/2011/talk/80) 2011 11 18
  • 4. Rails Testing • Perspective • UnitTest, End-to-End • Frameworks • Test::Unit (+ Shoulda), RSpec, Cucumber • Browser Integration • Capybara (rack-test, Selenium, Envjs, ...) • Test Double • rspec-mocks, rr, WebMock 2011 11 18
  • 5. Weakness • Expectation and Verification • vs. rr, rspec-mocks, mocha, ... • Browser Integration API • vs. Capybara, Webrat, ... • Naming of Test Double modules • Test::Mock::Guard is “Stub” module 2011 11 18
  • 6. Comparision • Pros • TAP-based Test Description • Many Helpful Modules • Cons • Non-Uniform Browser Integration • Poor Expectation and Verification 2011 11 18
  • 7. Capybara github.com/jnicklas/capybara 2011 11 18
  • 8. Capybara simulates how a real user would interact with a web application. It is agnostic about the driver running your tests and currently comes with Rack::Test and Selenium support built in. 2011 11 18
  • 9. within("#session") do fill_in 'Login', :with => 'user@example.com' fill_in 'Password', :with => 'password' end click_link 'Sign in' 2011 11 18
  • 10. The DSL 2011 11 18
  • 11. Drivers RackTest Selenium HtmlUnit WebKit (QtWebKit) Envjs Zombie.js 2011 11 18
  • 12. Brownie github.com/masaki/Brownie 2011 11 18
  • 14. OO Style my $session = Brownie::Session->new; $session->visit(‘http://example.com’); $session->fill_in(Login => 'user@example.com'); $session->fill_in(Password => 'password'); $session->click_link('Sign in'); 2011 11 18
  • 15. DSL Style (Not yet) use Brownie::DSL; visit ‘http://example.com/’; fill_in Login => 'user@example.com'; fill_in Password => 'password'; click_link 'Sign in'; 2011 11 18
  • 16. Drivers Selenium (Selenium::Remote::Driver) Mechanize (WWW::Mechanize) HtmlUnit (WWW::HtmlUnit) 2011 11 18
  • 17. Vocabulary visit, current_url, current_path, status_code, response_headers, title, source, screenshot, click_link, click_button, click_on, fill_in, choose, check, uncheck, select, unselect, attach_file, execute_script, evaluate_script, find_element, find_elements, 2011 11 18
  • 18. DEMO 2011 11 18
  • 19. Future • Mechanize Driver (!!!) • Scoping (within “selector” => sub { ... }) • Embedded Selenium Server (Alien::SeleniumRC) • HtmlUnit Driver 2011 11 18
  • 20. Patches and Collaborators Welcome !!! 2011 11 18
  • 21. Thank you 2011 11 18