Capybaras are the largest rodents in the world. They are related to guinea pigs, but are the size of a big dog or small pig. They live in South America, and they're pretty damn cute.
Capybara is also the name of a Ruby gem written by Jonas Nicklas. It helps you write integration tests for web apps by pretending to be a user with a web browser. It takes a black box approach to testing, letting you go to URLs, click links and buttons, fill in forms, and check that the rendered page contains what you think it should have in it.
This talk is about Embracing Capybara: how to understand Capybara, train it to do new tricks, and discipline it when it misbehaves.
10 Things CEOs Need to Know About Design Jason Putorti
Presentation first delivered at the 2010 Bessemer Cloud Conference introducing design concepts for non-designers, simple tactics to improve existing products, and strategies for success in product/experience design moving forward.
Thank you Dustin Curtis, Kim Goodwin, Jared Spool, Marc Gobé, Indi Young, Steve Krug, Robert Hoekman, Jr., Seth Godin, and Jesse James Garrett for content and inspiration.
Discover the Art of Manifestation to achieve your ideal lifestyle. The topics about introduction to manifestation, evidence of manifestation, ways to achieve manifestation..
We held the largest ever Virtual SlideShare Summit a week back, if you missed it here's your chance to hear from the experts once more on some of the takeaways on presentation design and SlideShare Marketing
The State of Sales & Marketing at the 50 Fastest-Growing B2B CompaniesMattermark
There’s a lot of information out there for sales and marketing professionals. In fact, as our friend Erik Devaney at Drift.com points out, a quick search of the term “sales and marketing advice” yields more than 90 million results on Google.
What’s more, there are tons of industry influencers who, on a regular basis, share their views on everything from content marketing and sales, to pricing and customer success. It’s a noisy conversation, and for many, a confusing one.
So, how do you make sense of it all?
By focusing on the sales and marketing efforts that actually produce results, not flash-in-the-pan engagement. But finding those results is a little challenging. That’s why we decided to put together our latest report with Drift.com, The State of Sales and Marketing at the 50 Fastest-Growing B2B Companies.
Using Mattermark data, we were able to identify the fifty high-growth companies in the U.S. and evaluate their marketing activities to understand which practices really moved the needle. In order to make the qualitative portion of our research more tangible, we evaluated each company on the list in light of how they approached content, customer communication, path to purchase, and pricing.
What we and the team at Drift.com discovered was surprising, to say the least.
This is a minimal concept you should consider for your PowerPoint slides in order to make them more engaging and exciting.
I work as a presentation designer and help speakers and marketers with their pitches. If you need help with any of these concepts, drop me an email and I will be happy to help.
10 Things CEOs Need to Know About Design Jason Putorti
Presentation first delivered at the 2010 Bessemer Cloud Conference introducing design concepts for non-designers, simple tactics to improve existing products, and strategies for success in product/experience design moving forward.
Thank you Dustin Curtis, Kim Goodwin, Jared Spool, Marc Gobé, Indi Young, Steve Krug, Robert Hoekman, Jr., Seth Godin, and Jesse James Garrett for content and inspiration.
Discover the Art of Manifestation to achieve your ideal lifestyle. The topics about introduction to manifestation, evidence of manifestation, ways to achieve manifestation..
We held the largest ever Virtual SlideShare Summit a week back, if you missed it here's your chance to hear from the experts once more on some of the takeaways on presentation design and SlideShare Marketing
The State of Sales & Marketing at the 50 Fastest-Growing B2B CompaniesMattermark
There’s a lot of information out there for sales and marketing professionals. In fact, as our friend Erik Devaney at Drift.com points out, a quick search of the term “sales and marketing advice” yields more than 90 million results on Google.
What’s more, there are tons of industry influencers who, on a regular basis, share their views on everything from content marketing and sales, to pricing and customer success. It’s a noisy conversation, and for many, a confusing one.
So, how do you make sense of it all?
By focusing on the sales and marketing efforts that actually produce results, not flash-in-the-pan engagement. But finding those results is a little challenging. That’s why we decided to put together our latest report with Drift.com, The State of Sales and Marketing at the 50 Fastest-Growing B2B Companies.
Using Mattermark data, we were able to identify the fifty high-growth companies in the U.S. and evaluate their marketing activities to understand which practices really moved the needle. In order to make the qualitative portion of our research more tangible, we evaluated each company on the list in light of how they approached content, customer communication, path to purchase, and pricing.
What we and the team at Drift.com discovered was surprising, to say the least.
This is a minimal concept you should consider for your PowerPoint slides in order to make them more engaging and exciting.
I work as a presentation designer and help speakers and marketers with their pitches. If you need help with any of these concepts, drop me an email and I will be happy to help.
Sex Sex Sex Sex Sex Sex
Sex, sexuality and sexual health. Peter Aggleton
Sex Sex Sex Sex Sex SexSex Sex Sex Sex Sex Sex
Sex Sex Sex Sex Sex Sex
Sex Sex Sex Sex Sex Sex
How to Pick the Price for Your Product by Amazon Product ManagerProduct School
Pricing is one of the most important skills a Product Manager needs to have. Whether it be pricing a a new product, service launch, pricing an upgrade or just thinking about price cuts to stay competitive. We talked about how top firms think about pricing, various pricing strategies, architecture and implementation.
Aditya Vikram, Product Manager at Amazon discussed the importance of pricing, pricing strategies, and price setting and architecture.
10 Ways Your Boss Kills Employee MotivationOfficevibe
It’s so hard to have engaged employees. It’s such a delicate thing to try and get right because employees can be fragile.
As a manager, you have to do everything in your power to make sure employees are happy and engaged at all times.
Usually, the problem is the boss, and not things like the company, mission statement, or co-workers.
If you know that your boss is the biggest problem, there are ten things that they do to kill motivation. If you’re a manager and you’re reading this, make sure you avoid these mistakes to ensure that your employees are engaged during work.
The secret to good leadership is to be authentic. Be honest with your staff.
Read more on Officevibe blog:
https://www.officevibe.com/blog/10-kill-employee-motivation
like us on Facebook!:
www.facebook.com/officevibe
Nasty girl, Janet Jackson, is a veteran of piercing. She claims that it was her septum piercing though, not her nipple or labia, that hurt the most.
Once upon a time Christina Aguilera had an array of dirrty piercings including her nipple and her vaj.
Lady Gaga debuted her new vagina piercing in New York City this week.
On September 7th, 1982, legendary 'Mad Man' David Ogilvy sent an internal memo to all agency employees, titled “How to Write”. Here are 10 hints to help how to write.
Discover The Top 10 Types Of Colleagues Around YouAnkur Tandon
The best part being with different colleagues is we learn a lot from them. Good or bad, sooner or later, better or best, we learn something unique from the different personalities working with and around us at our workplace. Read more interesting content, at www.thecareermuse.co.in - We intend to inform and inspire recruiters, job seekers and anyone with an interest in the workplace and HR technology.
Hope you enjoyed reading the Infographic.
Feel free to share your feedback with us at @CareerBuilderIn
Sometimes Cucumber isn't the right tool for acceptance testing in Rails. Capybara + RSpec makes for a lightweight and efficient testing framework when collaboration with non-technical stakeholders isn't an aim of your testing suite.
Rspec and Capybara Intro Tutorial at RailsConf 2013Brian Sam-Bodden
Behavior-Driven Development and Acceptance Testing are heavily intertwined and in many aspects are one and the same. Both focus on starting at the outer layers of your application by concentrating on what matter to users; behavior. In this session/workshop we'll talk about how testing can be used both for specifying your application yet to be develop expected behavior and as accurate, running documentation that can be used to validate your stakeholder's acceptance criteria. We'll talk about the different types of testing and do a few hands-on exercises to flesh out a Rails application with RSpec and Capybara.
What is the purpose of BDD and how it fits into the Agile development? If you ever wondered what are the benefits of BDD or why should you care about tools like Behat or PhpSpec, this talk will try to guide you through the reasoning and goals of modern Agile practices and tools in PHP.
Sex Sex Sex Sex Sex Sex
Sex, sexuality and sexual health. Peter Aggleton
Sex Sex Sex Sex Sex SexSex Sex Sex Sex Sex Sex
Sex Sex Sex Sex Sex Sex
Sex Sex Sex Sex Sex Sex
How to Pick the Price for Your Product by Amazon Product ManagerProduct School
Pricing is one of the most important skills a Product Manager needs to have. Whether it be pricing a a new product, service launch, pricing an upgrade or just thinking about price cuts to stay competitive. We talked about how top firms think about pricing, various pricing strategies, architecture and implementation.
Aditya Vikram, Product Manager at Amazon discussed the importance of pricing, pricing strategies, and price setting and architecture.
10 Ways Your Boss Kills Employee MotivationOfficevibe
It’s so hard to have engaged employees. It’s such a delicate thing to try and get right because employees can be fragile.
As a manager, you have to do everything in your power to make sure employees are happy and engaged at all times.
Usually, the problem is the boss, and not things like the company, mission statement, or co-workers.
If you know that your boss is the biggest problem, there are ten things that they do to kill motivation. If you’re a manager and you’re reading this, make sure you avoid these mistakes to ensure that your employees are engaged during work.
The secret to good leadership is to be authentic. Be honest with your staff.
Read more on Officevibe blog:
https://www.officevibe.com/blog/10-kill-employee-motivation
like us on Facebook!:
www.facebook.com/officevibe
Nasty girl, Janet Jackson, is a veteran of piercing. She claims that it was her septum piercing though, not her nipple or labia, that hurt the most.
Once upon a time Christina Aguilera had an array of dirrty piercings including her nipple and her vaj.
Lady Gaga debuted her new vagina piercing in New York City this week.
On September 7th, 1982, legendary 'Mad Man' David Ogilvy sent an internal memo to all agency employees, titled “How to Write”. Here are 10 hints to help how to write.
Discover The Top 10 Types Of Colleagues Around YouAnkur Tandon
The best part being with different colleagues is we learn a lot from them. Good or bad, sooner or later, better or best, we learn something unique from the different personalities working with and around us at our workplace. Read more interesting content, at www.thecareermuse.co.in - We intend to inform and inspire recruiters, job seekers and anyone with an interest in the workplace and HR technology.
Hope you enjoyed reading the Infographic.
Feel free to share your feedback with us at @CareerBuilderIn
Sometimes Cucumber isn't the right tool for acceptance testing in Rails. Capybara + RSpec makes for a lightweight and efficient testing framework when collaboration with non-technical stakeholders isn't an aim of your testing suite.
Rspec and Capybara Intro Tutorial at RailsConf 2013Brian Sam-Bodden
Behavior-Driven Development and Acceptance Testing are heavily intertwined and in many aspects are one and the same. Both focus on starting at the outer layers of your application by concentrating on what matter to users; behavior. In this session/workshop we'll talk about how testing can be used both for specifying your application yet to be develop expected behavior and as accurate, running documentation that can be used to validate your stakeholder's acceptance criteria. We'll talk about the different types of testing and do a few hands-on exercises to flesh out a Rails application with RSpec and Capybara.
What is the purpose of BDD and how it fits into the Agile development? If you ever wondered what are the benefits of BDD or why should you care about tools like Behat or PhpSpec, this talk will try to guide you through the reasoning and goals of modern Agile practices and tools in PHP.
“Can we integrate mobile, web and API testing into a single open-source automation framework? And, we only want all the test scripts to be written in human-readable language, we want them to be easily integrated to CI system. It’s quite a hard question, isn’t it?” If you or your organization also have the same question and still on trying to find solution for that. Then, we believe that this seminar is for you! At the seminar, we will cover the following topics:
The Need of Automation Testing Nowadays
How BDD Cuke and Ruby on Rails can help
A Universal Automation Framework: Mobile, Web, API and CI Integration
Zero to Sixty: AWS Elastic Beanstalk (DMG204) | AWS re:Invent 2013Amazon Web Services
AWS Elastic Beanstalk provides an easy way for you to quickly deploy and manage applications in the AWS cloud. In this Zero to Sixty session, accelerate your use of Elastic Beanstalk by learning how Nike and VTEX use several of its most powerful features. Through interactive demos and code samples for both Windows and Linux, this session teaches you how to achieve deployments with zero downtime, how to easily enable or disable application functionality via feature flags, and how to customize your Elastic Beanstalk environments with extensions. Demos and code samples are available to all session attendees.
Are you new to Elastic Beanstalk? Get up to speed for this session by first completing the 60-minute Fundamentals of Elastic Beanstalk lab in the Self Paced Lab Lounge.
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...Axway Appcelerator
JavaScript and Titanium's JavaScript Stylesheets would be the quickest way to develop native mobile applications if it weren't for CoffeeScript and Sass. This talk will show you how to speed up your dev cycles and use CoffeeScript and Sass not only to write code faster, but better organize your JavaScript and JSS.
Rails Antipatterns | Open Session with Chad Pytel Engine Yard
As developers worldwide have adopted the Ruby on Rails web framework, many have fallen victim to common mistakes that reduce code quality, performance, reliability, stability, scalability, and maintainability. Even experienced developers will find that they can reevaluate the work they've done and make it better.
In this session, Chad Pytel will provide an overview of some of these common mistakes as well as take questions from the audience and provide real-world advice. Bring your issues and get expert advice on how to bring your code in line with today's best practices.
Describes Outside-In development and Behvaiour Driven Development. Illustrates basic Cucumber usage within a Rails app and then goes over more advanced topics such as JS as web services.
SMX West 2020 - Leveraging Structured Data for Maximum EffectAbby Hamilton
After this session, you will be able to:
1. Understand how search engines render and see your content and extract structured data to power rich experiences
2. Discover tools and resources that can help you to easily generate and test structured markup
3. Increase the likelihood of you content displaying as rich-results, which have been found to increase click-through rate
4. Fully realize the role semantic markup plays in determining the searcher experience and what types of schema you should use for best results
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
13. Capybara is Patient
visit '/sessions/new'
within("#session") do
fill_in 'Login',
with: 'user@example.com'
fill_in 'Password',
with: 'password'
end
click_link 'Sign in'
expect(page).
to have_content 'Success'
Waits for page to load
14. Capybara is Patient
visit '/sessions/new'
within("#session") do
fill_in 'Login',
with: 'user@example.com'
fill_in 'Password',
with: 'password'
end
click_link 'Sign in'
Capybara.using_wait_time(60) do
expect(page).
to have_content 'Success'
end
Waits for page to load
15. Capybara is Patient
visit '/sessions/new'
within("#session") do
fill_in 'Login',
with: 'user@example.com'
fill_in 'Password',
with: 'password'
end
click_link 'Sign in'
expect(page).
to have_content 'Success',
wait: 60
Waits for page to load
16. Methods that Wait
•
•
•
•
find(selector), find_field, find_link, etc.
within(selector) (scoping)
has_selector?/has_no_selector? & assertions
form & link actions
• click_link/button
• fill_in
• check/uncheck, select, choose, etc.
24. Don’t Do This
Scenario: Searching for cats
Given I am on "/search"
When I fill in "input.search_text"
with "cats"
And I press "Search"
Then I should see "grumpy cat"
within "div.search-results"
25. Don’t Do This
“web_steps.rb is a terrible, terrible idea”
- Boring scenarios cats
Scenario: Searching for
- Brittle scenarios
Given I am - Where is my workflow?
on "/search"
When I fill in "input.search_text"
with "cats"
And I
“A step description
press "Search" contain
should never
regexen, CSS or
should XPath selectors” cat"
see "grumpy
Then I
within "div.search-results"
26. Better
Scenario: Searching for cats
Given I am on the search page
When I fill in "Search" with "cats"
And I press "Search"
Then I should see "grumpy cat"
within the search results
27. Best
Scenario: Searching for cats
When I search for "cats"
Then I should see "grumpy cat" within
the search results
28. Don’t Do This
When /^I search for "([^"]*)"$/
do |search_text|
visit "/search"
fill_in "input.search_text",
with: search_text
click_button "Search"
end
29. Better
When /^I search for "([^"]*)"$/
do |search_text|
search_page =
my_app.search_page
search_page.search_input.
fill_in search_text
search_page.search_button.click
end
32. Better
When /^I search for "([^"]*)"$/
do |search_text|
search_page =
my_app.search_page
search_page.search_input.
fill_in search_text
search_page.search_button.click
end
33. Best
When /^I search for "([^"]*)"$/
do |search_text|
my_app.search_for search_text
end
34. Don’t Do This
find(:css, "div.main div.sidebar
div.search div.advanced div.actions
button.submit").click
Failure/Error: find(:css, "div.main div.sidebar
div.search div.advanced div.actions button.submit").click
Capybara::ElementNotFound:
Unable to find css "div.main div.sidebar
div.search div.advanced div.actions button.submit"
37. Taking Screenshots
After do |scenario|
filename =
scenario.name.gsub(/W/, '_')
page.save_screenshot(
"target/reports/#{filename}.png")
end
!
http://git.io/capybarascreenshot
I’m going to talk about Embracing Capybara: how to understand Capybara, train it to do new tricks, and discipline it when it misbehaves.
First, show of hands…
OK keep them up…
Sometimes it just doesn’t do what you want it to do.
I work at Lonely Planet, on a fairly complex single-page app, and we use Capybara for our tests.
In fact, we use a lot of Capybaras.
Like, a whole herd of Capybaras running together in parallel.
We, too, have been bitten by our Capybaras.
We got through it, learned a lot, and now we can’t imagine living without our Capybara.
Capybaras are the largest rodents in the world. They are related to guinea pigs, but are the size of a big dog or small pig. They live in South America, and they’re pretty damn cute.
Capybara is also the name of a Ruby gem written by this guy, Jonas Nicklas. It helps you write integration tests for web apps by pretending to be a user with a web browser. It takes a black box approach to testing, letting you go to URLs, click links and buttons, fill in forms, and check that the rendered page contains what you think it should have in it.
It doesn’t replace test runners like RSpec, Cucumber and Minitest, it works with them. It has built-in integration with the most popular testing frameworks, but is test-framework agnostic.
Three parts:
Front end is a Ruby-based DSL for browsing the web: actions like visiting URLs, clicking links and buttons, interacting with forms, and querying for contents of the page.
Powering this is a flexible selector engine: supports CSS selectors, XPath, finding by content or form input labels.
On the back end, Capybara has pluggable drivers for various browsing engines. Out of the box, it supports RackTest and Selenium WebDriver.
RackTest is a headless, pure Ruby browser simulator. Very fast, no setup required, works everywhere, but doesn’t support JavaScript execution.
Selenium drives a real web browser: Firefox, Chrome, IE, etc. Executes JavaScript. Great for compatibility testing and JavaScript-heavy apps, but slow to run, and asynchronous execution can be difficult to understand.
Other options via gems: e.g., Poltergeist integrates with PhantomJS, a headless WebKit implementation.
Most people use Selenium WebDriver. Why not code directly against the WebDriver API? Capybara is more Ruby-like, more flexible, and makes it easier to handle asynchrony.
Part of what makes Capybara so appealing is that it feels like magic. This is also what can make it frustrating.
To work effectively with Capybara, you need to learn to think like a Capybara.
Capybara automatically waits for asynchronous operations to complete. When you try to find an element that isn't on the page, it waits and retries until it is there, or a timeout duration elapses. Default is 2 seconds.
That's pretty short, so if the sign-in is slow, you might get timeout errors.
You can wrap a block in 'using_wait_time' to give it a longer timeout duration.
In Capybara 2.1, you can also pass a 'wait' option to individual methods.
Methods that unambiguously identify a fixed number of elements.
This isn't fully comprehensive, but most methods fall into one of these categories.
Anything where Capybara can't guess how many elements you’re expecting, or what they are.
This test may fail when it should pass.
We can tell Capybara how many results we're expecting, and it will wait for it to become true, or time out.
When something is supposed to be removed from a page after an action, Capybara needs to wait for that, too.
If we tell Capybara that we're expecting the text not to be there, it will wait for that to be true.
Capybara's RSpec matchers are smart, so this works too. It knows whether you said expect/to (or should) or expect/not_to (or should_not).
We’ve seen examples of simple Capybara code written in an imperative, script-like style, but in big apps, it can get unwieldy.
Luckily, Capybara speaks Ruby, so we can use all of the tools of the language—classes, inheritance, delegation, blocks—to teach Capybara abstractions and encapsulate the details of our application.
This Cucumber scenario is very tightly coupled to the page it is testing. It’s ugly enough here, but in a big app this style of Cucumber is much worse, with URL paths and CSS selectors duplicated everywhere.
You see this a lot in apps that used an older version of the cucumber-rails gem. It used to generate a file of default Cucumber step definitions that looked just like this.
Jonas, the author of Capybara, wrote a blog post called “You’re Cuking it Wrong” explaining why this is bad practice.
Aslak Hellesøy, the author of Cucumber, has since disavowed web_steps.rb, and it is no longer created by default.
Here, the underlying URL and page markup details have been encapsulated within step definitions. This is much more readable for non-technical stakeholders.
Still, it is very coupled to specific UI implementation details.
Now the Cucumber test concisely describes the business requirements.
You may be tempted to simply move the tightly-coupled test code into the step definition, but this is hardly better. It is still boring and brittle.
We can refactor to page objects that model the UI of the application, and create an object-oriented testing API that can be reused across step definitions.
The application tester object can be added to the Cucumber world. It encapsulates access to the Capybara session, and provides methods that represent pages in the app, or services it provides.
Each page encapsulates markup details by providing logical methods for the elements on the page. These return Capybara Node objects, which support methods such as click, fill_in, finding descendent elements, etc. The entire Capybara DSL is available, scoped within that node.
For more complex elements, you can encapsulate them in their own page objects that provide higher-level APIs. For example, a date picker could be wrapped in an object that lets you set a date or choose “Today”.
Let’s see how that’s used again.
Long selectors like this are extremely brittle.
There's no shame in adding CSS IDs and classes to your markup for your tests. Difficulty writing tests can be a code smell: clean, semantic markup makes for easier testing. Try (A)TDD.
Page Objects help here, too. Navigating through a chain of page elements gives useful errors and stack traces.
Sometimes, despite your best efforts, Capybara misbehaves. Here are some tips you can use for getting it back in line.
Add this to your Cucumber step definitions.
If a step is failing, throw “And I debug” right before it and watch what happens in the browser. If it looks like it’s working, continue in the debugger. If it passes, you probably have a synchronisation issue, where the step isn’t waiting for the operation to complete.
Capybara can save screenshots. This is a simple way to save a screenshot after each scenario. You can get more clever with this, such as only saving after failures. Our code is pretty complex, but there is also a gem that makes it automatic.
One annoying thing with Firefox: sometimes tests fail when it doesn’t have focus. Firefox doesn’t fire certain events when it’s in the background.
focusmanager.testmode is a hidden Firefox configuration that disables this. Google for it and you’ll find examples of how to set it.
New versions of Firefox often break WebDriver, so keep that gem up to date using “bundle update selenium-webdriver” often.
Also, disable Firefox’s auto-update in CI.
Linux handles events differently than Mac OS and Windows. Keep that in mind when diagnosing failures in CI. Make sure your xvnc or xvfb window is large enough to display the page properly. We had to configure the default geometry in Jenkins.
You’ll get a clean profile in Firefox with no add-ons installed by default. Capybara Firebug is a gem that automatically installs and activates Firebug into Firefox when Capybara runs. Really useful, but slows down your tests. Use a Cucumber profile to activate it.
The usual resources apply.
The most important thing to do: prioritise fixing flaky tests as a team.
Flaky tests are ones that sometimes pass, sometimes fail, seemingly at random.
It’s all too easy to get into a situation where one flaky test becomes many, your build is always red, and you start to ignore failures. Your tests lose their meaning, and then one day you ship a bug that the tests would have caught.
That really stinks.