Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

feat(behat) Add Tests For Contact Templates #12023

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
added 3rd scenario and correction of typo
dmyios committed Oct 20, 2022
commit 9174c63c686e97c05cefe98353670f520deeece2
2 changes: 1 addition & 1 deletion tests/api/behat.yml
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ default:
paths: [ "%paths.base%/features/MonitoringServerConfiguration.feature" ]
contexts:
- Centreon\Test\Api\Context\MonitoringServerConfigurationContext
contact_tempaltes_configuration:
contact_templates_configuration:
paths: [ "%paths.base%/features/ConfigurationContactTemplates.feature" ]
contexts:
- Centreon\Test\Behat\Api\Context\ApiContext
29 changes: 29 additions & 0 deletions tests/api/features/ConfigurationContactTemplates.feature
Original file line number Diff line number Diff line change
@@ -31,6 +31,35 @@ Feature: List Contact Templates API
}
"""

Scenario: List Contact Templates as a non-admin user with rights to reach API
Given the following CLAPI import data:
"""
CONTACT;ADD;kev;kev;kev@localhost;Centreon@2022;0;1;en_US;local
CONTACT;setparam;kev;reach_api;1
"""
And I am logged in with "kev"/"Centreon@2022"

When I send a GET request to '/api/latest/configuration/contacts/templates'
Then the response code should be "200"
And the JSON should be equal to:
"""
{
"result": [
{
"id": 19,
"name": "contact_template"
}
],
"meta": {
"page": 1,
"limit": 10,
"search": {},
"sort_by": {},
"total": 1
}
}
"""

Scenario: List Contact Templates as a non-admin user without rights to Reach API
Given the following CLAPI import data:
"""