Minor - Add document behat tests

pull/3432/head
Julio Montoya 4 years ago
parent 0dcdeec7f7
commit 387c1f35cc
  1. 2
      .github/workflows/php.yml
  2. 6
      assets/vue/components/ConfirmDelete.vue
  3. 2
      tests/behat/features/bootstrap/FeatureContext.php
  4. 31
      tests/behat/features/toolDocument.feature

@ -189,6 +189,8 @@ jobs:
../../vendor/behat/behat/bin/behat features/adminFillUsers.feature -vvv ../../vendor/behat/behat/bin/behat features/adminFillUsers.feature -vvv
../../vendor/behat/behat/bin/behat features/adminSettings.feature -vv ../../vendor/behat/behat/bin/behat features/adminSettings.feature -vv
../../vendor/behat/behat/bin/behat features/career.feature -vvv ../../vendor/behat/behat/bin/behat features/career.feature -vvv
../../vendor/behat/behat/bin/behat features/class.feature -vvv
#../../vendor/behat/behat/bin/behat features/companyReports.feature -vvv
../../vendor/behat/behat/bin/behat features/course.feature -vvv ../../vendor/behat/behat/bin/behat features/course.feature -vvv
../../vendor/behat/behat/bin/behat features/course_user_registration.feature -vv ../../vendor/behat/behat/bin/behat features/course_user_registration.feature -vv
../../vendor/behat/behat/bin/behat features/createUser.feature -vvv ../../vendor/behat/behat/bin/behat features/createUser.feature -vvv

@ -9,15 +9,13 @@
<b-button <b-button
color="error darken-1" color="error darken-1"
@click="handleDelete" @click="handleDelete"
> >{{ $t('Yes') }}
{{ $t('Delete') }}
</b-button> </b-button>
<b-button <b-button
color="secondary darken-1" color="secondary darken-1"
text text
@click.stop="show = false" @click.stop="show = false"
> >{{ $t('No') }}
{{ $t('Cancel') }}
</b-button> </b-button>
</b-card> </b-card>
</b-modal> </b-modal>

@ -440,7 +440,7 @@ class FeatureContext extends MinkContext
*/ */
public function waitForThePageToBeLoaded() public function waitForThePageToBeLoaded()
{ {
$this->getSession()->wait(5000); $this->getSession()->wait(3000);
} }
/** /**

@ -5,10 +5,10 @@ Feature: Document tool
Background: Background:
Given I am a platform administrator Given I am a platform administrator
And I am on course "TEMP" homepage And I am on course "TEMP" homepage
Scenario: Create a folder
Then I follow "document" Then I follow "document"
And wait the page to be loaded when ready And wait the page to be loaded when ready
Scenario: Create a folder
Then I should see "New folder" Then I should see "New folder"
Then I press "New folder" Then I press "New folder"
Then I fill in the following: Then I fill in the following:
@ -18,8 +18,6 @@ Feature: Document tool
Then I should see "created" Then I should see "created"
Scenario: Create a folder that already exists Scenario: Create a folder that already exists
Then I follow "document"
And wait the page to be loaded when ready
Then I should see "New folder" Then I should see "New folder"
Then I press "New folder" Then I press "New folder"
And I fill in the following: And I fill in the following:
@ -29,7 +27,6 @@ Feature: Document tool
Then I should see "created" Then I should see "created"
Scenario: Create a text document Scenario: Create a text document
Then I follow "document"
Then I press "New document" Then I press "New document"
And wait for the page to be loaded And wait for the page to be loaded
Then I fill in the following: Then I fill in the following:
@ -45,7 +42,6 @@ Feature: Document tool
# Then I should see "This is my first document" # Then I should see "This is my first document"
Scenario: Create a HTML document Scenario: Create a HTML document
Then I follow "document"
Then I press "New document" Then I press "New document"
And wait for the page to be loaded And wait for the page to be loaded
Then I fill in the following: Then I fill in the following:
@ -63,7 +59,6 @@ Feature: Document tool
# And I should not see "www.chamilo.org" # And I should not see "www.chamilo.org"
Scenario: Upload a document Scenario: Upload a document
Then I follow "document"
Then I press "File upload" Then I press "File upload"
And wait for the page to be loaded And wait for the page to be loaded
Then I attach the file "/public/favicon.ico" to "file_upload" Then I attach the file "/public/favicon.ico" to "file_upload"
@ -74,9 +69,7 @@ Feature: Document tool
Then I should see "favicon.ico" Then I should see "favicon.ico"
Scenario: Search for "My second document" and edit it Scenario: Search for "My second document" and edit it
Then I follow "document"
Then I press "Search" Then I press "Search"
And wait for the page to be loaded
Then I fill in the following: Then I fill in the following:
| search_filter | My second document | | search_filter | My second document |
Then I press "Filter" Then I press "Filter"
@ -89,11 +82,29 @@ Feature: Document tool
Then I fill in the following: Then I fill in the following:
| item_title | My second document edited | | item_title | My second document edited |
Then I press "Submit" Then I press "Submit"
And wait very long for the page to be loaded And wait for the page to be loaded
Then I should see "updated" Then I should see "updated"
Then move backward one page Then move backward one page
And I should see "My second document edited" And I should see "My second document edited"
Scenario: Search for "My second document" and delete it
Then I press "Search"
Then I fill in the following:
| search_filter | My second document |
Then I press "Filter"
And wait very long for the page to be loaded
Then I should see "My second document"
Then I press "Info"
And wait for the page to be loaded
Then I should see "My second document"
Then I press "Delete"
And wait for the page to be loaded
And I press "Yes"
And wait for the page to be loaded
Then I should see "Deleted"
And wait for the page to be loaded
And I should not see "My second document"
# Scenario: Delete simple document # Scenario: Delete simple document

Loading…
Cancel
Save