Capybara method and matchers which is frequently used

May 10, 2015

Reading time ~1 minute

method

fill with value in input

fill_in("name value", with: "value")

click button

click_button("submit")

find element

find("#selector")

select select tag option

select("japan", :from => "country")

access page

visit("/page/path")

change host

Capybara.app_host = "http://example.com"

matchers

expect(page).to have_title("page title")
expect(page).to have_link("link text", :href => "/path")
expect(page).to have_content("content text")
expect(form).to have_selector(:css, "[name='email']", visible: true)

add ticket number to git commit automatically

Most of ticket tracker like Github, pivotal tracker have function to connect your commit to ticket(story).But every time when you commit ...… Continue reading

I will build frontend and backend separately

Published on September 28, 2016

order of angular controller's initialisation

Published on October 05, 2015