[Git][noosfero/noosfero][master] forum-feature: fill tinyMCE field done through execute_script

Rodrigo Souto gitlab at mg.gitlab.com
Tue Feb 2 16:25:42 BRST 2016


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
bbd28eeb by Rodrigo Souto at 2016-02-02T15:23:08-03:00
forum-feature: fill tinyMCE field done through execute_script

Tinymce fields are not filled normally as other fields. In order to fill
them, had to use execute_script to set the content of the editor object.

This fix might be necessary in other tests as well.

- - - - -


2 changed files:

- features/forum.feature
- features/step_definitions/web_steps.rb


Changes:

=====================================
features/forum.feature
=====================================
--- 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"


=====================================
features/step_definitions/web_steps.rb
=====================================
--- 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



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/bbd28eeb0199469b4c0f2beaeb064839a8aa9172
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160202/27814e17/attachment.html>


More information about the Noosfero-dev mailing list