HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/moodleAW/moodle405/course/tests/behat/move_sections.feature
@core @core_course
Feature: Sections can be moved
  In order to rearrange my course contents
  As a teacher
  I need to move sections up and down

  Background:
    Given the following "users" exists:
      | username | firstname | lastname | email |
      | teacher1 | Teacher | 1 | teacher1@asd.com |
    And the following "courses" exists:
      | fullname | shortname | format | coursedisplay | numsections |
      | Course 1 | C1 | topics | 0 | 5 |
    And the following "course enrolments" exists:
      | user | course | role |
      | teacher1 | C1 | editingteacher |
    And I log in as "teacher1"
    And I follow "Course 1"
    And I turn editing mode on

  Scenario: Move up and down a section with Javascript disabled in a single page course
    Given I add a "Forum" to section "1" and I fill the form with:
      | Forum name | Test forum name |
      | Description | Test forum description |
    When I move down section "1"
    Then I should see "Test forum name" in the "#section-2" "css_element"
    And I move up section "2"
    And I should see "Test forum name" in the "#section-1" "css_element"

  Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode
    Given I click on "Edit settings" "link" in the "Administration" "block"
    And I fill the moodle form with:
      | Course layout | Show one section per page |
    And I press "Save changes"
    And I add a "Forum" to section "1" and I fill the form with:
      | Forum name | Test forum name |
      | Description | Test forum description |
    When I move down section "1"
    Then I should see "Test forum name" in the "#section-2" "css_element"
    And I move up section "2"
    And I should see "Test forum name" in the "#section-1" "css_element"

  Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode
    Given I click on "Edit settings" "link" in the "Administration" "block"
    And I fill the moodle form with:
      | Course layout | Show one section per page |
    And I press "Save changes"
    And I add a "Forum" to section "2" and I fill the form with:
      | Forum name | Test forum name |
      | Description | Test forum description |
    When I follow "Topic 2"
    Then "#section-1" "css_element" should not exists
    And "#section-3" "css_element" should not exists
    And "Move down" "link" should not exists
    And "Move up" "link" should not exists