Skip to content

Commit

Permalink
MDL-30431 behat: Use table id for wiki comments in behat
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Jul 16, 2014
1 parent f466584 commit 52f061d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions mod/wiki/pagelib.php
Expand Up @@ -633,6 +633,7 @@ function print_content() {
$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();
Expand Down
16 changes: 8 additions & 8 deletions mod/wiki/tests/behat/wiki_comments.feature
Expand Up @@ -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"

Expand All @@ -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
Expand All @@ -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"

0 comments on commit 52f061d

Please sign in to comment.