Skip to content

Commit

Permalink
CTP-3783 adapt behat to commit c1132f6 2
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Oct 15, 2024
1 parent dc6e0bc commit c498792
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
21 changes: 14 additions & 7 deletions tests/behat/automatic_agreement.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@mod @mod_coursework
@mod @mod_coursework @mod_coursework_automatic_agreement
Feature: Automatic agreement for simple grades

As an user with add/edit coursework capability
Expand All @@ -16,24 +16,31 @@ Feature: Automatic agreement for simple grades
And the submission is finalised
And the coursework deadline has passed

@javascript
Scenario: Only one grade in the submissions
And the coursework "automaticagreementstrategy" setting is "none" in the database
Given I am logged in as a teacher
And I visit the coursework page
And I click on the new feedback button for assessor 1
When I grade the submission as 56 using the simple form
And I expand the coursework grading row
And I click on the only interactable link with title "New feedback"
When I grade the submission as 56 using the ajax form
Then I should not see the final grade on the multiple marker page

@javascript
Scenario: Simple grades within 10% boundaries takes higher mark as a final grade
Given the coursework "automaticagreementstrategy" setting is "percentage_distance" in the database
Given the coursework "automaticagreementrange" setting is "10" in the database
And I am logged in as a teacher
And I visit the coursework page
And I click on the new feedback button for assessor 1
And I grade the submission as 67 using the simple form
And I expand the coursework grading row
And I click on the only interactable link with title "New feedback"
When I grade the submission as 67 using the ajax form
And I log out

And I log in as the other teacher
And I visit the coursework page
And I click on the new feedback button for assessor 2
And I grade the submission as 63 using the simple form
And I expand the coursework grading row
And I click on the only interactable link with title "New feedback"
When I grade the submission as 63 using the ajax form
And I visit the coursework page
Then I should see the final grade as 67 on the multiple marker page
2 changes: 1 addition & 1 deletion tests/behat/behat_mod_coursework.php
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ public function i_should_see_the_title_of_the_coursework_on_the_page() {
$page = $this->get_page('coursework page');

if (!$page->get_coursework_name($this->coursework->name)) {
throw new ExpectationException('Coursework title not seen', $this->getSession());
throw new ExpectationException("Coursework title '{$this->coursework->name}' not seen", $this->getSession());
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/behat/factory.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@mod @mod_coursework
@mod @mod_coursework @mod_coursework_factory
Feature: Testing that the factories for behat steps work. If any tests fail, fix this FIRST.

As a developer maintaining the coursework module
Expand All @@ -11,7 +11,7 @@ Feature: Testing that the factories for behat steps work. If any tests fail, fix
And I am logged in as a teacher
And there is a coursework
When I visit the coursework page
Then I should see the title of the coursework on the page
Then I should see "Coursework 1" in the "#page-header" "css_element"

Scenario: the submission factory works properly and shows the file on the page
Given there is a course
Expand Down
5 changes: 2 additions & 3 deletions tests/behat/feedback_collisions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Collisions: two people try to create feedback at the same time
And I have an assessor feedback at grade 67
And I visit the coursework page
And I expand the coursework grading row
And I click on "New feedback" "link"
And I click on the only interactable link with title "New feedback"
And I grade the submission as 56 using the ajax form

@javascript
Expand All @@ -47,8 +47,7 @@ Feature: Collisions: two people try to create feedback at the same time
And there is final feedback from the other teacher with grade 45
And I expand the coursework grading row
And I wait until the page is ready
And I wait "2" seconds
And I click on "New feedback" "link"
And I click on the only interactable link with title "New feedback"
And I wait until the page is ready
And I wait "2" seconds
And I should see "Allocatable already has feedback for this stage"

0 comments on commit c498792

Please sign in to comment.