You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Calaway
calaway
I am a motivated and curious web developer with a passion for solving challenging problems by writing well tested, efficient, highly readable code.
Best Practices for Building CSS Selectors in UI Test Automation
Precise
A good selector matches exactly the intended element(s) and no more.
I recommend always building out your selectors in a pry session. First build your selector using Capybara's all method with .count to make sure your selector does not return more elements than you are intending to target.
page.all('[build selector here]').count
Once you have your selector built this way, swap out the page.all('...').count for the capybara method you need, e.g. find('...') or assert_selector('...').
Implement the requested feature, make sure all tests are passing, and commit all changes in the new branch.
Checkout the master branch locally.
$ git checkout master
Pull down the master branch from GitHub to get the most up to date changes from others. If you practice git workflow as described here you should never have a merge conflict at this step.
$ git pull origin master
Make sure all tests are passing on master and then checkout your new branch.
I love open source software (OSS). Ever since I installed Linux on the computer I built for my first year at college over a decade ago, I’ve been hooked. Not hooked strictly to any certain piece of software or Linux distro, but to the philosophy.
In kindergarten we’re taught that “sharing is caring” and that we should give to others those things that make us happy so they can feel that as well. Many of us have brought that with us into adulthood, and it is still wonderful. However, when you take that old adage from the material world into the digital world you’ll see that ones and zeros can have a nearly infinite multiplier effect.
Traditionally when you give a possession to a friend, then you no longer have it, making it a zero sum proposition—except for the happiness you have both gained from the transaction, which I certainly don’t mean to discount. Software, on the other hand, is nothing more than information. Like a good idea, it can be given away as many times as