From 59e774be9ac2eb498bc982a0451a37bc5997820c Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 12 Feb 2024 22:21:26 +0000 Subject: [PATCH 1/2] MDL-80907 behat: be more precise in selecting table rows --- lib/tests/behat/behat_general.php | 174 ++++++++++++++++++++---------- 1 file changed, 117 insertions(+), 57 deletions(-) diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index a2468e1ca12..707dc0e7bde 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -1427,31 +1427,8 @@ EOF; $rowliteral = behat_context_helper::escape($row); $valueliteral = behat_context_helper::escape($value); - $columnliteral = behat_context_helper::escape($column); - if (preg_match('/^-?(\d+)-?$/', $column, $columnasnumber)) { - // Column indicated as a number, just use it as position of the column. - $columnpositionxpath = "/child::*[position() = {$columnasnumber[1]}]"; - } else { - // Header can be in thead or tbody (first row), following xpath should work. - $theadheaderxpath = "thead/tr[1]/th[(normalize-space(.)=" . $columnliteral . " or a[normalize-space(text())=" . - $columnliteral . "] or div[normalize-space(text())=" . $columnliteral . "])]"; - $tbodyheaderxpath = "tbody/tr[1]/td[(normalize-space(.)=" . $columnliteral . " or a[normalize-space(text())=" . - $columnliteral . "] or div[normalize-space(text())=" . $columnliteral . "])]"; - - // Check if column exists. - $columnheaderxpath = $tablexpath . "[" . $theadheaderxpath . " | " . $tbodyheaderxpath . "]"; - $columnheader = $this->getSession()->getDriver()->find($columnheaderxpath); - if (empty($columnheader)) { - $columnexceptionmsg = $column . '" in table "' . $table . '"'; - throw new ElementNotFoundException($this->getSession(), "\n$columnheaderxpath\n\n".'Column', null, $columnexceptionmsg); - } - // Following conditions were considered before finding column count. - // 1. Table header can be in thead/tr/th or tbody/tr/td[1]. - // 2. First column can have th (Gradebook -> user report), so having lenient sibling check. - $columnpositionxpath = "/child::*[position() = count(" . $tablexpath . "/" . $theadheaderxpath . - "/preceding-sibling::*) + 1]"; - } + $columnpositionxpath = $this->get_table_column_xpath($table, $column); // Check if value exists in specific row/column. // Get row xpath. @@ -1493,6 +1470,99 @@ EOF; ); } + /** + * Get xpath for a row child that corresponds to the specified column header + * + * @param string $table table identifier that can be used with 'table' node selector (i.e. table title or CSS class) + * @param string $column either text in the column header or the column number, such as -1-, -2-, etc + * When matching the column header it has to be either exact match of the whole header or an exact + * match of a text inside a link in the header. + * For example, to match "First name / Last name" you need to specify either "First name" or "Last name" + * @return string + */ + protected function get_table_column_xpath(string $table, string $column): string { + $tablenode = $this->get_selected_node('table', $table); + $tablexpath = $tablenode->getXpath(); + $columnliteral = behat_context_helper::escape($column); + if (preg_match('/^-?(\d+)-?$/', $column, $columnasnumber)) { + // Column indicated as a number, just use it as position of the column. + $columnpositionxpath = "/child::*[position() = {$columnasnumber[1]}]"; + } else { + // Header can be in thead or tbody (first row), following xpath should work. + $theadheaderxpath = "thead/tr[1]/th[(normalize-space(.)={$columnliteral} or a[normalize-space(text())=" . + $columnliteral . "] or div[normalize-space(text())={$columnliteral}])]"; + $tbodyheaderxpath = "tbody/tr[1]/td[(normalize-space(.)={$columnliteral} or a[normalize-space(text())=" . + $columnliteral . "] or div[normalize-space(text())={$columnliteral}])]"; + + // Check if column exists. + $columnheaderxpath = "{$tablexpath}[{$theadheaderxpath} | {$tbodyheaderxpath}]"; + $columnheader = $this->getSession()->getDriver()->find($columnheaderxpath); + if (empty($columnheader)) { + if (strpos($column, '/') !== false) { + // We are not able to match headers consisting of several links, such as "First name / Last name". + // Instead we can match "First name" or "Last name" or "-1-" (column number). + throw new Exception("Column matching locator \"$column\" not found. ". + "If the column header contains multiple links, specify only one of the link texts. ". + "Otherwise, use the column number as the locator"); + } + $columnexceptionmsg = $column . '" in table "' . $table . '"'; + throw new ElementNotFoundException($this->getSession(), "\n$columnheaderxpath\n\n".'Column', + null, $columnexceptionmsg); + } + // Following conditions were considered before finding column count. + // 1. Table header can be in thead/tr/th or tbody/tr/td[1]. + // 2. First column can have th (Gradebook -> user report), so having lenient sibling check. + $columnpositionxpath = "/child::*[position() = count({$tablexpath}/{$theadheaderxpath}" . + "/preceding-sibling::*) + 1]"; + } + return $columnpositionxpath; + } + + /** + * Find a table row where each of the specified columns matches and throw exception if not found + * + * @param string $table table locator + * @param array $cells key is the column locator (name or index such as '-1-') and value is the text contents of the table cell + */ + protected function ensure_table_row_exists(string $table, array $cells): void { + $tablenode = $this->get_selected_node('table', $table); + $tablexpath = $tablenode->getXpath(); + + $columnconditions = []; + foreach ($cells as $columnname => $value) { + $valueliteral = behat_context_helper::escape($value); + $columnpositionxpath = $this->get_table_column_xpath($table, $columnname); + $columnconditions[] = '.' . $columnpositionxpath . "[contains(normalize-space(.)," . $valueliteral . ")]"; + } + $rowxpath = $tablexpath . "/tbody/tr[" . join(' and ', $columnconditions) . ']'; + + $rownode = $this->getSession()->getDriver()->find($rowxpath); + if (empty($rownode)) { + $rowlocator = array_map(fn($k) => "{$k} => {$cells[$k]}", array_keys($cells)); + throw new ElementNotFoundException($this->getSession(), "\n$rowxpath\n\n".'Table row', null, join(', ', $rowlocator)); + } + } + + /** + * Find a table row where each of the specified columns matches and throw exception if found + * + * @param string $table table locator + * @param array $cells key is the column locator (name or index such as '-1-') and value is the text contents of the table cell + */ + protected function ensure_table_row_does_not_exist(string $table, array $cells): void { + try { + $this->ensure_table_row_exists($table, $cells); + // Throw exception if found. + } catch (ElementNotFoundException $e) { + // Table row/column doesn't contain this value. Nothing to do. + return; + } + $rowlocator = array_map(fn($k) => "{$k} => {$cells[$k]}", array_keys($cells)); + throw new ExpectationException('Table row "' . join(', ', $rowlocator) . + '" is present in the table "' . $table . '"', $this->getSession() + ); + } + /** * Checks that the provided value exist in table. * @@ -1509,29 +1579,22 @@ EOF; */ public function following_should_exist_in_the_table($table, TableNode $data) { $datahash = $data->getHash(); + if ($datahash && count($data->getRow(0)) != count($datahash[0])) { + // Check that the number of columns in the hash is the same as the number of the columns in the first row. + throw new coding_exception('Table contains duplicate column headers'); + } foreach ($datahash as $row) { - - // Row contains only a single column, just assert it's present in the table. - if (count($row) === 1) { - $this->execute('behat_general::assert_element_contains_text', [reset($row), $table, 'table']); - } else { - // Iterate over all columns. - $firstcell = null; - foreach ($row as $column => $value) { - if ($firstcell === null) { - $firstcell = $value; - } else { - $this->row_column_of_table_should_contain($firstcell, $column, $table, $value); - } - } - } + $this->ensure_table_row_exists($table, $row); } } /** * Checks that the provided values do not exist in a table. * + * If there are more than two columns, we check that NEITHER of the columns 2..n match + * in the row where the first column matches + * * @Then /^the following should not exist in the "(?P[^"]*)" table:$/ * @throws ExpectationException * @param string $table name of table @@ -1541,27 +1604,24 @@ EOF; */ public function following_should_not_exist_in_the_table($table, TableNode $data) { $datahash = $data->getHash(); + if ($datahash && count($data->getRow(0)) != count($datahash[0])) { + // Check that the number of columns in the hash is the same as the number of the columns in the first row. + throw new coding_exception('Table contains duplicate column headers'); + } foreach ($datahash as $value) { - - // Row contains only a single column, just assert it's not present in the table. - if (count($value) === 1) { - $this->execute('behat_general::assert_element_not_contains_text', [reset($value), $table, 'table']); - } else { - // Iterate over all columns. - $row = array_shift($value); - foreach ($value as $column => $value) { - try { - $this->row_column_of_table_should_contain($row, $column, $table, $value); - // Throw exception if found. - } catch (ElementNotFoundException $e) { - // Table row/column doesn't contain this value. Nothing to do. - continue; - } - throw new ExpectationException('"' . $column . '" with value "' . $value . '" is present in "' . - $row . '" row for table "' . $table . '"', $this->getSession() - ); + if (count($value) > 2) { + // When there are more than two columns, what we really want to check is that for the rows + // where the first column matches, NEITHER of the other columns match. + $columns = array_keys($value); + for ($i = 1; $i < count($columns); $i++) { + $this->ensure_table_row_does_not_exist($table, [ + $columns[0] => $value[$columns[0]], + $columns[$i] => $value[$columns[$i]], + ]); } + } else { + $this->ensure_table_row_does_not_exist($table, $value); } } } From 09d7b78feeec08c0e44bbc023796bd82635532bd Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 12 Feb 2024 23:30:20 +0000 Subject: [PATCH 2/2] MDL-80907 various: fixes to incorrect column selectors in behat --- admin/tests/behat/browse_users.feature | 6 +- .../logstore_store_visibility_change.feature | 2 +- .../task/tests/behat/manage_tasks.feature | 4 +- comment/tests/behat/manage.feature | 2 +- enrol/cohort/tests/behat/enrolcohorts.feature | 4 +- .../grader/tests/behat/switch_views.feature | 12 ++-- .../tests/behat/tertiary_name_filter.feature | 14 ++-- .../tertiary_navigation_searching.feature | 4 +- .../tests/behat/basic_functionality.feature | 10 +-- .../singleview/tests/behat/singleview.feature | 2 +- grade/tests/behat/grade_import.feature | 2 +- .../tests/behat/grade_letter_boundary.feature | 2 +- .../grade_letter_boundary_20160518.feature | 2 +- .../grade_regrade_do_not_override.feature | 8 +-- grade/tests/behat/grade_scales.feature | 4 +- .../behat/grade_single_item_scales.feature | 4 +- .../behat/toggle_grade_categories.feature | 72 ++++++++----------- group/tests/behat/private_groups.feature | 20 +++--- .../tests/behat/course_summary.feature | 18 ++--- .../tests/behat/summary_filter_groups.feature | 24 +++---- .../behat/summary_filter_no_groups.feature | 2 +- .../configlog/tests/behat/view_report.feature | 2 +- reportbuilder/tests/behat/audience.feature | 2 +- user/tests/behat/table_sorting.feature | 2 +- 24 files changed, 104 insertions(+), 120 deletions(-) diff --git a/admin/tests/behat/browse_users.feature b/admin/tests/behat/browse_users.feature index e4c247bbc66..b2022a9a4a4 100644 --- a/admin/tests/behat/browse_users.feature +++ b/admin/tests/behat/browse_users.feature @@ -18,7 +18,7 @@ Feature: An administrator can browse user accounts When I navigate to "Users > Accounts > Browse list of users" in site administration # Name field always present, email field is default for showidentity. Then the following should exist in the "users" table: - | First name / Last name | Email address | + | First name | Email address | | User One | one@example.com | | User Two | two@example.com | # Should not see other identity fields or non-default name fields. @@ -34,7 +34,7 @@ Feature: An administrator can browse user accounts | alternativefullnameformat | firstnamephonetic lastname | When I navigate to "Users > Accounts > Browse list of users" in site administration Then the following should exist in the "users" table: - | First name - phonetic / Last name | Email address | + | First name - phonetic | Email address | | Yewzer One | one@example.com | | Yoozare Two | two@example.com | @@ -43,7 +43,7 @@ Feature: An administrator can browse user accounts | showuseridentity | department,profile_field_frog | When I navigate to "Users > Accounts > Browse list of users" in site administration Then the following should exist in the "users" table: - | First name / Last name | Favourite frog | Department | + | First name | Favourite frog | Department | | User One | Kermit | Attack | | User Two | Tree | Defence | And I should not see "Email address" in the "table" "css_element" diff --git a/admin/tool/log/tests/behat/logstore_store_visibility_change.feature b/admin/tool/log/tests/behat/logstore_store_visibility_change.feature index 79e5ebfe53a..39641c02e3d 100644 --- a/admin/tool/log/tests/behat/logstore_store_visibility_change.feature +++ b/admin/tool/log/tests/behat/logstore_store_visibility_change.feature @@ -14,6 +14,6 @@ Feature: In a report, admin can see logstore visibility changes And I click on "Enable" "icon" in the "External database log" "table_row" And I navigate to "Reports > Config changes" in site administration Then the following should exist in the "reportbuilder-table" table: - | User | Plugin | Setting | New value | Original value | + | First name | Plugin | Setting | New value | Original value | | Admin User | logstore_standard | tool_logstore_visibility | 0 | 1 | | Admin User | logstore_database | tool_logstore_visibility | 1 | 0 | diff --git a/admin/tool/task/tests/behat/manage_tasks.feature b/admin/tool/task/tests/behat/manage_tasks.feature index dd27d85f713..3fb58f25d8a 100644 --- a/admin/tool/task/tests/behat/manage_tasks.feature +++ b/admin/tool/task/tests/behat/manage_tasks.feature @@ -62,8 +62,8 @@ Feature: Manage scheduled tasks And I press "Save changes" Then I should see "Changes saved" And the following should not exist in the "admintable" table: - | Name | Component | Minute | Hour | Day | Day of week | Month | - | Log table cleanup | Standard log | */5 | 1 | 2 | 4 | 3 | + | Name | Minute | Hour | Day | Day of week | Month | + | Log table cleanup | */5 | 1 | 2 | 4 | 3 | And I should see "Log table cleanup" in the "tr.table-primary" "css_element" Scenario: Disabled plugin's tasks are labelled as disabled too diff --git a/comment/tests/behat/manage.feature b/comment/tests/behat/manage.feature index 8f59e9dd185..64b231f8cd2 100644 --- a/comment/tests/behat/manage.feature +++ b/comment/tests/behat/manage.feature @@ -17,7 +17,7 @@ Feature: Manage comments made by users Scenario: View and filter site comments When I navigate to "Reports > Comments" in site administration And the following should exist in the "reportbuilder-table" table: - | -0- | Content | Context URL | + | First name | Content | Context URL | | Admin User | Uno | Course: Course 1 | | Admin User | Dos | Course: Course 1 | | Admin User | Tres | Course: Course 1 | diff --git a/enrol/cohort/tests/behat/enrolcohorts.feature b/enrol/cohort/tests/behat/enrolcohorts.feature index 2571dc52cbe..a59b8a48029 100644 --- a/enrol/cohort/tests/behat/enrolcohorts.feature +++ b/enrol/cohort/tests/behat/enrolcohorts.feature @@ -83,11 +83,11 @@ Feature: Cohort enrolment management And I navigate to course participants # Verifies students 1 and 4 are in the cohort and student 2 is not any more. And the following should exist in the "participants" table: - | First name / Last name | Email address | Roles | Groups | + | First name | Email address | Roles | Groups | | Sandra Cole | s1@example.com | Student | Alpha1 cohort | | Jane Doe | s4@example.com | Student | Alpha1 cohort | And the following should not exist in the "participants" table: - | First name / Last name | Email address | Roles | Groups | + | First name | Email address | Roles | Groups | | John Smith | s2@example.com | Student | Alpha1 cohort | @javascript diff --git a/grade/report/grader/tests/behat/switch_views.feature b/grade/report/grader/tests/behat/switch_views.feature index 340d85dc8b4..cbf0db6a000 100644 --- a/grade/report/grader/tests/behat/switch_views.feature +++ b/grade/report/grader/tests/behat/switch_views.feature @@ -48,7 +48,7 @@ Feature: We can change what we are viewing on the grader report And I should see "Manual grade" And I should see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | -6- | + | -1- | -2- | -3- | -4- | -5- | -6- | | Student 1 | student1@example.com | 80 | 90 | 30 | 170 | And I click on grade item menu "Course 1" of type "course" on "grader" page And I choose "Show totals only" in the open action menu @@ -57,7 +57,7 @@ Feature: We can change what we are viewing on the grader report And I should not see "Manual grade" And I should see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | 170 | And I click on grade item menu "Course 1" of type "course" on "grader" page And I click on "Show grades only" "link" @@ -66,7 +66,7 @@ Feature: We can change what we are viewing on the grader report And I should see "Manual grade" And I should not see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | 80 | 90 | 30 | @javascript @skip_chrome_zerosize @@ -83,7 +83,7 @@ Feature: We can change what we are viewing on the grader report And I should see "Manual grade" And I should see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | -6- | + | -1- | -2- | -3- | -4- | -5- | -6- | | Student 1 | student1@example.com | 80 | - | 30 | 105.71 | And I click on grade item menu "Course 1" of type "course" on "grader" page And I choose "Show totals only" in the open action menu @@ -92,7 +92,7 @@ Feature: We can change what we are viewing on the grader report And I should not see "Manual grade" And I should see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | 105.71 | And I click on grade item menu "Course 1" of type "course" on "grader" page When I click on "Show grades only" "link" @@ -101,5 +101,5 @@ Feature: We can change what we are viewing on the grader report And I should see "Manual grade" And I should not see "Course total" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | 80 | - | 30 | diff --git a/grade/report/grader/tests/behat/tertiary_name_filter.feature b/grade/report/grader/tests/behat/tertiary_name_filter.feature index b3bf044c9ae..a7b3928371e 100644 --- a/grade/report/grader/tests/behat/tertiary_name_filter.feature +++ b/grade/report/grader/tests/behat/tertiary_name_filter.feature @@ -155,10 +155,10 @@ Feature: Within the grader report, test that we can open our generic filter drop When I press "Apply" And the field "Search users" matches value "Student 1" Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | - | And the following should not exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Teacher 1 | teacher1@example.com | - | | Dummy User | student2@example.com | - | | User Example | student3@example.com | - | @@ -168,7 +168,7 @@ Feature: Within the grader report, test that we can open our generic filter drop And I select "M" in the "First name" "core_grades > initials bar" And I press "Apply" And the following should not exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | - | | Teacher 1 | teacher1@example.com | - | | Dummy User | student2@example.com | - | @@ -180,12 +180,12 @@ Feature: Within the grader report, test that we can open our generic filter drop Given I set the field "Search users" to "User" And I click on "View all results (3)" "option_role" And the following should exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | User Example | student3@example.com | - | | User Test | student4@example.com | - | | Dummy User | student2@example.com | - | And the following should not exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | - | | Teacher 1 | teacher1@example.com | - | | Turtle Manatee | student5@example.com | - | @@ -193,10 +193,10 @@ Feature: Within the grader report, test that we can open our generic filter drop And I select "E" in the "Last name" "core_grades > initials bar" And I press "Apply" Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | User Example | student3@example.com | - | And the following should not exist in the "user-grades" table: - | -1- | -1- | -3- | + | -1- | -2- | -3- | | Student 1 | student1@example.com | - | | Teacher 1 | teacher1@example.com | - | | Dummy User | student2@example.com | - | diff --git a/grade/report/grader/tests/behat/tertiary_navigation_searching.feature b/grade/report/grader/tests/behat/tertiary_navigation_searching.feature index b467b139208..7911f4ced77 100644 --- a/grade/report/grader/tests/behat/tertiary_navigation_searching.feature +++ b/grade/report/grader/tests/behat/tertiary_navigation_searching.feature @@ -279,6 +279,8 @@ Feature: Within the grader report, test that we can search for users And I set the field "Search users" to "User" And I press the enter key And I wait to be redirected + # Sometimes with behat we get unattached nodes causing spurious failures. + And I wait "1" seconds And the following should exist in the "user-grades" table: | -1- | | Dummy User | @@ -289,8 +291,6 @@ Feature: Within the grader report, test that we can search for users | Teacher 1 | | Student 1 | | Turtle Manatee | - # Sometimes with behat we get unattached nodes causing spurious failures. - And I wait "1" seconds And I set the field "Search users" to "ABC" And I wait until "Turtle Manatee" "option_role" exists And I press the tab key diff --git a/grade/report/history/tests/behat/basic_functionality.feature b/grade/report/history/tests/behat/basic_functionality.feature index 0889b4e176b..8e2ca357014 100644 --- a/grade/report/history/tests/behat/basic_functionality.feature +++ b/grade/report/history/tests/behat/basic_functionality.feature @@ -51,7 +51,7 @@ Feature: A teacher checks the grade history report in a course And I navigate to "View > Grade history" in the course gradebook When I press "Submit" Then the following should exist in the "gradereport_history" table: - | First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | + | First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | | Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 | | Student 1 | student1@example.com | apple | Rewarding assignment | | 60.00 | Teacher 1 | | Student 2 | student2@example.com | orange | The greatest assignment ever | | 50.00 | Teacher 1 | @@ -79,7 +79,7 @@ Feature: A teacher checks the grade history report in a course And I press "Finish selecting users" And I press "Submit" And the following should exist in the "gradereport_history" table: - | First name/Last name | Grade item | Original grade | Revised grade | Grader | + | First name | Grade item | Original grade | Revised grade | Grader | | Student 1 | The greatest assignment ever | | 50.00 | Teacher 1 | | Student 1 | Rewarding assignment | | 60.00 | Teacher 1 | | Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 | @@ -96,7 +96,7 @@ Feature: A teacher checks the grade history report in a course And I set the field "Grade item" to "The greatest assignment ever" And I press "Submit" And the following should exist in the "gradereport_history" table: - | First name/Last name | Grade item | Original grade | Revised grade | Grader | + | First name | Grade item | Original grade | Revised grade | Grader | | Student 1 | The greatest assignment ever | | 50.00 | Teacher 1 | | Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 | And the following should not exist in the "gradereport_history" table: @@ -106,7 +106,7 @@ Feature: A teacher checks the grade history report in a course And I set the field "Grader" to "Teacher 1" And I press "Submit" And the following should exist in the "gradereport_history" table: - | First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | + | First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | | Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 | And the following should not exist in the "gradereport_history" table: | Student 1 | The greatest assignment ever | 50.00 | 70.00 | Teacher 2 | @@ -114,5 +114,5 @@ Feature: A teacher checks the grade history report in a course And I click on "id_revisedonly" "checkbox" And I press "Submit" And the following should exist in the "gradereport_history" table: - | First name/Last name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | + | First name | Email address | Favourite food | Grade item | Original grade | Revised grade | Grader | | Student 1 | student1@example.com | apple | The greatest assignment ever | | 50.00 | Teacher 1 | diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index fd58bf8dcf1..948d07fc351 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -93,7 +93,7 @@ Feature: We can use Single view And I press "Save" Then I should see "Grades were set for 1 items" And the following should exist in the "generaltable" table: - | First name (Alternate name) Last name | Grade | + | User full name | Grade | | Ann, Jill, Grainne, Beauchamp | Very good | And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher2" And I click on "Users" "link" in the ".page-toggler" "css_element" diff --git a/grade/tests/behat/grade_import.feature b/grade/tests/behat/grade_import.feature index a5ea6f6feb3..f468d4cefbd 100644 --- a/grade/tests/behat/grade_import.feature +++ b/grade/tests/behat/grade_import.feature @@ -62,7 +62,7 @@ Feature: An admin can import grades into gradebook using a CSV file And I should see "Grade import success" And I click on "Continue" "button" Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | + | -1- | -2- | -3- | -4- | | Student 1 | student1@example.com | 400.00 | 400.00 | | Student 2 | student2@example.com | 50.00 | 50.00 | | Student 3 | student3@example.com | 50.00 | 50.00 | diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature index 2cf19722930..7265ffbbe49 100644 --- a/grade/tests/behat/grade_letter_boundary.feature +++ b/grade/tests/behat/grade_letter_boundary.feature @@ -37,5 +37,5 @@ Feature: We can customise the letter boundary of a course. And I am on "Course 1" course homepage with editing mode off And I navigate to "View > Grader report" in the course gradebook Then the following should exist in the "user-grades" table: - | -1- | -1- |-3- | -4- | + | -1- | -2- |-3- | -4- | | Student 1 | student1@example.com | D | D | diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature index 9c6636e9837..a984da8d62b 100644 --- a/grade/tests/behat/grade_letter_boundary_20160518.feature +++ b/grade/tests/behat/grade_letter_boundary_20160518.feature @@ -38,5 +38,5 @@ Feature: We can customise the letter boundary of a course in gradebook version 2 And I am on "Course 1" course homepage with editing mode off And I navigate to "View > Grader report" in the course gradebook Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | + | -1- | -2- | -3- | -4- | | Student 1 | student1@example.com | F | F | diff --git a/grade/tests/behat/grade_regrade_do_not_override.feature b/grade/tests/behat/grade_regrade_do_not_override.feature index d20e68ed24c..0dd89994422 100644 --- a/grade/tests/behat/grade_regrade_do_not_override.feature +++ b/grade/tests/behat/grade_regrade_do_not_override.feature @@ -32,8 +32,8 @@ Feature: Regrading grades does not unnecessarily mark some as overriden And I press "Save changes" And I am on the "Course 1" "grades > Grader report > View" page And the following should exist in the "gradereport-grader-table" table: - | | | | - | First name / Last name | Assignment 1 | Course total | + | -1- | -3- | -4- | + | First name | Assignment 1 | Course total | | Student 1 | 80.00 | 80.00 | | Student 2 | 60.00 | 60.00 | And I turn editing mode on @@ -64,7 +64,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden When I am on the "Course 1" "grades > Grader report > View" page And I turn editing mode off Then the following should exist in the "gradereport-grader-table" table: - | | | | - | First name / Last name | Assignment 1 | Course total | + | -1- | -3- | -4- | + | First name | Assignment 1 | Course total | | Student 1 | 90.00 | 180.00 | | Student 2 | 70.00 | 160.00 | diff --git a/grade/tests/behat/grade_scales.feature b/grade/tests/behat/grade_scales.feature index 64d12675198..fee7dd54f35 100644 --- a/grade/tests/behat/grade_scales.feature +++ b/grade/tests/behat/grade_scales.feature @@ -73,7 +73,7 @@ Feature: View gradebook when scales are used Scenario: Test displaying scales in gradebook in aggregation method Natural When I turn editing mode off Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | A | 5.00 | 5.00 | | Student 2 | student2@example.com | B | 4.00 | 4.00 | | Student 3 | student3@example.com | C | 3.00 | 3.00 | @@ -116,7 +116,7 @@ Feature: View gradebook when scales are used | Minimum grade | 1 | And I turn editing mode off Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | A | 5.00 | | | Student 2 | student2@example.com | B | 4.00 | | | Student 3 | student3@example.com | C | 3.00 | | diff --git a/grade/tests/behat/grade_single_item_scales.feature b/grade/tests/behat/grade_single_item_scales.feature index 18889649ce4..16024ed456d 100644 --- a/grade/tests/behat/grade_single_item_scales.feature +++ b/grade/tests/behat/grade_single_item_scales.feature @@ -58,7 +58,7 @@ Feature: View gradebook when single item scales are used Scenario: Test displaying single item scales in gradebook in aggregation method Natural When I turn editing mode off Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | Ace! | 1.00 | 1.00 | And the following should exist in the "user-grades" table: | -1- | -2- | -3- | -4- | @@ -92,7 +92,7 @@ Feature: View gradebook when single item scales are used | Category name | Sub category () | And I turn editing mode off Then the following should exist in the "user-grades" table: - | -1- | -1- | -3- | -4- | -5- | + | -1- | -2- | -3- | -4- | -5- | | Student 1 | student1@example.com | Ace! | | | | Student 2 | student2@example.com | - | - | - | And the following should exist in the "user-grades" table: diff --git a/grade/tests/behat/toggle_grade_categories.feature b/grade/tests/behat/toggle_grade_categories.feature index 3eed4f6f0f3..0e2e47445f0 100644 --- a/grade/tests/behat/toggle_grade_categories.feature +++ b/grade/tests/behat/toggle_grade_categories.feature @@ -78,14 +78,12 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Course | And I should see "Course" in the "setup-grades" "table" And "Expand" "link" should exist in the "Course" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment one | - | Category 1 | - | Test assignment two | - | Manual grade | - | Category 1 total | - | Course total | + And I should not see "Test assignment one" in the "setup-grades" "table" + And I should not see "Category 1" in the "setup-grades" "table" + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" + And I should not see "Course total" in the "setup-grades" "table" # Expand the grade category 'Course'. 'Category 1' should be still collapsed. And I click on "Expand" "link" in the "Course" "table_row" And the following should exist in the "setup-grades" table: @@ -96,11 +94,9 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Course total | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" Scenario: A teacher can see the aggregated max grade for a grade category even when the category is collapsed Given the following should exist in the "setup-grades" table: @@ -150,11 +146,9 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Category 1 | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" # Expand the grade category 'Category 1'. And I click on "Expand" "link" in the "Category 1" "table_row" And the following should exist in the "setup-grades" table: @@ -172,12 +166,10 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade And I click on "Collapse" "link" in the "Course" "table_row" And I should see "Course" in the "setup-grades" "table" And "Expand" "link" should exist in the "Course" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment one | - | Category 1 | - | Test assignment two | - | Manual grade | + And I should not see "Test assignment one" in the "setup-grades" "table" + And I should not see "Category 1" in the "setup-grades" "table" + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" # Expand the grade category 'Course'. 'Category 1' should be still collapsed. And I click on "Expand" "link" in the "Course" "table_row" And the following should exist in the "setup-grades" table: @@ -187,11 +179,9 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Category 1 | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" Scenario: Previously collapsed categories are still shown as collapsed when a teacher navigates back to Gradebook setup # Collapse the grade category 'Category 1' and navigate to the course homepage. @@ -206,11 +196,9 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Course total | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" Scenario: Previously collapsed categories are still shown as collapsed when a teacher is moving grade items in Gradebook setup # Collapse the grade category 'Category 1'. @@ -224,11 +212,9 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Category 1 | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" Scenario: Grade categories are shown as collapsed only to the teacher that collapsed them # Collapse the grade category 'Category 1'. @@ -256,8 +242,6 @@ Feature: Teachers can toggle the visibility of the grade categories in the Grade | Course total | And "Collapse" "link" should exist in the "Course" "table_row" And "Expand" "link" should exist in the "Category 1" "table_row" - And the following should not exist in the "setup-grades" table: - | Name | - | Test assignment two | - | Manual grade | - | Category 1 total | + And I should not see "Test assignment two" in the "setup-grades" "table" + And I should not see "Manual grade" in the "setup-grades" "table" + And I should not see "Category 1 total" in the "setup-grades" "table" diff --git a/group/tests/behat/private_groups.feature b/group/tests/behat/private_groups.feature index 87f9db427f1..3d8b6655239 100644 --- a/group/tests/behat/private_groups.feature +++ b/group/tests/behat/private_groups.feature @@ -56,7 +56,7 @@ Feature: Private groups Scenario: Participants in "Visible" groups see their membership and other members: Given I am on the "C1" "enrolled users" page logged in as "student1" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | No groups | | Student 3 | No groups | @@ -69,7 +69,7 @@ Feature: Private groups Scenario: Participants in "Only visible to members" groups see their membership and other members, plus "Visible" Given I am on the "C1" "enrolled users" page logged in as "student2" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation | | Student 3 | No groups | @@ -82,7 +82,7 @@ Feature: Private groups Scenario: Participants in "Only see own membership" groups see their membership but not other members, plus "Visible" Given I am on the "C1" "enrolled users" page logged in as "student3" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | No groups | | Student 3 | Only see own membership | @@ -95,7 +95,7 @@ Feature: Private groups Scenario: Participants in "Not visible" groups do not see that group, do see "Visible" Given I am on the "C1" "enrolled users" page logged in as "student4" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | No groups | | Student 3 | No groups | @@ -108,7 +108,7 @@ Feature: Private groups Scenario: View participants list as a teacher: Given I am on the "C1" "enrolled users" page logged in as "teacher1" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | Only visible to members/Non-Participation, Only visible to members/Participation | | Student 3 | Only see own membership | @@ -125,10 +125,10 @@ Feature: Private groups And I set the field "Type or select..." to "Only see own membership" And I click on "Apply filters" "button" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 3 | Only see own membership | And the following should not exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 7 | No groups | @javascript @@ -138,7 +138,7 @@ Feature: Private groups And I set the field "Type or select..." to "No group" And I click on "Apply filters" "button" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 2 | No groups | | Student 4 | No groups | | Student 6 | No groups | @@ -153,7 +153,7 @@ Feature: Private groups And I set the field "Type or select..." to "Only see own membership" And I click on "Apply filters" "button" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 2 | No groups | | Student 4 | No groups | @@ -170,7 +170,7 @@ Feature: Private groups And I set the field "Type or select..." to "No group" And I click on "Apply filters" "button" Then the following should exist in the "participants" table: - | First name / Surname | Groups | + | First name | Groups | | Student 1 | Visible/Non-Participation, Visible/Participation | | Student 3 | Only see own membership | | Student 5 | Visible/Non-Participation, Visible/Participation | diff --git a/mod/forum/report/summary/tests/behat/course_summary.feature b/mod/forum/report/summary/tests/behat/course_summary.feature index 4357c493bca..c805c704a88 100644 --- a/mod/forum/report/summary/tests/behat/course_summary.feature +++ b/mod/forum/report/summary/tests/behat/course_summary.feature @@ -60,12 +60,12 @@ Feature: Course level forum summary report And I should see "Export posts" And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | | | - | First name / Last name | -3- | -4- | Earliest post | Most recent post | + | First name | -3- | -4- | Earliest post | Most recent post | | Student 1 | 1 | 1 | Thursday, 28 March 2019, 11:50 | Thursday, 6 June 2019, 6:40 | | Student 2 | 0 | 0 | - | - | | Teacher 1 | 1 | 2 | Wednesday, 27 March 2019, 12:10 | Wednesday, 10 July 2019, 9:30 | And the following should not exist in the "forumreport_summary_table" table: - | First name / Last name | + | First name | | Student 3 | And the "Forum selected" select box should contain "All forums in course" And the "Forum selected" select box should contain "forum1" @@ -76,13 +76,13 @@ Feature: Course level forum summary report And I should not see "Export posts" And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | | | - | First name / Last name | -3- | -4- | Earliest post | Most recent post | + | First name | -3- | -4- | Earliest post | Most recent post | | Student 1 | 2 | 3 | Thursday, 25 January 2018, 4:40 | Saturday, 25 January 2020, 11:50 | | Student 2 | 0 | 0 | - | - | | Teacher 1 | 4 | 3 | Sunday, 14 January 2018, 9:00 | Thursday, 26 December 2019, 9:30 | And the following should not exist in the "forumreport_summary_table" table: - | First name / Last name | - | Student 3 | + | First name | + | Student 3 | Scenario: Course forum summary report correctly formats forum activity names Given the "multilang" filter is "on" @@ -104,10 +104,10 @@ Feature: Course level forum summary report And I navigate to "Reports" in current page administration And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | | | - | First name / Last name | -2- | -3- | Earliest post | Most recent post | + | First name | -2- | -3- | Earliest post | Most recent post | | Student 1 | 0 | 1 | Thursday, 25 January 2018, 4:40 | Thursday, 25 January 2018, 4:40 | And the following should not exist in the "forumreport_summary_table" table: - | First name / Last name | + | First name | | Student 2 | | Student 3 | | Teacher 1 | @@ -119,10 +119,10 @@ Feature: Course level forum summary report Then I select "All forums in course" from the "Forum selected" singleselect And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | | | - | First name / Last name | -2- | -3- | Earliest post | Most recent post | + | First name | -2- | -3- | Earliest post | Most recent post | | Student 1 | 2 | 3 | Thursday, 25 January 2018, 4:40 | Saturday, 25 January 2020, 11:50 | And the following should not exist in the "forumreport_summary_table" table: - | First name / Last name | + | First name | | Student 2 | | Student 3 | | Teacher 1 | diff --git a/mod/forum/report/summary/tests/behat/summary_filter_groups.feature b/mod/forum/report/summary/tests/behat/summary_filter_groups.feature index 3c24a189f8b..b57692e7da4 100644 --- a/mod/forum/report/summary/tests/behat/summary_filter_groups.feature +++ b/mod/forum/report/summary/tests/behat/summary_filter_groups.feature @@ -67,7 +67,7 @@ Feature: Groups report filter is available if groups exist Then "Groups" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Student 2 | 0 | 0 | | Teacher 1 | 2 | 2 | @@ -103,7 +103,7 @@ Feature: Groups report filter is available if groups exist And "Groups (all)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Student 2 | 0 | 0 | | Teacher 1 | 2 | 2 | @@ -115,7 +115,7 @@ Feature: Groups report filter is available if groups exist Then "Groups" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Student 2 | 0 | 0 | | Teacher 1 | 2 | 2 | @@ -128,7 +128,7 @@ Feature: Groups report filter is available if groups exist And "Groups (3)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Teacher 1 | 1 | 2 | And I should not see "Student 2" @@ -137,7 +137,7 @@ Feature: Groups report filter is available if groups exist And "Groups (3)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Teacher 1 | 1 | 2 | And I should not see "Student 2" @@ -149,7 +149,7 @@ Feature: Groups report filter is available if groups exist Then "Groups" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 0 | 0 | | Student 2 | 1 | 2 | | Teacher 1 | 3 | 1 | @@ -161,7 +161,7 @@ Feature: Groups report filter is available if groups exist And "Groups (2)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 0 | 0 | | Student 2 | 1 | 1 | | Teacher 1 | 2 | 1 | @@ -172,7 +172,7 @@ Feature: Groups report filter is available if groups exist And I navigate to "Reports" in current page administration Then the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 0 | 0 | | Student 2 | 1 | 2 | | Teacher 1 | 3 | 1 | @@ -183,7 +183,7 @@ Feature: Groups report filter is available if groups exist And "Groups (1)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 0 | 0 | | Student 2 | 1 | 1 | | Teacher 1 | 1 | 0 | @@ -196,7 +196,7 @@ Feature: Groups report filter is available if groups exist Then "Groups" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Student 2 | 0 | 0 | | Teacher 1 | 2 | 2 | @@ -225,7 +225,7 @@ Feature: Groups report filter is available if groups exist And "Groups (2)" "button" should exist Then the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Teacher 1 | 2 | 3 | And I should not see "Student 2" @@ -234,7 +234,7 @@ Feature: Groups report filter is available if groups exist And "Groups (2)" "button" should exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | - | First name / Last name | -3- | -4- | + | First name | -3- | -4- | | Student 1 | 1 | 1 | | Teacher 1 | 2 | 3 | And I should not see "Student 2" diff --git a/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature b/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature index 87f4f237da7..ee5963e132d 100644 --- a/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature +++ b/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature @@ -54,7 +54,7 @@ Feature: Groups report filter is not available if no groups exist Then "Groups" "button" should not exist And the following should exist in the "forumreport_summary_table" table: # | | Discussions | - | First name / Last name | -3- | + | First name | -3- | | Teacher 1 | 2 | | Student 1 | 1 | | Student 2 | 0 | diff --git a/report/configlog/tests/behat/view_report.feature b/report/configlog/tests/behat/view_report.feature index 0df50d4af7c..8f510217bd2 100644 --- a/report/configlog/tests/behat/view_report.feature +++ b/report/configlog/tests/behat/view_report.feature @@ -17,7 +17,7 @@ Feature: In a report, admin can see configuration changes Scenario: Display configuration changes report When I navigate to "Reports > Config changes" in site administration Then the following should exist in the "reportbuilder-table" table: - | User | Plugin | Setting | New value | Original value | + | First name | Plugin | Setting | New value | Original value | | Admin User | quiz | initialnumfeedbacks | 5 | 2 | | Admin User | folder | maxsizetodownload | 2048 | 0 | | Admin User | core | defaultcity | Perth | | diff --git a/reportbuilder/tests/behat/audience.feature b/reportbuilder/tests/behat/audience.feature index 115f08db891..887d58bec36 100644 --- a/reportbuilder/tests/behat/audience.feature +++ b/reportbuilder/tests/behat/audience.feature @@ -250,7 +250,7 @@ Feature: Configure access to reports based on intended audience And I am on the "My report" "reportbuilder > Editor" page logged in as "admin" When I click on the "Access" dynamic tab Then the following should exist in the "reportbuilder-table" table: - | -0- | Email address | Fruit | + | -1- | Email address | Fruit | | User 1 | user1@example.com | Apple | | User 2 | user2@example.com | Banana | | User 3 | user3@example.com | Banana | diff --git a/user/tests/behat/table_sorting.feature b/user/tests/behat/table_sorting.feature index 9d0946f06d5..67b374b87a2 100644 --- a/user/tests/behat/table_sorting.feature +++ b/user/tests/behat/table_sorting.feature @@ -20,7 +20,7 @@ Feature: Tables can be sorted by additional names Scenario: All user names are show and sortable in the administration user list. Given I navigate to "Users > Accounts > Browse list of users" in site administration Then the following should exist in the "users" table: - | First name / Middle name / Alternate name / Last name | Email address | + | First name | Email address | | Admin User | moodle@example.com | | Annie Faith Anne Edison | student1@example.com | | George David Gman Bradley | student2@example.com |