Fix session test.

pull/2487/head
jmontoyaa 8 years ago
parent 8a3c9bc812
commit a762a29721
  1. 11
      main/inc/lib/sessionmanager.lib.php
  2. 40
      tests/behat/features/session.feature

@ -7251,10 +7251,10 @@ class SessionManager
'coach_username',
get_lang('CoachName'),
[api_get_user_id() => $userInfo['complete_name']],
array(
[
'id' => 'coach_username',
'style' => 'width:370px;',
)
]
);
} else {
$sql = "SELECT COUNT(1) FROM $tbl_user WHERE status = 1";
@ -7301,7 +7301,11 @@ class SessionManager
'select',
'coach_username',
get_lang('CoachName'),
$coachesOptions
$coachesOptions,
[
'id' => 'coach_username',
'style' => 'width:370px;'
]
);
} else {
$form->addElement(
@ -7312,6 +7316,7 @@ class SessionManager
[
'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach',
'width' => '100%',
'id' => 'coach_username'
]
);
}

@ -12,10 +12,25 @@ Feature: Session tool
And I press "Add category"
Then I should see "The category has been added"
Scenario: Create a session with hidden description
@javascript
Scenario: Create a session
Given I am on "/main/session/session_add.php"
When I fill in the following:
| name | Session1 |
And I fill in select2 input "#coach_username" with id "1" and value "admin"
And I press "submit"
Then I should see "Add courses to this session (Session1)"
Then I select "TEMP (TEMP)" from "NoSessionCoursesList[]"
And I press "add_course"
And I press "next"
Then I should see "Update successful"
@javascript
Scenario: Create a session with description
Given I am on "/main/session/session_add.php"
When I fill in the following:
| name | Temp Session |
And I fill in select2 input "#coach_username" with id "1" and value "admin"
And I press "advanced_params"
And I fill in ckeditor field "description" with "Description for Temp Session"
And I press "submit"
@ -25,12 +40,12 @@ Feature: Session tool
And I press "next"
Then I should see "Update successful"
Scenario: Check hidden session description
Scenario: Check session description is not present
Given I am on "/user_portal.php?nosession=true"
Then I should see "Temp Session"
And I should not see "Description for Temp Session"
Scenario: Show session description
Scenario: Edit session description setting
Given I am on "/main/session/session_list.php?keyword=Temp+session"
And wait for the page to be loaded
And I follow "Edit"
@ -39,14 +54,18 @@ Feature: Session tool
And I press "submit"
Then I should see "Update successful"
Scenario: Check shown session description with platform setting off
Given I am on "/user_portal.php?nosession=true"
Scenario: Check session description with platform setting off
Given I am a platform administrator
And I am on "/main/admin/settings.php?search_field=show_session_description&category=search_setting"
And I check the "show_session_description" radio button with "false" value
And I press "Save settings"
Then I am on "/user_portal.php?nosession=true"
Then I should see "Temp Session"
And I should not see "Description for Temp Session"
Scenario: Check shown session description with platform setting on
Scenario: Check session description with platform setting on
Given I am a platform administrator
And I am on "/main/admin/settings.php"
And I am on "/main/admin/settings.php?search_field=show_session_description&category=search_setting"
And I check the "show_session_description" radio button with "true" value
And I press "Save settings"
Then I should see "Update successful"
@ -61,6 +80,13 @@ Feature: Session tool
And I confirm the popup
Then I should see "Deleted"
Scenario: Delete session "Session1"
Given I am on "/main/session/session_list.php?keyword=Session1"
And wait for the page to be loaded
And I follow "Delete"
And I confirm the popup
Then I should see "Deleted"
Scenario: Delete session category
Given I am on "/main/session/session_category_list.php"
And I follow "Delete"

Loading…
Cancel
Save