Add link tests and work test

pull/2487/head
jmontoyaa 8 years ago
parent 66ea436b73
commit 836e361a2e
  1. 2
      main/inc/lib/link.lib.php
  2. 45
      tests/behat/features/link.feature
  3. 17
      tests/behat/features/work.feature

@ -405,7 +405,7 @@ class Link extends Model
api_get_user_id()
);
self::delete_link_from_search_engine(api_get_course_id(), $id);
Display:: display_confirmation_message(get_lang('LinkDeleted'));
Display::addFlash(Display::return_message(get_lang('LinkDeleted')));
$result = true;
break;
case 'category':

@ -0,0 +1,45 @@
Feature: Link tool
In order to use the link tool
The teachers should be able to create link categories and links
Background:
Given I am a platform administrator
And I am on course "TEMP" homepage
Scenario: Create a link category
Given I am on "/main/link/link.php?action=addcategory&cidReq=TEMP"
When I fill in the following:
| category_title | Category 1 |
| description | Category description |
And I press "submitCategory"
Then I should see "Category added"
Scenario: Create a link
Given I am on "/main/link/link.php?action=addlink&cidReq=TEMP"
When I fill in the following:
| url | http://www.chamilo.org |
| title | Chamilo |
And I press "submitLink"
Then I should see "The link has been added"
Scenario: Create a link with category
Given I am on "/main/link/link.php?action=addlink&cidReq=TEMP"
When I fill in the following:
| url | http://www.chamilo.org |
| title | Chamilo in category 1 |
And I select "Category 1" from "category_id"
And I press "submitLink"
Then I should see "The link has been added"
Scenario: Delete link
Given I am on "/main/link/link.php?cidReq=TEMP"
And I follow "Delete"
Then I should see "The link has been deleted"
Scenario: Delete link category
Given I am on "/main/link/link.php?cidReq=TEMP"
And I follow "Delete"
Then I should see "The category has been deleted."

@ -0,0 +1,17 @@
Feature: Work tool
In order to use the work tool
The teachers should be able to create works
Background:
Given I am a platform administrator
And I am on course "TEMP" homepage
Scenario: Create a work
Given I am on "/main/work/work.php?action=create_dir&cidReq=TEMP"
When I fill in the following:
| new_dir | Work 1 |
| description | Work description |
And I press "submit"
Then I should see "Directory created"
Loading…
Cancel
Save