Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Acceptance testing/Compatibility changes: Difference between revisions

From MoodleDocs
(This page will not be migrated to new devdocs)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:WillNotMigrate}}
As new features are developed for Moodle, some UI changes can cause changes which unfortunately affect behat feature files. This page is intended to document important compatibility changes for behat test developers.
As new features are developed for Moodle, some UI changes can cause changes which unfortunately affect behat feature files. This page is intended to document important compatibility changes for behat test developers.
= Compatibility changes =
= Compatibility changes =
== Moodle 3.3 ==
== Moodle 3.3 ==
=== And I follow "Course 1" ===
=== And I follow "Course 1" ===
<b>Summary</b>
<b>Summary</b>
Line 17: Line 17:
|Moodle 3.1.6, 3.2.3 and up.  
|Moodle 3.1.6, 3.2.3 and up.  
|}
|}
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 23: Line 22:
|-
|-
|Before
|Before
|<code>
|<syntaxhighlight lang="php">
Scenario: I am on the course homepage
Scenario: I am on the course homepage
     When I log in as "student1"
     When I log in as "student1"
Line 29: Line 28:
     And I follow "Course 1"
     And I follow "Course 1"
     Then I should see "Topic 1"
     Then I should see "Topic 1"
</code>
</syntaxhighlight>
|-
|-
|After
|After
|<code>
|<syntaxhighlight lang="php">
Scenario: I am on the course homepage
Scenario: I am on the course homepage
     When I log in as "student1"
     When I log in as "student1"
     And I am on "Course 1" course homepage
     And I am on "Course 1" course homepage
     Then I should see "Topic 1"
     Then I should see "Topic 1"
</code>
</syntaxhighlight>
|}
|}
<b>Why did this change?</b>
<b>Why did this change?</b>


UI changes in the new dashboard mean the existing 'loose' step matches multiple values. The replacement step should help speed up your tests.
UI changes in the new dashboard mean the existing 'loose' step matches multiple values. The replacement step should help speed up your tests.
== Moodle 3.2 ==
== Moodle 3.2 ==
=== And I click on "Edit settings" "link" in the "Administration" "block" ===
=== And I click on "Edit settings" "link" in the "Administration" "block" ===
<b>Summary</b>
<b>Summary</b>
{| class="wikitable"
{| class="wikitable"
Line 58: Line 55:
|Moodle 3.2.1, 3.1.4 and up.  
|Moodle 3.2.1, 3.1.4 and up.  
|}
|}
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 64: Line 60:
|-
|-
|Before
|Before
|<code>
|<syntaxhighlight lang="php">
Scenario: Going to course settings
Scenario: Going to course settings
     When I log in as "teacher1"
     When I log in as "teacher1"
     And I follow "Course 1"
     And I follow "Course 1"
     When I click on "Edit settings" "link" in the "Administration" "block"
     When I click on "Edit settings" "link" in the "Administration" "block"
</code>
</syntaxhighlight>
|-
|-
|After
|After
|<code>
|<syntaxhighlight lang="php">
Scenario: Going to course settings
Scenario: Going to course settings
     When I log in as "teacher1"
     When I log in as "teacher1"
     And I am on "Course 1" course homepage
     And I am on "Course 1" course homepage
     When I navigate to "Edit settings" in current page administration
     When I navigate to "Edit settings" in current page administration
</code>
</syntaxhighlight>
|}
|}
<b>Why did this change?</b>
<b>Why did this change?</b>
Line 83: Line 79:
The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.
The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.


Note: since 4.0 ''Edit Settings'' has been changed into ''Settings''. Refs: MDL-72093.
=== And I navigate to "Participants" node in "My courses > C1" ===
=== And I navigate to "Participants" node in "My courses > C1" ===
<b> Summary </b>
<b> Summary </b>
Line 101: Line 98:
|-
|-
|Before
|Before
|<code>
|<syntaxhighlight lang="php">
Scenario: Going to course settings
Scenario: Going to course settings
     When I log in as "student1"
     When I log in as "student1"
     And I follow "Course 1"
     And I follow "Course 1"
     And I navigate to "Participants" node in "Current course > C1"
     And I navigate to "Participants" node in "Current course > C1"
