Skip to content

Instantly share code, notes, and snippets.

@mykecameron
Created August 27, 2013 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mykecameron/6356750 to your computer and use it in GitHub Desktop.
Save mykecameron/6356750 to your computer and use it in GitHub Desktop.
def create_issue_through_ui(issue_name)
wait_until_scope_available '.new-issue #new-issue'
link = page.find :css, '.new-issue #new-issue'
link.click
wait_until_scope_available '#edit-issue-title-form input.issue-title-input'
input = page.find :css, '#edit-issue-title-form input.issue-title-input'
input.set issue_name
save_button = page.find :css, '#edit-issue-title-form .call-to-action'
save_button.click
wait_until_scope_available ".issue-tab.active:contains(\"#{issue_name}\")"
end
def save_note(note)
wait_until_scope_exists 'textarea#issue_note_body'
text_area = page.find :css, 'textarea#issue_note_body'
text_area.set note
save_button = page.find :css, '#save-note'
save_button.click
wait_until_scope_exists ".issue-note .note:contains(\"#{note}\")"
end
When /^I create an Issue "([^"]*)" with note "([^"]*)"$/ do |issue, note|
create_issue_through_ui(issue)
save_note(note)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment