MDL-50163 behat: Restart session after scenario with switch_window
[moodle.git] / mod / book / tests / behat / log_entries.feature
CommitLineData
978fa462
AA
1@mod @mod_book
2Feature: In a book, verify log entries
3 In order to create log entries
4 As an admin
5 I need to perform various actions in a book.
6
131d4ac2 7 @javascript @_switch_window
978fa462
AA
8 Scenario: perform various book actions and verify log entries.
9 Given the following "courses" exist:
10 | fullname | shortname | category | groupmode |
11 | Course 1 | C1 | 0 | 1 |
12 And I log in as "admin"
221210e9 13 And I am on site homepage
978fa462
AA
14 And I follow "Course 1"
15 And I turn editing mode on
16 When I add a "Book" to section "1" and I fill the form with:
17 | Name | Test book |
18 | Description | A book about dreams! |
19 And I follow "Test book"
20 And I set the following fields to these values:
21 | Chapter title | First chapter |
22 | Content | First chapter |
23 And I press "Save changes"
24 And I click on "Add new chapter" "link" in the "Table of contents" "block"
25 And I set the following fields to these values:
26 | Chapter title | Second chapter |
27 | Content | Second chapter |
28 And I press "Save changes"
29 And I click on "Edit" "link" in the "Table of contents" "block"
30 And I set the following fields to these values:
31 | Chapter title | First chapter edited |
32 | Content | First chapter edited |
33 And I press "Save changes"
34 And I click on "Next" "link"
35 And I click on "Previous" "link"
36 And I click on "Print book" "link" in the "Administration" "block"
37 And I click on "Generate IMS CP" "link" in the "Administration" "block"
38 And I click on "Logs" "link" in the "Administration" "block"
39 Then I should see "Book exported"
40 And I should see "Book printed"
41 And I should see "Chapter viewed" in the "#report_log_r2_c5" "css_element"
42 And I should see "Chapter viewed" in the "#report_log_r3_c5" "css_element"
43 And I should see "Chapter viewed" in the "#report_log_r4_c5" "css_element"
44 And I should see "Chapter updated" in the "#report_log_r5_c5" "css_element"
45 And I should see "Chapter viewed" in the "#report_log_r6_c5" "css_element"
46 And I should see "Chapter created" in the "#report_log_r7_c5" "css_element"
47 And I should see "Chapter created" in the "#report_log_r9_c5" "css_element"
48 And I click on "Chapter viewed" "link" in the "#report_log_r2_c5" "css_element"
49 And I switch to "action" window
50 And I should see "1 First chapter edited" in the ".book_content" "css_element"
51 And I switch to the main window
52 And I click on "Chapter viewed" "link" in the "#report_log_r3_c5" "css_element"
53 And I switch to "action" window
54 And I should see "2 Second chapter" in the ".book_content" "css_element"
55 And I switch to the main window
56 And I click on "Chapter updated" "link" in the "#report_log_r5_c5" "css_element"
57 And I switch to "action" window
58 And I should see "1 First chapter edited" in the ".book_content" "css_element"
59 And I switch to the main window
60 And I click on "Chapter created" "link" in the "#report_log_r7_c5" "css_element"
61 And I switch to "action" window
62 And I should see "2 Second chapter" in the ".book_content" "css_element"
63 And I switch to the main window
64 And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element"
65 And I switch to "action" window
66 And I should see "1 First chapter edited" in the ".book_content" "css_element"
221210e9 67 And I switch to the main window