Skip to content

Commit

Permalink
MDL-44084 behat: Fixed setting value for form editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Mar 27, 2014
1 parent 3c87c08 commit 3e46999
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions lib/behat/form_field/behat_form_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public function set_value($value) {
$js = '
var editor = Y.one(document.getElementById("'.$editorid.'editable"));
if (editor) {
editor.setHTML("' . $value . '").focus();
} else {
editor = Y.one(document.getElementById("'.$editorid.'"));
editor.set("value", "' . $value . '");
}';
$result = $this->session->executeScript($js);
editor.setHTML("' . $value . '");
}
editor = Y.one(document.getElementById("'.$editorid.'"));
editor.set("value", "' . $value . '");
';
$this->session->executeScript($js);
} else {
parent::set_value($value);
}
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/tests/behat/preview_page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Feature: Edited wiki pages may be previewed before saving

@javascript
Scenario: Page contents preview before saving with Javascript enabled
Then the field "HTML format" matches value "<p>Student page contents to be previewed</p>"
Then the field "HTML format" matches value "Student page contents to be previewed"
And I press "Cancel"

Scenario: Page contents preview before saving with Javascript disabled
Expand Down
4 changes: 2 additions & 2 deletions mod/wiki/tests/behat/wiki_formats.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ Feature: There is a choice of formats for editing a wiki page
When I set the following fields to these values:
| HTML format | 1 |
And I press "Create page"
Then "#id_newcontent_editor_tbl" "css_element" should exist
And ".mce_bold" "css_element" should exist
Then "#id_newcontent_editoreditable" "css_element" should exist
And ".editor_atto_content" "css_element" should exist
And I set the following fields to these values:
| HTML format | I'm a text |
And I press "Save"
Expand Down

0 comments on commit 3e46999

Please sign in to comment.