Allow for easier filling out of a tinymce form behat step

Bug #1557200 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Robert Lyon

Bug Description

Currently we have a long clumsy way to do it by finding out the id of the iframe, eg

And I fill in "This is a description" in WYSIWYG editor "edit_interaction_description_ifr"

It would be better if the step itself could find the right iframe and fill in the text

eg: And I fill in "This is a description" in editor "Description"

where 'Description' is the label for the editor

Tags: behat
Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 16.04.0
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Already implemented.

@Given /^(?:|I )fill in "(?P<text>[^"]*)" in WYSIWYG editor(?:| "(?P<iframe>[^"]*)")$/

Defined in function iFillInInWysiWYGEditor($text, $iframe = null) in BehatForms.php

You can either use it with an iframe name, or without. If you use it without an iframe name, then it uses the first TinyMCE editor currently on the page. This is useful for filling in TinyMCE's that might have dynamically generated unpredictable names. Or, for that matter, it's useful in most situations, because we rarely have more than one TinyMCE editor on a single page.

Example: I fill in "This is an interactive editor" in WYSIWYG editor

Changed in mahara:
milestone: 16.04.0 → 16.10.0
status: In Progress → Fix Released
tags: added: behat
Changed in mahara:
milestone: 16.10.0 → 16.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6121
Committed: https://git.mahara.org/mahara/mahara/commit/625ad7fc24300f9dffd6fc7a4b7e1b4e9c918b38
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 625ad7fc24300f9dffd6fc7a4b7e1b4e9c918b38
Author: Robert Lyon <email address hidden>
Date: Tue Mar 8 15:42:22 2016 +1300

Bug 1557200: Find the TinyMCE editor by field label

Change-Id: I91bbaf6d807d029d316b005d2b5c8f9b6836f65a
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Robert Lyon (robertl-9) wrote :

The ability to access a tinymce did already exist but this patch actually changes things so you don't have to hunt through the html code for the iframe id

Now you can simply use the field label text, which will normally be visible to the screen.

In the case of the 'comments' tinymce this label is hidden with css but it's label is 'Message' which is a lot easier to remember than 'add_feedback_form_message_ifr'

Changed in mahara:
milestone: 16.04.0 → 16.10.0
status: Fix Released → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/6519

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6519
Committed: https://git.mahara.org/mahara/mahara/commit/264411a2052d620cb71b53c47e077e84b08a2a44
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 264411a2052d620cb71b53c47e077e84b08a2a44
Author: Robert Lyon <email address hidden>
Date: Mon May 23 13:32:25 2016 +1200

Bug 1557200: Fixing tinymce finding for this feature file

must have got missed or been in review when the others were changed

Change-Id: I6b4e3498c7a83e07117ae4e4bb74eee8275cc9a9
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.