Behat - fix tests

pull/3064/head
Julio 6 years ago
parent aa807dd19d
commit ac70aba95c
  1. 1
      public/main/admin/user_update_import.php
  2. 1
      public/main/exercise/answer.class.php
  3. 1
      public/main/exercise/tests_category.php
  4. 1
      public/main/exercise/unique_answer.class.php
  5. 2
      public/main/inc/lib/api.lib.php
  6. 5
      public/main/inc/lib/sessionmanager.lib.php
  7. 5
      public/main/session/add_courses_to_session.php
  8. 3
      src/CoreBundle/Resources/views/Account/edit.html.twig
  9. 4
      tests/behat/features/profile.feature
  10. 2
      tests/behat/features/sessionAccess.feature
  11. 12
      tests/behat/features/sessionManagement.feature
  12. 2
      tests/behat/features/toolExercise.feature

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CQuizAnswer;

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
/**

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CQuizAnswer;

@ -3662,7 +3662,7 @@ function api_not_allowed(
// Default code is 403 forbidden
$responseCode = empty($responseCode) ? 403 : $responseCode;
$message = empty($message) ? get_lang('Not authorized') : $message;
$message = empty($message) ? get_lang('You are not allowed') : $message;
// Create new exception rendered by template:
// src/ThemeBundle/Resources/views/Exception/error.html.twig

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course;
@ -1760,7 +1761,7 @@ class SessionManager
$courses = self::getCoursesInSession($sessionId);
foreach ($courses as $courseId) {
$courseInfo = api_get_course_info_by_id($courseId);
DocumentManager::deleteDocumentsFromSession($courseInfo, $sessionId);
/*DocumentManager::deleteDocumentsFromSession($courseInfo, $sessionId);
$works = Database::select(
'*',
$tbl_student_publication,
@ -1775,7 +1776,7 @@ class SessionManager
Database::query("DELETE FROM $tbl_student_publication_assignment WHERE publication_id = $index");
}
my_delete($currentCourseRepositorySys.'/'.$work['url']);
}
}*/
}
$sessionEntity = api_get_session_entity($sessionId);

@ -1,9 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*
* @todo use formvalidator
*/
$cidReset = true;
@ -80,7 +79,7 @@ function remove_item(origin)
$CourseList = $SessionList = [];
$courses = $sessions = [];
if (isset($_POST['formSent']) && $_POST['formSent']) {
if (isset($_POST['formSent']) && $_POST['formSent'] && isset($_POST['SessionCoursesList'])) {
$courseList = $_POST['SessionCoursesList'];
$copyEvaluation = isset($_POST['copy_evaluation']);
$copyCourseTeachersAsCoach = isset($_POST['import_teachers_as_course_coach']);

@ -2,12 +2,11 @@
{% block content %}
{% autoescape false %}
<h2> {{ 'Edit profile' | trans }}</h2>
<h3>{{ user.username }}</h3>
{{ form_start(form, { 'action': path('chamilo_core_account_edit'), 'attr': { 'class': 'edit' } }) }}
{{ form_widget(form) }}
<div>
<input class="btn btn-primary" type="submit" value="{{ 'Save'|trans }}" />
<input class="btn btn-primary" type="submit" value="{{ 'Update profile'|trans }}" />
</div>
{{ form_end(form) }}
{% endautoescape %}

@ -10,14 +10,14 @@ Feature: Profile page
Then I follow "Edit profile"
Then I fill in the following:
| profile_firstname | Andrew |
And I press "Save"
And I press "Update profile"
And wait for the page to be loaded
Then I should see "Updated"
And I should see "Andrew"
Then I follow "Edit profile"
Then I fill in the following:
| profile_firstname | Andrea |
And I press "Save"
And I press "Update profile"
Then I should see "Updated"
Then I am on "/main/social/home.php"
Then I should see "Andrea"

@ -54,7 +54,7 @@ Feature: Session access
Scenario: ywarnier connect to Session 2
Given I am logged as "ywarnier"
Then I am on course "TEMPPRIVATE" homepage in session "Session2"
Then I should see "You are not allowed"
Then I should see "Unauthorised access to course"
Scenario: ywarnier connect to session that doesn't exists
Given I am logged as "ywarnier"

@ -43,7 +43,7 @@ Feature: Session management tool
Then I should see "Update successful"
Scenario: Check session description is not present
Given I am on "/user_portal.php?nosession=true"
Given I am on "/main/index/user_portal.php"
Then I should see "Temp Session"
And I should not see "Description for Temp Session"
@ -58,10 +58,10 @@ Feature: Session management tool
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"
And I am on "/admin/settings/search_settings?keyword=show_session_description"
And I select "yes" from "form_show_session_description"
And I press "Save"
Then I am on "/main/index/user_portal.php"
Then I should see "Temp Session"
And I should not see "Description for Temp Session"
@ -71,7 +71,7 @@ Feature: Session management tool
And I check the "show_session_description" radio button with "true" value
And I press "Save settings"
Then I should see "Update successful"
Then I am on "/user_portal.php?nosession=true"
Then I am on "/main/index/user_portal.php"
Then I should see "Temp Session"
And I should see "Description for Temp Session"

@ -398,7 +398,7 @@ Feature: Exercise tool
| Total | 190 / 190 | 100% |
Scenario: Teacher looks at exercise results by categories
Given I am on "/user_portal.php"
Given I am on "/main/index/user_portal.php"
And I am on course "TEMP" homepage in session "Session Exercise"
Then I should see "TEMP (Session Exercise)"
And I am on "/main/exercise/exercise.php?cid=1"

Loading…
Cancel
Save