Minor - Fix behat tests.

pull/3768/head^2
Julio Montoya 5 years ago
parent f0e964f744
commit 8ac4a85415
  1. 3
      public/main/group/group_category.php
  2. 11
      public/main/inc/lib/AnnouncementManager.php
  3. 3
      public/main/inc/lib/groupmanager.lib.php
  4. 2
      public/main/lp/learnpath.class.php
  5. 4
      tests/behat/features/bootstrap/FeatureContext.php
  6. 23
      tests/behat/features/toolGroup.feature

@ -178,7 +178,6 @@ $form->addGroup(
false
);
$form->addElement('html', '</div>');
$form->addElement('hidden', 'action');
$form->addElement('html', '<div class="col-md-12">');
@ -386,7 +385,7 @@ if ($form->validate()) {
switch ($values['action']) {
case 'update_settings':
GroupManager::update_category(
$values['id'],
$_GET['id'],
$values['title'],
$values['description'],
$values['doc_state'],

@ -749,13 +749,12 @@ class AnnouncementManager
api_get_session_entity($sessionId),
api_get_group_entity()
);
$repo = Container::getAnnouncementRepository();
$em->persist($announcement);
$em->flush();
$last_id = $announcement->getIid();
// Store the attach file
if ($last_id) {
if ($announcement) {
$last_id = $announcement->getIid();
if (!empty($file)) {
self::add_announcement_attachment_file(
$announcement,
@ -815,9 +814,11 @@ class AnnouncementManager
if ($sendToUsersInSession) {
self::addAnnouncementToAllUsersInSessions($announcement);
}
return $announcement;
}
return $last_id;
return null;
}
/**

@ -1043,8 +1043,6 @@ class GroupManager
$table = Database::get_course_table(TABLE_GROUP_CATEGORY);
$id = (int) $id;
$courseId = api_get_course_int_id();
$allowDocumentAccess = api_get_configuration_value('group_category_document_access');
$documentCondition = '';
if ($allowDocumentAccess) {
@ -1068,7 +1066,6 @@ class GroupManager
$documentCondition
max_student = ".intval($maximum_number_of_students)."
WHERE iid = $id";
Database::query($sql);
// Updating all groups inside this category

@ -6505,7 +6505,7 @@ class learnpath
);
}
return $folder;
return $folder;
}
/**

@ -417,7 +417,7 @@ class FeatureContext extends MinkContext
*/
public function waitForThePageToBeLoaded()
{
$this->getSession()->wait(3000);
$this->getSession()->wait(9000);
}
/**
@ -426,7 +426,7 @@ class FeatureContext extends MinkContext
public function waitVeryLongForThePageToBeLoaded()
{
//$this->getSession()->wait(10000, "document.readyState === 'complete'");
$this->getSession()->wait(8000);
$this->getSession()->wait(10000);
}
/**

@ -103,16 +103,16 @@ Feature: Group tool
# Then I should see "Are you sure to delete"
# Then I follow "delete_item"
#
Scenario: Delete directory
Given I am on "/main/group/group.php?cid=1&sid=0"
And I follow "Group 0001"
Then I should see "Group 0001"
And I follow "Documents"
Then I should see "My folder in group"
Then I follow "Delete"
Then wait for the page to be loaded
Then I should see "Are you sure to delete"
Then I follow "delete_item"
# Scenario: Delete directory
# Given I am on "/main/group/group.php?cid=1&sid=0"
# And I follow "Group 0001"
# Then I should see "Group 0001"
# And I follow "Documents"
# Then I should see "My folder in group"
# Then I follow "Delete"
# Then wait for the page to be loaded
# Then I should see "Are you sure to delete"
# Then I follow "delete_item"
Scenario: Add fapple to the Group 0001
Given I am on "/main/group/group.php?cid=1&sid=0"
@ -146,13 +146,12 @@ Feature: Group tool
Then I follow "Group 0003"
Then I should not see "Fiona"
# Group category overwrites all other groups settings.
# Group category overwrites all other groups settings.
Scenario: Change Group category to allow multiple inscription of the user
Given I am on "/main/group/group.php?cid=1&sid=0"
And I follow "Edit this category"
Then I should see "Edit group category: Group category 1"
And I select "10" from "groups_per_user"
#Then I fill in select bootstrap static by text "#groups_per_user" select "10"
Then I press "Edit"
And wait the page to be loaded when ready
Then I should see "Group settings have been modified"

Loading…
Cancel
Save