From bbd28eeb0199469b4c0f2beaeb064839a8aa9172 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Tue, 2 Feb 2016 15:23:08 -0300 Subject: [PATCH] forum-feature: fill tinyMCE field done through execute_script --- features/forum.feature | 8 ++++---- features/step_definitions/web_steps.rb | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/features/forum.feature b/features/forum.feature index bfcd185..0239c65 100644 --- a/features/forum.feature +++ b/features/forum.feature @@ -79,7 +79,7 @@ Feature: forum | joaosilva | Forum One | And I go to /joaosilva/forum-one When I follow "Configure forum" - And I fill in "Description" with "My description" + And I fill in tinyMCE "article_body" with "My description" And I check "Has terms of use:" And I press "Save" Then I should see "Forum One" @@ -95,7 +95,7 @@ Feature: forum | mariasilva | Maria Silva | And I go to /joaosilva/forum-one When I follow "Configure forum" - And I fill in "Description" with "My description" + And I fill in tinyMCE "article_body" with "My description" And I check "Has terms of use:" And I press "Save" When I follow "New discussion topic" @@ -118,7 +118,7 @@ Feature: forum | mariasilva | Maria Silva | And I go to /joaosilva/forum-one When I follow "Configure forum" - And I fill in "Description" with "My description" + And I fill in tinyMCE "article_body" with "My description" And I check "Has terms of use:" And I press "Save" When I follow "Logout" @@ -135,7 +135,7 @@ Feature: forum | joaosilva | Forum One | And I go to /joaosilva/forum-one When I follow "Configure forum" - And I fill in "Description" with "My description" + And I fill in tinyMCE "article_body" with "My description" And I check "Has terms of use:" And I press "Save" When I follow "Logout" diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 031c649..af97759 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -276,6 +276,10 @@ Then /^display "([^\"]*)"$/ do |element| evaluate_script("jQuery('#{element}').show() && false;") end +Then /^I fill in tinyMCE "(.*?)" with "(.*?)"$/ do |field, content| + execute_script("$(tinymce.editors['#{field}'].setContent('#{content}'))") +end + Then /^there should be a div with class "([^"]*)"$/ do |klass| should have_selector("div.#{klass}") end -- libgit2 0.21.2