From 5f3ea8cf66d0e6bfea1cef53b8d8009bfdf4919f Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Fri, 7 Mar 2014 10:12:00 +0800 Subject: [PATCH] MDL-43883 Atto behat: Rubrics are expecting magic tweaking in text from tinymce. --- .../form/rubric/tests/behat/publish_rubric_templates.feature | 2 +- lib/behat/form_field/behat_form_text.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature index 070ebc00ce0..726a34a9d69 100644 --- a/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature +++ b/grade/grading/form/rubric/tests/behat/publish_rubric_templates.feature @@ -45,7 +45,7 @@ Feature: Publish rubrics as templates @javascript Scenario: Create a rubric template and reuse it as a teacher, with Javascript enabled - Then the field "Description" matches value "

Assignment 1 description

" + Then the field "Description" matches value "Assignment 1 description" And I should see "Criterion 1" And I press "Cancel" diff --git a/lib/behat/form_field/behat_form_text.php b/lib/behat/form_field/behat_form_text.php index dffdf86ffa2..14291e17357 100644 --- a/lib/behat/form_field/behat_form_text.php +++ b/lib/behat/form_field/behat_form_text.php @@ -63,7 +63,8 @@ class behat_form_text extends behat_form_field { * @return bool The provided value matches the field value? */ public function matches($expectedvalue) { - return $this->text_matches($expectedvalue); + // A text editor may silently wrap the content in p tags (or not). Neither is an error. + return $this->text_matches($expectedvalue) || $this->text_matches('

' . $expectedvalue . '

'); } }