Last active
May 17, 2017 18:10
-
-
Save bguthrie/5750066 to your computer and use it in GitHub Desktop.
A Capybara helper to fill in WYSIHTML5 editors. Works with multiple editors on a page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FillInWysihtml5 | |
def fill_in_wysihtml5(label, opts={}) | |
page.execute_script <<-JAVASCRIPT | |
var id = $("label:contains(#{label})").attr("for"); | |
$("#" + id).data("wysihtml5").editor.setValue("#{opts[:with]}"); | |
JAVASCRIPT | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment