From 52f061db3e93eb19592e123035175c1237e7fabd Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Wed, 16 Jul 2014 14:56:08 +0800 Subject: [PATCH] MDL-30431 behat: Use table id for wiki comments in behat --- mod/wiki/pagelib.php | 1 + mod/wiki/tests/behat/wiki_comments.feature | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mod/wiki/pagelib.php b/mod/wiki/pagelib.php index 1bf9c9630e5..be297715582 100644 --- a/mod/wiki/pagelib.php +++ b/mod/wiki/pagelib.php @@ -633,6 +633,7 @@ class page_wiki_comments extends page_wiki { $by->date = userdate($comment->timecreated); $t = new html_table(); + $t->id = 'wiki-comments'; $cell1 = new html_table_cell($OUTPUT->user_picture($user, array('popup' => true))); $cell2 = new html_table_cell(get_string('bynameondate', 'forum', $by)); $cell3 = new html_table_cell(); diff --git a/mod/wiki/tests/behat/wiki_comments.feature b/mod/wiki/tests/behat/wiki_comments.feature index b900c71a429..4ffa1a1aed7 100644 --- a/mod/wiki/tests/behat/wiki_comments.feature +++ b/mod/wiki/tests/behat/wiki_comments.feature @@ -43,14 +43,14 @@ Feature: Users can comment on wiki pages @javascript Scenario: Student can edit and delete their own comment - When I click on "Edit" "link" in the ".generaltable" "css_element" + When I click on "Edit" "link" in the "wiki-comments" "table" And I set the following fields to these values: | Comment | student 1 updated comment | And I press "Save" Then I should see "student 1 updated comment" - And "Edit" "link" should exist in the ".generaltable" "css_element" - And "Delete" "link" should exist in the ".generaltable" "css_element" - And I click on "Delete" "link" in the ".generaltable" "css_element" + And "Edit" "link" should exist in the "wiki-comments" "table" + And "Delete" "link" should exist in the "wiki-comments" "table" + And I click on "Delete" "link" in the "wiki-comments" "table" And I press "Yes" And I should not see "student 1 updated comment" @@ -61,8 +61,8 @@ Feature: Users can comment on wiki pages And I follow "Course 1" And I follow "Test wiki name" And I follow "Comments" - Then "Edit" "link" should not exist in the ".generaltable" "css_element" - And "Delete" "link" should not exist in the ".generaltable" "css_element" + Then "Edit" "link" should not exist in the "wiki-comments" "table" + And "Delete" "link" should not exist in the "wiki-comments" "table" @javascript Scenario: Teacher can delete a student comment @@ -71,5 +71,5 @@ Feature: Users can comment on wiki pages And I follow "Course 1" And I follow "Test wiki name" And I follow "Comments" - Then "Edit" "link" should not exist in the ".generaltable" "css_element" - And "Delete" "link" should exist in the ".generaltable" "css_element" + Then "Edit" "link" should not exist in the "wiki-comments" "table" + And "Delete" "link" should exist in the "wiki-comments" "table"