Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Behat failures are genuine errors. #25

Open
lucaboesch opened this issue Nov 12, 2024 · 4 comments
Open

The Behat failures are genuine errors. #25

lucaboesch opened this issue Nov 12, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@lucaboesch
Copy link

Even when reproducing manually, the progress bar is not behaving as intended.
In addition, hovering the progress bars does not show the promised information.
It is in the HTML code, though.

image

I took on up reproducing all this by hand.

  Background:
    Given the following "users" exist:
      | username | firstname | lastname | email            |
      | teacher1 | Teacher   | First        | [email protected] |
      | student1 | Student   | First       | [email protected] |
      | student2 | Student   | Second       | [email protected] |
    And the following "courses" exist:
      | fullname | shortname | format | coursedisplay | numsections | enablecompletion |activityprogress |
      | Course 1 | C1        | designer | 0             | 5           | 1              |  1        |
      | Course 2 | C2        | designer | 0             | 5           | 1              |  1        |
      | Course 3 | C3        | designer | 0             | 5           | 1              |  1        |
      | Course 4 | C4        | designer | 0             | 5           | 1              |  1        |
      | Course 5 | C5        | designer | 0             | 5           | 1              |  1        |
    And the following "activities" exist:
      | activity   | name                   | intro                         | course | idnumber    | section | completion |
      | assign     | Test assignment name   | Test assignment description   | C1     | assign1     | 0       |   1        |
      | assign     | Test assignment name 1 | Test assignment1 description  | C1     | assign2     | 0       |   1        |
      | assign     | Test assignment name 2 | Test assignment2 description  | C1     | assign3     | 0       |   1        |
      | choice     | Test choice name       | Test choice description       | C1     | choice1     | 0       |   1        |
      | assign     | Demo assign 01         | Test assignment 1 description | C2     | assign1     | 0       |   1        |
      | assign     | Demo assign 02         | Test assignment 2 description | C2     | assign2     | 0       |   1        |
      | assign     | Demo assign 03         | Test assignment 3 description | C2     | assign3     | 0       |   1        |
      | assign     | Demo assign 01         | Test assignment 1 description | C3     | assign1     | 0       |   1        |
      | assign     | Demo assign 02         | Test assignment 2 description | C3     | assign2     | 0       |   1        |
      | assign     | Demo assign 01         | Test assignment 1 description | C4     | assign1     | 0       |   1        |
      | assign     | Demo assign 01         | Test assignment 1 description | C5     | assign1     | 0       |   1        |
    And the following "course enrolments" exist:
      | user     | course | role           |
      | teacher1 | C1     | editingteacher |
      | student1 | C1     | student        |
      | teacher1 | C2     | editingteacher |
      | student1 | C2     | student        |
      | teacher1 | C3     | editingteacher |
      | student1 | C3     | student        |
      | teacher1 | C4     | editingteacher |
      | student1 | C4     | student        |
      | teacher1 | C5     | editingteacher |
      | student1 | C5     | student        |

    When I log in as "admin"
    And I am on "Course 4" course homepage with editing mode on
    And I navigate to "Course completion" in current page administration
    And I click on "Condition: Activity completion" "link"
    Then I click on "Select all/none" "link"
    And I press "Save changes"
    And I am on "Course 5" course homepage with editing mode on
    And I navigate to "Course completion" in current page administration
    And I click on "Condition: Activity completion" "link"
    Then I click on "Select all/none" "link"
    And I press "Save changes"
    And I am on "Course 1" course homepage with editing mode on
    And I navigate to "Course completion" in current page administration
    And I click on "Condition: Completion of other courses" "link"
    And I set the following fields to these values:
      | Courses available| Course 4, Course 5|
    And I press "Save changes"
    And I am on "Course 2" course homepage with editing mode on
    And I navigate to "Course completion" in current page administration
    And I click on "Condition: Activity completion" "link"
    Then I click on "Select all/none" "link"
    And I press "Save changes"
    And I am on "Course 3" course homepage with editing mode on
    And I navigate to "Course completion" in current page administration
    And I click on "Condition: Activity completion" "link"
    Then I click on "Select all/none" "link"
    And I click on "Condition: Completion of other courses" "link"
    And I set the following fields to these values:
      | Courses available| Course 4, Course 5|
    And I press "Save changes"

  Scenario: Check the progress bar first case for student
    Given I log in as "student1"
    # Check the course criteria completion.
    Then I am on "Course 1" course homepage
    And ".progress-block .activity-completed-block" "css_element" should exist
    And I should see "0 of 2 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    Then I am on "Course 4" course homepage
    And I should see "0 of 1 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    And the manual completion button of "Demo assign 01" is displayed as "Mark as done"
    And I toggle the manual completion state of "Demo assign 01"
    And I should see "1 of 1 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    Then I am on "Course 1" course homepage
    And I should see "1 of 2 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    Then I am on "Course 5" course homepage
    And I should see "0 of 1 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    And the manual completion button of "Demo assign 01" is displayed as "Mark as done"
    And I toggle the manual completion state of "Demo assign 01"
    And I should see "1 of 1 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    Then I am on "Course 1" course homepage
    And I should see "2 of 2 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    # Check the activity criteria completion.
    Then I am on "Course 2" course homepage
    And ".progress-block .activity-completed-block" "css_element" should exist
    And I should see "0 of 3 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    And the manual completion button of "Demo assign 01" is displayed as "Mark as done"
    And I toggle the manual completion state of "Demo assign 01"
    Then I am on "Course 2" course homepage
    And I should see "1 of 3 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    And the manual completion button of "Demo assign 02" is displayed as "Mark as done"
    And I toggle the manual completion state of "Demo assign 02"
    Then I am on "Course 2" course homepage
    And I should see "2 of 3 criteria completed" in the ".progress-block .activity-completed-block" "css_element"
    And the manual completion button of "Demo assign 03" is displayed as "Mark as done"
    And I toggle the manual completion state of "Demo assign 03"
    Then I am on "Course 2" course homepage
    And I should see "3 of 3 criteria completed" in the ".progress-block .activity-completed-block" "css_element"

@stefanscholz
Copy link
Member

Hi @lucaboesch, nothing is supposed to happen on hover. You're supposed to click 😊

@lucaboesch
Copy link
Author

Unfortunately that doesn't work either.
But something seems happening.
2024-11-12_19-10-17

@stefanscholz
Copy link
Member

On which moodle version are you testing and with which branch?

@stefanscholz
Copy link
Member

I think I can reproduce it with the latest version on 4.4. Will look into it in more detail and update this issue accordingly.

@stefanscholz stefanscholz added the bug Something isn't working label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants