Behat - Add document tests using resources.

pull/3064/head
Julio 7 years ago
parent 280630f290
commit 378e17017c
  1. 1
      tests/behat/features/profile.feature
  2. 73
      tests/behat/features/toolDocument.feature

@ -10,6 +10,7 @@ Feature: Profile page
Then I follow "Edit profile"
Then I fill in the following:
| profile_firstname | Andrew |
And wait for the page to be loaded
And I press "Update profile"
And wait for the page to be loaded
Then I should see "Updated"

@ -6,63 +6,52 @@ Feature: Document tool
Given I am a platform administrator
Scenario: Create a folder
Given I am on "/main/document/document.php?cid=1&createdir=1"
Then I should see "Create folder"
Given I am on "/resources/document/files?cid=1&sid=0"
Then I press "New folder"
And I fill in the following:
| dirname | My new directory |
And I press "Create the folder"
Then I should see "Folder created"
| c_document_title | My new directory |
And I press "Save"
Then I should see "Saved"
Scenario: Create a folder that already exists
Given I am on "/main/document/document.php?cid=1&createdir=1"
Then I should see "Create folder"
Given I am on "/resources/document/files?cid=1&sid=0"
Then I press "New folder"
And I fill in the following:
| dirname | My new directory |
And I press "Create the folder"
Then I should see "Unable to create the folder"
| c_document_title | My new directory |
And I press "Save"
Then I should see "Saved"
Scenario: Create a simple document
Given I am on "/main/document/create_document.php?cid=1"
Then I should see "Create a rich media page / activity"
Given I am on "/resources/document/files?cid=1&sid=0"
Then I follow "Create new document"
Then I fill in the following:
| create_document_title | My first document |
And I fill in ckeditor field "content" with "This is my first document!!!"
And I press "Create a rich media page / activity"
Then I should see "Item added"
And I should see "My first document"
Then I follow "My first document"
| c_document_title | My first document |
And I fill in ckeditor field "c_document_content" with "This is my first document!!!"
And I press "Save"
Then I should see "Saved"
And I should see "My first document.html"
Then I follow "My first document.html"
And wait for the page to be loaded
Then I should see "My first document"
Then I should see "This is my first document"
Scenario: Create a HTML document
Given I am on "/main/document/create_document.php?cid=1"
Then I should see "Create a rich media page / activity"
Given I am on "/resources/document/files?cid=1&sid=0"
Then I follow "Create new document"
Then I fill in the following:
| create_document_title | My second document |
And I fill in ckeditor field "content" with "<a href='www.chamilo.org'>Click here</a><span><strong>This is my second document!!!</strong></span>"
And I press "Create a rich media page / activity"
Then I should see "Item added"
And I should see "My second document"
Then I follow "My second document"
| c_document_title | My second document | |
And I fill in ckeditor field "c_document_content" with "<a href='www.chamilo.org'>Click here</a><span><strong>This is my second document!!!</strong></span>"
And I press "Save"
Then I should see "Saved"
And I should see "My second document.html"
Then I follow "My second document.html"
And wait for the page to be loaded
Then I should see "My second document"
Then I should see "This is my second document"
And I should not see "<strong>"
And I should not see "www.chamilo.org"
Scenario: Upload a document
Given I am on "/main/document/upload.php?cid=1"
Then I should see "Upload documents"
Then I follow "Upload (Simple)"
Then I attach the file "/public/favicon.ico" to "file"
When I press "Upload file"
Given I am on "/resources/document/files?cid=1&sid=0"
Then I follow "Upload"
Then I attach the file "/public/favicon.ico" to "fileupload"
And wait for the page to be loaded
Then I should see "File upload succeeded"
# Scenario: Create cloud link
# Given I am on "/main/document/add_link.php?cid=1"
# Then I should see "Add a link"
# And I fill in the following:
# | name | My dropbox link |
# | url | http://dropbox.com/sh/loremipsum/loremipsum?dl=0 |
# And I press "Add link to Cloud file"
# Then I should see "Cloud link added"

Loading…
Cancel
Save