</code>
</syntaxhighlight>
|-
|-
|After
|After
|<code>
|<syntaxhighlight lang="php">
Scenario: Going to course participants  
Scenario: Going to course participants  
     When I log in as "student1"
     When I log in as "student1"
     And I follow "Course 1"
     And I follow "Course 1"
     And I navigate to course participants"
     And I navigate to course participants
</code>
</syntaxhighlight>
|}
|}
<b> Why did this change? </b>
<b> Why did this change? </b>


The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.
The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.
== Moodle 3.1 ==
== Moodle 3.1 ==
=== Behat migration from 2.5 to 3.x ===
=== Behat migration from 2.5 to 3.x ===
Behat 3 brings a lot of extensibility and modularity but there are compatibility changes for running tests and writing step definitions. See [[Acceptance testing/Migrating from Behat 2.5 to 3.x in Moodle]] for fully details when coming from earlier versions of Moodle.
Behat 3 brings a lot of extensibility and modularity but there are compatibility changes for running tests and writing step definitions. See [[Acceptance testing/Migrating from Behat 2.5 to 3.x in Moodle]] for fully details when coming from earlier versions of Moodle.
= See also =
= See also =
* [[Running_acceptance_test]]
* [[Running_acceptance_test]]
[[Category:Quality Assurance]]
[[Category:Quality Assurance]]
[[Category:Behat]]

Latest revision as of 14:37, 22 August 2023


Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable.


As new features are developed for Moodle, some UI changes can cause changes which unfortunately affect behat feature files. This page is intended to document important compatibility changes for behat test developers.

Compatibility changes

Moodle 3.3

And I follow "Course 1"

Summary

Previous step/s: And I follow "Course 1"
New step/s And I am on "Course 1" course homepage
And I am on "Course 1" course homepage with editing mode on
Backported to: Moodle 3.1.6, 3.2.3 and up.
Examples
Before
Scenario: I am on the course homepage
    When I log in as "student1"
    And I am on site homepage
    And I follow "Course 1"
    Then I should see "Topic 1"
After
Scenario: I am on the course homepage
    When I log in as "student1"
    And I am on "Course 1" course homepage
    Then I should see "Topic 1"

Why did this change?

UI changes in the new dashboard mean the existing 'loose' step matches multiple values. The replacement step should help speed up your tests.

Moodle 3.2

And I click on "Edit settings" "link" in the "Administration" "block"

Summary

Previous step/s: And I click on "Edit settings" "link" in the "Administration" "block"
New step/s And I navigate to "Edit settings" in current page administration
Backported to: Moodle 3.2.1, 3.1.4 and up.
Examples
Before
Scenario: Going to course settings
    When I log in as "teacher1"
    And I follow "Course 1"
    When I click on "Edit settings" "link" in the "Administration" "block"
After
Scenario: Going to course settings
    When I log in as "teacher1"
    And I am on "Course 1" course homepage
    When I navigate to "Edit settings" in current page administration

Why did this change?

The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.

Note: since 4.0 Edit Settings has been changed into Settings. Refs: MDL-72093.

And I navigate to "Participants" node in "My courses > C1"

Summary

Previous step/s: And I navigate to "Participants" node in "My courses > C1"
And I navigate to "Site blogs" node in "Site pages"
New step/s And I navigate to course participants
Backported to: Moodle 3.2.1, 3.1.4 and up.
Examples
Before
Scenario: Going to course settings
    When I log in as "student1"
    And I follow "Course 1"
    And I navigate to "Participants" node in "Current course > C1"
After
Scenario: Going to course participants 
    When I log in as "student1"
    And I follow "Course 1"
    And I navigate to course participants

Why did this change?

The boost theme changes how navigation works and the new steps are compatible with boost and bootstrap based themes.

Moodle 3.1

Behat migration from 2.5 to 3.x

Behat 3 brings a lot of extensibility and modularity but there are compatibility changes for running tests and writing step definitions. See Acceptance testing/Migrating from Behat 2.5 to 3.x in Moodle for fully details when coming from earlier versions of Moodle.

See also