@@ -2,107 +2,126 @@ Feature: Document tool
22 In order to use the document tool
33 The teachers should be able to create and upload files
44
5- Background :
5+
6+ Scenario : Create a folder
67 Given I am a platform administrator
78 And I am on course "TEMP" homepage
9+ And I wait for the page to be loaded
810 Then I follow "Document"
9- And wait the page to be loaded when ready
10-
11- Scenario : Create a folder
12- Then I should see "New folder"
13- Then I press "New folder"
11+ And wait for the page to be loaded
12+ Then I click the "span.mdi-folder-plus" element
13+ And I wait for the page to be loaded
1414 Then I fill in the following:
1515 | title | My new directory |
1616 And I press "Save"
1717 And wait for the page to be loaded
1818 Then I should see "saved"
1919
20+
2021 Scenario : Create a folder that already exists
21- Then I should see "New folder"
22- Then I press "New folder"
22+ Given I am a platform administrator
23+ And I am on course "TEMP" homepage
24+ And I wait for the page to be loaded
25+ Then I follow "Document"
26+ And wait for the page to be loaded
27+ Then I click the "span.mdi-folder-plus" element
28+ And I wait for the page to be loaded
2329 And I fill in the following:
2430 | title | My new directory |
2531 And I press "Save"
26- And wait for the page to be loaded
2732 Then I should see "saved"
2833
34+
2935 Scenario : Create a text document
30- Then I press "New document"
36+ Given I am a platform administrator
37+ And I am on course "TEMP" homepage
38+ And I wait for the page to be loaded
39+ Then I follow "Document"
40+ And wait for the page to be loaded
41+ Then I click the "span.mdi-file-plus" element
3142 And wait for the page to be loaded
3243 Then I fill in the following:
3344 | Title | My first document |
3445 And I fill in tinymce field "item_content" with "This is my first document!"
35- And I press "Submit "
46+ And I press "Save "
3647 And wait for the page to be loaded
3748 Then I should see "created"
3849 And I should see "My first document"
3950 And wait for the page to be loaded
4051
52+
4153 Scenario : Create a HTML document
42- Then I press "New document"
54+ Given I am a platform administrator
55+ And I am on course "TEMP" homepage
56+ And I wait for the page to be loaded
57+ Then I follow "Document"
58+ And wait for the page to be loaded
59+ Then I click the "span.mdi-file-plus" element
4360 And wait for the page to be loaded
4461 Then I fill in the following:
4562 | Title | My second document |
4663 And I fill in tinymce field "item_content" with "<a href='www.chamilo.org'>Click here</a><span><b>This is my second document!!</b></span>"
47- And I press "Submit"
64+ And I click the "span.mdi-content-save" element
4865 And wait for the page to be loaded
4966 Then I should see "created"
5067 And I should see "My second document"
5168
69+
5270 Scenario : Upload a document
53- Then I press "Upload"
71+ Given I am a platform administrator
72+ And I am on course "TEMP" homepage
73+ And I wait for the page to be loaded
74+ Then I follow "Document"
75+ And wait for the page to be loaded
76+ Then I click the "span.mdi-file-upload" element
5477 And wait for the page to be loaded
5578 Then I should see "Drop files here"
5679 Then I attach the file "/public/favicon.ico" to "files[]"
5780 Then I press "Upload 1 file"
5881 And wait for the page to be loaded
59- Then I should see "Complete"
60- Then I move backward one page
61- And wait for the page to be loaded
82+ Then I should see "created"
6283 Then I should see "favicon.ico"
6384
64- # Scenario: Search for "My second document" and edit it
65- # Then I press "Search"
66- # Then I fill in the following:
67- # | search_filter | My second document |
68- # Then I press "Filter"
69- # And wait for the page to be loaded
70- # Then I should not see "My first document"
71- # Then I press "Info"
72- # Then I should see "My second document"
73- # Then I press "Edit"
74- # And wait for the page to be loaded
75- # Then I fill in the following:
76- # | item_title | My second document edited |
77- # Then I press "Submit"
78- # And wait very long for the page to be loaded
79- # Then I should see "updated"
80- # Then move backward one page
81- # And I should see "My second document edited"
82- #
83- # Scenario: Search for "My first document" and delete it
84- # Then I press "Search"
85- # Then I fill in the following:
86- # | search_filter | My first document |
87- # Then I press "Filter"
88- # And wait very long for the page to be loaded
89- # Then I should see "My first document"
90- # Then I press "Info"
91- # And wait for the page to be loaded
92- # Then I should see "My first document"
93- # Then I press "Delete"
94- # And wait for the page to be loaded
95- # And I press "Yes"
96- # And wait for the page to be loaded
97- # Then I should see "Deleted"
98-
99-
100- # Scenario: Delete simple document
101- # Then I follow "document"
102- # Then I press "File upload"
103- # And wait for the page to be loaded
104- # Then I follow "My first document"
105- # Then I should see "Created at"
106- # Then I follow "Delete"
107- # Then I should see "Deleted"
108- # And I should not see "My first document.html"
85+
86+ Scenario : Search for "My second document" and edit it
87+ Given I am a platform administrator
88+ And I am on course "TEMP" homepage
89+ And I wait for the page to be loaded
90+ Then I follow "Documents"
91+ And wait for the page to be loaded
92+ Then I should see "My second document"
93+ Then I click the "span.mdi-pencil" element
94+ And wait for the page to be loaded
95+ Then I fill in the following:
96+ | item_title | My second document edited |
97+ Then I press "Save"
98+ And wait very long for the page to be loaded
99+ Then I should see "My second document edited"
100+
101+
102+ Scenario : Search for "My first document" and delete it
103+ Given I am a platform administrator
104+ And I am on course "TEMP" homepage
105+ And I wait for the page to be loaded
106+ Then I follow "Document"
107+ And wait for the page to be loaded
108+ Then I should see "My first document"
109+ Then I press "Info"
110+ And wait for the page to be loaded
111+ Then I should see "My first document"
112+ Then I press "Delete"
113+ And wait for the page to be loaded
114+ And I press "Yes"
115+ And wait for the page to be loaded
116+ Then I should see "Deleted"
117+
118+
119+ Scenario : Delete simple document
120+ Then I follow "document"
121+ Then I press "File upload"
122+ And wait for the page to be loaded
123+ Then I follow "My first document"
124+ Then I should see "Created at"
125+ Then I follow "Delete"
126+ Then I should see "Deleted"
127+ And I should not see "My first document.html"
0 commit comments