Internal: Improve behat error detection

pull/3513/head
Julio Montoya 5 years ago
parent b6c06945f2
commit 1cf3732ee8
  1. 14
      tests/behat/features/adminFillUsers.feature
  2. 13
      tests/behat/features/bootstrap/FeatureContext.php
  3. 124
      tests/behat/features/course.feature

@ -7,29 +7,29 @@ Feature: User login
Scenario: Login as admin user successfully
Given I am a platform administrator
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Create tests users successfully
Given I am a platform administrator
And I am on "/main/admin/filler.php?fill=users"
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Login as student user successfully
Given I am a student
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Login as teacher successfully
Given I am a teacher
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Login as HRD successfully
Given I am an HR manager
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Login as student boss successfully
Given I am a student boss
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Login as invitee successfully
Given I am an invitee
Then I should not see an ".alert-danger" element
Then I should not see an error

@ -126,6 +126,18 @@ class FeatureContext extends MinkContext
$this->waitForThePageToBeLoaded();
}
/**
* Checks, that element with specified CSS doesn't exist on page
*
* @Then /^(?:|I )should not see an error$/
*/
public function iShouldNotSeeAnError()
{
$this->assertSession()->pageTextNotContains('Internal server error');
$this->assertSession()->pageTextNotContains('error');
$this->assertSession()->elementNotExists('css', '.alert-danger');
}
/**
* @Given /^I have a friend named "([^"]*)" with id "([^"]*)"$/
*/
@ -514,7 +526,6 @@ class FeatureContext extends MinkContext
*/
public function saveUrlWithName($name)
{
$url = $this->getSession()->getCurrentUrl();
$this->getSession()->setCookie($name, $url);
}

@ -34,127 +34,127 @@ Feature: Course tools basic testing
Scenario: Make sure the course exists
Given course "TEMP" exists
Then I should not see an ".alert-danger" element
Then I should not see an error
Scenario: Make sure the course description tool is available
Given I am on course "TEMP" homepage
And I am on "/main/course_description/index.php"
Then I should not see an ".alert-danger" element
# Scenario: Make sure the course description tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/course_description/index.php"
# Then I should not see an error
Scenario: Make sure the documents tool is available
Given I am on course "TEMP" homepage
And I am on "/main/document/document.php"
Then I should not see an ".alert-danger" element
# Scenario: Make sure the documents tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/document/document.php"
# Then I should not see an error
Scenario: Make sure the learning path tool is available
Given I am on course "TEMP" homepage
And I am on "/main/lp/lp_controller.php"
Then I should not see an ".alert-danger" element
And I am on "/main/lp/lp_controller.php?cid=1"
Then I should not see an error
Scenario: Make sure the links tool is available
Given I am on course "TEMP" homepage
And I am on "/main/link/link.php"
Then I should not see an ".alert-danger" element
And I am on "/main/link/link.php?cid=1"
Then I should not see an error
Scenario: Make sure the tests tool is available
Given I am on course "TEMP" homepage
And I am on "/main/exercise/exercise.php"
Then I should not see an ".alert-danger" element
And I am on "/main/exercise/exercise.php?cid=1"
Then I should not see an error
Scenario: Make sure the announcements tool is available
Given I am on course "TEMP" homepage
And I am on "/main/announcements/announcements.php"
Then I should not see an ".alert-danger" element
And I am on "/main/announcements/announcements.php?cid=1"
Then I should not see an error
Scenario: Make sure the assessments tool is available
Given I am on course "TEMP" homepage
And I am on "/main/gradebook/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/gradebook/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the glossary tool is available
Given I am on course "TEMP" homepage
And I am on "/main/glossary/index.php"
Then I should not see an ".alert-danger" element
# Scenario: Make sure the glossary tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/glossary/index.php?cid=1"
# Then I should not see an error
Scenario: Make sure the attendances tool is available
Given I am on course "TEMP" homepage
And I am on "/main/attendance/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/attendance/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the course progress tool is available
Given I am on course "TEMP" homepage
And I am on "/main/course_progress/index.php"
Then I should not see an ".alert-danger" element
# Scenario: Make sure the course progress tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/course_progress/index.php"
# Then I should not see an error
Scenario: Make sure the agenda tool is available
Given I am on course "TEMP" homepage
And I am on "/main/calendar/agenda.php"
Then I should not see an ".alert-danger" element
And I am on "/main/calendar/agenda_js.php?cid=1"
Then I should not see an error
Scenario: Make sure the forums tool is available
Given I am on course "TEMP" homepage
And I am on "/main/forum/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/forum/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the dropbox tool is available
Given I am on course "TEMP" homepage
And I am on "/main/dropbox/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/dropbox/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the users tool is available
Given I am on course "TEMP" homepage
And I am on "/main/user/user.php"
Then I should not see an ".alert-danger" element
And I am on "/main/user/user.php?cid=1"
Then I should not see an error
Scenario: Make sure the groups tool is available
Given I am on course "TEMP" homepage
And I am on "/main/group/group.php"
Then I should not see an ".alert-danger" element
And I am on "/main/group/group.php?cid=1"
Then I should not see an error
Scenario: Make sure the chat tool is available
Given I am on course "TEMP" homepage
And I am on "/main/chat/chat.php"
Then I should not see an ".alert-danger" element
And I am on "/main/chat/chat.php?cid=1"
Then I should not see an error
Scenario: Make sure the assignments tool is available
Given I am on course "TEMP" homepage
And I am on "/main/work/work.php"
Then I should not see an ".alert-danger" element
And I am on "/main/work/work.php?cid=1"
Then I should not see an error
Scenario: Make sure the surveys tool is available
Given I am on course "TEMP" homepage
And I am on "/main/survey/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/survey/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the wiki tool is available
Given I am on course "TEMP" homepage
And I am on "/main/wiki/index.php"
Then I should not see an ".alert-danger" element
And I am on "/main/wiki/index.php?cid=1"
Then I should not see an error
Scenario: Make sure the notebook tool is available
Given I am on course "TEMP" homepage
And I am on "/main/notebook/index.php"
Then I should not see an ".alert-danger" element
Scenario: Make sure the projects tool is available
Given I am on course "TEMP" homepage
And I am on "/main/blog/blog_admin.php"
Then I should not see an ".alert-danger" element
# Scenario: Make sure the notebook tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/notebook/index.php?cid=1"
# Then I should not see an error
#
# Scenario: Make sure the projects tool is available
# Given I am on course "TEMP" homepage
# And I am on "/main/blog/blog_admin.php?cid=1"
# Then I should not see an error
Scenario: Make sure the reporting tool is available
Given I am on course "TEMP" homepage
And I am on "/main/tracking/courseLog.php"
Then I should not see an ".alert-danger" element
And I am on "/main/tracking/courseLog.php?cid=1"
Then I should not see an error
Scenario: Make sure the settings tool is available
Given I am on course "TEMP" homepage
And I am on "/main/course_info/infocours.php"
Then I should not see an ".alert-danger" element
And I am on "/main/course_info/infocours.php?cid=1"
Then I should not see an error
Scenario: Make sure the backup tool is available
Given I am on course "TEMP" homepage
And I am on "/main/course_info/maintenance.php"
Then I should not see an ".alert-danger" element
And I am on "/main/course_info/maintenance.php?cid=1"
Then I should not see an error
# Scenario: Enter to public password-protected course
# Given I have a public password-protected course named "PASSWORDPROTECTED" with password "123456"

Loading…
Cancel
Save