1 |
efrain |
1 |
@tool_behat
|
|
|
2 |
Feature: Behat steps for interacting with form work
|
|
|
3 |
In order to test my Moodle code
|
|
|
4 |
As a developer
|
|
|
5 |
I need the Behat steps for form elements to work reliably
|
|
|
6 |
|
|
|
7 |
@javascript
|
|
|
8 |
Scenario: Test fields in containers
|
|
|
9 |
Given the following "courses" exist:
|
|
|
10 |
| fullname | shortname | summary | summaryformat |
|
|
|
11 |
| Course 1 | C1 | Red | 1 |
|
|
|
12 |
When I log in as "admin"
|
|
|
13 |
And I am on "Course 1" course homepage
|
|
|
14 |
# Just get to any form.
|
|
|
15 |
And I navigate to "Settings" in current page administration
|
|
|
16 |
And I set the field "Course full name" in the "General" "fieldset" to "Frog"
|
|
|
17 |
And I set the following fields in the "Appearance" "fieldset" to these values:
|
|
|
18 |
| Show activity reports | Yes |
|
|
|
19 |
| Number of announcements | 1 |
|
|
|
20 |
And I set the following fields in the "Description" "fieldset" to these values:
|
|
|
21 |
| Course summary | Green |
|
|
|
22 |
Then the field "Show activity reports" in the "Appearance" "fieldset" matches value "Yes"
|
|
|
23 |
And the field "Show activity reports" in the "Appearance" "fieldset" does not match value "No"
|
|
|
24 |
And the following fields in the "region-main" "region" match these values:
|
|
|
25 |
| Course full name | Frog |
|
|
|
26 |
| Number of announcements | 1 |
|
|
|
27 |
| Course summary | Green |
|
|
|
28 |
And the following fields in the "region-main" "region" do not match these values:
|
|
|
29 |
| Course full name | Course 1 |
|
|
|
30 |
| Number of announcements | 5 |
|
|
|
31 |
| Course summary | Red |
|