From bd1aca8834451b02587f504d2e37cf0de0cc3a52 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 8 Apr 2013 14:03:35 +0800 Subject: [PATCH] MDL-38965 behat: New test According to MDLQA-5229, an admin can add or remove items from the TinyMCE editor toolbar. --- .../tests/behat/edit_available_icons.feature | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/editor/tinymce/tests/behat/edit_available_icons.feature diff --git a/lib/editor/tinymce/tests/behat/edit_available_icons.feature b/lib/editor/tinymce/tests/behat/edit_available_icons.feature new file mode 100644 index 00000000000..b682c409e46 --- /dev/null +++ b/lib/editor/tinymce/tests/behat/edit_available_icons.feature @@ -0,0 +1,50 @@ +@editor_tinymce +Feature: Add or remove items from the TinyMCE editor toolbar + In order to customize the TinyMCE editor appearance + As a moodle admin + I need to add and remove items from the toolbar + + Background: + Given the following "courses" exists: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And I log in as "admin" + + @javascript + Scenario: Remove icons + When I set the following administration settings values: + | Editor toolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen | + And I am on homepage + And I follow "Course 1" + And I turn editing mode on + And I add a "Database" to section "1" + Then "#id_introeditor_tbl .mce_bold" "css_element" should not exists + And "#id_introeditor_tbl .mce_fullscreen" "css_element" should exists + And I press "Cancel" + + @javascript + Scenario: Add icons + When I set the following administration settings values: + | Editor toolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen,anchor | + And I am on homepage + And I follow "Course 1" + And I turn editing mode on + And I add a "Database" to section "1" + Then "#id_introeditor_tbl .mce_bold" "css_element" should not exists + And "#id_introeditor_tbl .mce_anchor" "css_element" should exists + And I set the following administration settings values: + | Editor toolbar | fontselect,fontsizeselect,formatselect,\|,undo,redo,\|,search,replace,\|,fullscreen | + And I am on homepage + And I follow "Course 1" + And I add a "Database" to section "1" + And "#id_introeditor_tbl .mce_anchor" "css_element" should not exists + And I press "Cancel" + + @javascript + Scenario: Default icons + Given I follow "Course 1" + And I turn editing mode on + When I add a "Database" to section "1" + Then "#id_introeditor_tbl .mce_bold" "css_element" should exists + And "#id_introeditor_tbl .mce_anchor" "css_element" should not exists + And I press "Cancel"