Skip to content

Instantly share code, notes, and snippets.

View calaway's full-sized avatar

Calaway calaway

View GitHub Profile
@calaway
calaway / test_automation_css_selector_best_practices.md
Created August 30, 2018 22:28
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('...').

@calaway
calaway / git_workflow_best_practices.md
Last active November 20, 2024 19:49
Git Workflow Best Practices

Git Branch Merging Best Practices

  1. After you've selected a feature to work on, create a branch in your local repo to build it in.
    • $ git checkout -b calaway/short_description_of_feature
  2. Implement the requested feature, make sure all tests are passing, and commit all changes in the new branch.
  3. Checkout the master branch locally.
    • $ git checkout master
  4. 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
  5. Make sure all tests are passing on master and then checkout your new branch.
  • $ git checkout calaway/short_description_of_feature
@calaway
calaway / rails_setup.md
Last active March 4, 2017 03:04 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :development, :test:
  • gem 'rspec-rails', '~&gt; 3.5' - use rspec in place of minitest (docs)
@calaway
calaway / my_first_open_source.md
Last active February 1, 2017 00:24
PlaySkool’s My First Open Source!

PlaySkool’s My First Open Source!

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

@calaway
calaway / prework.md
Last active June 27, 2016 04:46 — forked from mbburch/prework.md
Calaway's Turing pre-work Gist