Tags
Capybara Cheat Sheet
20 Friday Sep 2013
Posted Uncategorized
in20 Friday Sep 2013
Posted Uncategorized
inTags
19 Thursday Sep 2013
Posted Tech, Test Automation, Testing
inWhen you use Webmock or VCR or both together along with Cucumber, you will face an issue with your tests not being able to record as webmock and vcr blocks all outbound HTTP requests.
You will see error somewhat like this:
The request that is triggering the error looks like it’s coming from Capybara. When you use one of the javascript drivers, capybara boots your app using a simple rack server, and then polls the special__identify__
path so it knows when it has finished booting.
There are few ways to tackle this problem based on your situation
1. If you are only using only Webmock
If you don’t need it, remove it from the Gemfile. If you do need it, then you may need to configure it more precisely to your needs, one thing worked for me is adding this snippet to my env.rb
By doing so, you allow real web access to your localhost.
2. If you are using vcr & webmock both
If you’re using VCR, you don’t need to configure webmock with the require 'webmock/cucumber'
line and the WebMock.allow_net_connect!
line. VCR takes care of any necessary WebMock configuration for you.
VCR includes support for ignoring localhost requests so that it won’t interfere with this. The relish docs, but in short you can use this snippet in VCR configuration to get it working.
Create vcr.rb inside feature/support folder and add this:
If this doesn’t work then follow the detailed documentation at Relish to get it working with cucumber
18 Wednesday Sep 2013
Posted Tech, Test Automation, Testing
inTags
If you are using Cucumber with Rails 3 or Rails 4, you might face this issue.
You would have obviously followed the Cucumber guide to set up cucumber with Rails 4.
Problem faced
When you run cucumber it throws error “No known ORM was detected! Is ActiveRecord, DataMapper, MongoMapper, Mongoid, or CouchPotato loaded? (DatabaseCleaner::NoORMDetected)”.
What causes this problem
When you follow cucumber guide, it ask you to add this snippet in Gemfile
And when you execute command to generate cucumber, it creates env.rb inside features/support folder
Entries in gemfile and env.rb file for database doesn’t allow you to run your cucumber tests and always throw error for not finding the database, snippet of env.rb is shown below
How to resolve
If you are not using any database in your application and using Rails 3.x or 4.x with latest version of cucumber, you will have to do following things.
Hope this helps, my motivation behind documenting it is unable to find straight forward solution anywhere.
16 Monday Sep 2013
Posted Tech, Test Automation, Testing
inTags
Moving between jobs and setting up new machine can be quite painful at times, I recently moved into new assignment and faced the challenge so to avoid pain for other just summarising the steps I followed for smooth Installation.
If you don’t have Xcode installed I suggest to install Xcode from the Mac App Store and install the command line tools in Xcode Preferences -> Downloads.
Now, run brew doctor to check everything is as expected before we continue.:
If you get error: No such file or directory – /usr/local/Cellar
Run the following:
After this is complete, execute the following in order to use RVM in your current shell
Add the following to your ~/.profile in order to source RVM everytime you run Terminal.app:
If you have any missing required packages you will need to install them before continuing by running brew install .
If you need to install apple-gcc42 and get an error: No available formula for apple-gcc42
Run the following:
If you get an error after running this: Already tapped!
Instead of repairing, run the following:
Now you can continue and install apple-gcc42:
From the “Missing required packages: …” line above, for example I can now execute the following:
Execute the following:
If you get an error or warning about your PATH. Such as:
Open your ~/.profile and add the following line to the top (or bottom, it shouldn’t matter):
Or Augment your .bash_profile to have
Now run: brew doctor
First run the following commands:
followed by:
If you don’t get any errors you can finally install Ruby 2.0.0:
To set as your current version of Ruby run the following command:
To make it the default Ruby:
Now every time you open Terminal.app Ruby 2.0.0 will be default. You can always check which version of Ruby you have using the following command:
and where it’s located executing the command:
You are now setup to run Ruby 2.0.0 on Mac OS X 10.8 Mountain Lion.
28 Thursday Jun 2012
Posted Collaboration, Testing
inMost commonly known as Bug Bash, Break the App session, but they are all really just few names of this practice where we crowdsource* the testing to the project teams.
It’s been a while since I have been following this practice of crowd-sourcing the testing to the project team, occasionally outside project team as well and found that it is the most easiest and cost effective way to implement exploratory and usability testing prior to the release every iteration.
Team who have built a feature would always like someone else to have a look at it prior release, it will get them honest, unbiased feedback which is very valuable before the release, it also saves lot of time and money for the project teams. Throughout the iteration teams test the stories and try to capture maximum defects and prevent them to go ahead in the final product but just like other team members (developers, business analysts, ux) they must have been 100% focused on the feature and there is a possibility that they know something too well and overlook the obvious.
What is needed are fresh pairs of eyes provided with a mission to play with the feature developed and see what they think. An end user, someone who is playing with an application for the first time and asked What do they think about it? This also gives the feedback as we consider first impression lasts, something that either isn’t intuitive, doesn’t work as expected or just looks crap which is not going to live it’s life in production.
On the other side if the same task is given outside organisation to the team of experts onshore/offshore or usability experts, it will definitely get the job done but it’s an additional cost to the company versus in this case if you choose to crowdsource it internally, it’s faster cheaper and quicker solution.
It is a time boxed activity where teams are given approximately 30 – 40 minutes to play with another team’s new feature and provide feedback within that timeframe, related team member then review the feedback and act on them, few things needs to be taken care are:
If company has existing tool to collect feedback then it can be used. I have used Mingle, Jira and spreadsheet on various occasions, constraint is that it may waste time if people don’t already know these tools, and here our main objective is to collect feedback so even if someone likes to write on post-it’s then allow them and collect it at the end, so that time blocked can be utilised completely for testing.
One thing to be noted is the timing of this activity during the iteration, it should not be done near to a release, else you will not have time to incorporate the feedback from this activity. If something really bad is found then it can be scheduled for resolution in the same iteration or next iteration and importantly it has been prevented from going live.
*crowdsourcing: It is a distributed problem-solving and production model. In the classic use of the term, problems are broadcast to an unknown group of solvers in the form of an open call for solutions. Users—also known as the crowd—submit solutions. Solutions are then owned by the entity that broadcast the problem in the first place—the crowdsourcer.
27 Tuesday Mar 2012
Attributes of shared understanding
Qualities of good acceptance test
17 Saturday Mar 2012
Tags
Dev Box testing, name comes from the practice where initial round of testing is done on developer’s(Dev) machine(Box) before the developer checks in the code to the source repository and mark the task (story or defect) as development complete.
I feel this is one of the crucial step towards getting faster feedback, every task done by the developers gets tested on their machine by BA’s & QA’s and feedback is provided on the spot, it sounds very simple and yes it is simple if followed properly else it could turn out to be chaotic.
There is no formal process of how it should be done so it’s best left to the team, few ways I have done it so far.
07 Wednesday Mar 2012
Tags
Innovation and failure go hand in hand, fearing failure stifles creativity and progress. If you’re not failing, you’re not going to innovate.
We have always read about testing should start early in the life cycle of development, here is some analysis why.
Irrespective of Waterfall Model or Agile, we usually fall in trap of bringing in Testing in our last phase, benefit in Agile methodology is you failing faster then waterfall projects but still not faster as you can.
The earlier you find a bug, the cheaper it is to fix it.
If you are able to find the bug in the requirements gathering phase, fix is going to be of nearly of no cost versus if found in testing phase or post release, fixing them is 100 times expensive.
This is what you should do:
“I have not failed, I’ve just found 10,000 ways that won’t work” – Thomas Edison
04 Sunday Mar 2012
Tags
I have been working in distributed teams for close to 5 years now, here are few things about distributed teams.
A distributed team (also known as a geographically dispersed team) is a group of individuals who work across time, space and organizational boundaries.
Working with distributed teams gives companies access to talent that they may have otherwise not have access locally. Additionally, companies gains experience in working with different global markets. Moreover, a project can be completed in a faster manner if people in different time zones are continuously working on a particular project. That’s not all, companies can obtain significant cost savings if they work in distributed team environment.
Fully distributed teams has more value then localised agile teams.
03 Saturday Mar 2012
Tags
This question is often raised by testing teams, what should we automate, or should we automate everything.
I would recommend teams to find answer themselves by asking the question what value will all the automated tests provide vs cost & time to be invested to build the automation suite. We automate to get faster feedback and shortened the testing time, which leads to a huge saving in terms of time and money for the team.
The automation requirements define what needs to be automated looking into various aspects. The specific requirements can vary based on product, time and situation, but still I am trying to sum-up few generic tips.