Problem
You would like to see how many commits per author you have in your git repository.
Solution
Just run the following command to get commits per author in your git:
git shortlog -s -n
Problem
You would like to see how many commits per author you have in your git repository.
Solution
Just run the following command to get commits per author in your git:
git shortlog -s -n
Problem
You have a location search in your application that uses google maps auto suggest, and you want to be able to select the first item, so that it can be used in your cucumber tests.
Solution
You can create a step as in the code below, and put it in one of your cucumber step definitions:
When /^I do a map search$/ do item = page.find(".pac-container .pac-item:first") item.click end
and then you can call this step from any other step in your cucumber tests by:
step "I do a map search"
Problem
You are using cucumber for your tests and you would like to use the modal dialog confirmation box in a rails application, with capybara but you are getting the following error:
Modal dialog present Selenium::WebDriver::Error::UnhandledAlertError)
Solution
In your steps file use the following to accept (press OK), in the confirmation dialog that pops up:
page.driver.wait_until(page.driver.browser.switch_to.alert.accept)
NOTE: Or in more recent versions when the above complains for ‘undefined method wait_until’
page.driver.browser.switch_to.alert.accept
NOTE: Taken from the second comment made here