Private GIT

Skip to content
Snippets Groups Projects
Commit 35c4cece authored by Matthieu Mandoula's avatar Matthieu Mandoula Committed by Kevin Duret
Browse files

Special characters in contact (#5359)

* SpecialCharactersInContact config added

* SpecialCharactersInContact.feature added

* features/bootstrap/SpecialCharactersInContact acceptance test

* * Change private properties to protected in SpecialCharactersInContactContext class
* Update gitignore file

* theNewRecordIsDisplayedInTheUsersListWithTheNewAliasValue function updated
parent 1405324e
No related branches found
No related tags found
No related merge requests found
.idea/
/nbproject/private/
nbproject/
/vendor/
composer.lock
......@@ -153,3 +153,8 @@ default:
paths: [ %paths.base%/features/RestApi.feature ]
contexts:
- RestApiContext
special_characters_in_contact:
paths: [ %paths.base%/features/SpecialCharactersInContact.feature ]
contexts:
- SpecialCharactersInContactContext
Feature: Alias Contact Modification
As a Centreon admin user
I want to modify an existing non admin contact alias including a special character
Modified contact is saved
Modified contact can log in Centreon Web
Background:
Given I am logged in a Centreon server
And one non admin contact has been created
Scenario: Modify contact alias by adding an accent or a special character
When I have changed the contact alias
Then the new record is displayed in the users list with the new alias value
Scenario: Check modified contact still able to log in Centreon Web
Given the contact alias contains an accent
When I fill login field and Password
Then the contact is logged to Centreon Web
\ No newline at end of file
<?php
use Centreon\Test\Behat\CentreonContext;
use Centreon\Test\Behat\Configuration\ContactConfigurationListingPage;
use Centreon\Test\Behat\Configuration\ContactConfigurationPage;
use Centreon\Test\Behat\External\LoginPage;
class SpecialCharactersInContactContext extends CentreonContext
{
protected $nonAdminName = 'nonAdminName';
protected $nonAdminPassword = 'nonAdminPassword';
protected $nonAdminAlias = 'nonAdminalias';
protected $nonAdminEmail= 'test@localhost.com';
protected $page;
protected $accentedAndSpeacialCharsAlias = 'guést@';
/**
* @Given one non admin contact has been created
*/
public function oneNonAdminContactHasBeenCreated()
{
$this->page = new ContactConfigurationPage($this);
$this->page->setProperties(array(
'name' => $this->nonAdminName,
'alias' => $this->nonAdminAlias,
'email' => $this->nonAdminEmail,
'password' => $this->nonAdminPassword,
'password2' => $this->nonAdminPassword,
'admin' => 0
));
$this->page->save();
}
/**
* @When I have changed the contact alias
*/
public function iHaveChangedTheContactAlias()
{
$this->page = new ContactConfigurationListingPage($this);
$this->page = $this->page->inspect($this->nonAdminAlias);
$this->page->setProperties(array('alias' => $this->accentedAndSpeacialCharsAlias));
$this->page->save();
}
/**
* @Then the new record is displayed in the users list with the new alias value
*/
public function theNewRecordIsDisplayedInTheUsersListWithTheNewAliasValue()
{
$this->page = new ContactConfigurationListingPage($this);
$this->page->getEntry($this->accentedAndSpeacialCharsAlias);
}
/**
* @Given the contact alias contains an accent
*/
public function theContactAliasContainsAnAccent()
{
$this->iHaveChangedTheContactAlias();
}
/**
* @When I fill login field and Password
*/
public function iFillLoginFieldAndPassword()
{
$this->iAmLoggedOut();
$this->parameters['centreon_user'] = $this->nonAdminAlias;
$this->parameters['centreon_password'] = $this->nonAdminPassword;
}
/**
* @Then the contact is logged to Centreon Web
*/
public function theContactIsLoggedToCentreonWeb()
{
$this->page = new LoginPage($this);
$this->page->login($this->accentedAndSpeacialCharsAlias,$this->nonAdminPassword);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment