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
Brownie
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Masaki Nakagawa
November 18, 2011
Programming
1
140
Brownie
Brownie - Browser integration framework inspired by Capybara / Yokohama.pm #8
Masaki Nakagawa
November 18, 2011
Tweet
Share
More Decks by Masaki Nakagawa
See All by Masaki Nakagawa
yapc-tokyo-2019-over-10years-perl-after-story
ikasam_a
0
430
Perl Testing Consideration
ikasam_a
3
160
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
360
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.7k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.4k
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.3k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.6k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
170
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
280
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.8k
Implementation Patterns
denyspoltorak
0
270
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
360
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
1.9k
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
88
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
sira's awesome portfolio website redesign presentation
elsirapls
0
140
Site-Speed That Sticks
csswizardry
13
1k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
71
Deep Space Network (abreviated)
tonyrice
0
38
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
170
Transcript
Brownie Masaki Nakagawa / @ikasam_a Yokohama.pm #8 (yokohama.pm.org/2011/10/yokohamapm-8.html) 201111݄18༵ۚ
YAPC::Asia Tokyo 2011 yapcasia.org/2011/ 201111݄18༵ۚ
Perl Testing Consideration (seen from other languages) Masaki Nakagawa YAPC::Asia
Tokyo 2011 (yapcasia.org/2011/talk/80) 201111݄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 201111݄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 201111݄18༵ۚ
Comparision • Pros • TAP-based Test Description • Many Helpful
Modules • Cons • Non-Uniform Browser Integration • Poor Expectation and Verification 201111݄18༵ۚ
Capybara github.com/jnicklas/capybara 201111݄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. 201111݄18༵ۚ
within("#session") do fill_in 'Login', :with => '
[email protected]
' fill_in 'Password', :with
=> 'password' end click_link 'Sign in' 201111݄18༵ۚ
The DSL 201111݄18༵ۚ
Drivers RackTest Selenium HtmlUnit WebKit (QtWebKit) Envjs Zombie.js 201111݄18༵ۚ
Brownie github.com/masaki/Brownie 201111݄18༵ۚ
Inspired by Capybara 201111݄18༵ۚ
my $session = Brownie::Session->new; $session->visit(‘http://example.com’); $session->fill_in(Login => '
[email protected]
'); $session->fill_in(Password =>
'password'); $session->click_link('Sign in'); OO Style 201111݄18༵ۚ
DSL Style (Not yet) use Brownie::DSL; visit ‘http://example.com/’; fill_in Login
=> '
[email protected]
'; fill_in Password => 'password'; click_link 'Sign in'; 201111݄18༵ۚ
Drivers Selenium (Selenium::Remote::Driver) Mechanize (WWW::Mechanize) HtmlUnit (WWW::HtmlUnit) 201111݄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, 201111݄18༵ۚ
DEMO 201111݄18༵ۚ
Future • Mechanize Driver (!!!) • Scoping (within “selector” =>
sub { ... }) • Embedded Selenium Server (Alien::SeleniumRC) • HtmlUnit Driver 201111݄18༵ۚ
Patches and Collaborators Welcome !!! 201111݄18༵ۚ
Thank you 201111݄18༵ۚ