This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(broker): add form to configure generic stream connector (#6024)
* feat(form broker) add custom output * fix(broker): Fix js with multiple element on Centreon Broker Form * Add jshook for fields * feat(broker) add filter in custom output * fix(broker) replace space in output/input name * feat(broker) add custom output test * feat(broker) add doc
- Loading branch information
Showing
12 changed files
with
891 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,6 @@ Guide d'administration | |
02i | ||
02j | ||
02k | ||
02l | ||
backup | ||
partitioning/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Feature: Centreon broker Configuration | ||
As a Centreon user | ||
I want to configure broker | ||
|
||
Background: | ||
Given I am logged in a Centreon server | ||
|
||
Scenario: add custom output | ||
When I add a custom output | ||
Then the output is saved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
|
||
use Centreon\Test\Behat\CentreonContext; | ||
use Centreon\Test\Behat\Configuration\BrokerConfigurationListingPage; | ||
use Centreon\Test\Behat\Configuration\BrokerConfigurationPage; | ||
|
||
class BrokerConfigurationContext extends CentreonContext | ||
{ | ||
|
||
private $currentPage; | ||
|
||
private $initialProperties = array( | ||
'name' => 'brokerConfigName', | ||
'filename' => 'brokerFilename', | ||
'cache_directory' => '/var/lib/centreon-broker/' | ||
); | ||
|
||
private $luaProperties = array( | ||
'name' => 'lua_script', | ||
'path' => '/tmp/lua.lua', | ||
'metricType' => 'Number', | ||
'metricName' => 'integer', | ||
'metricValue' => 42 | ||
); | ||
|
||
|
||
/** | ||
* @When I add a custom output | ||
*/ | ||
public function iAddACustomOutput() | ||
{ | ||
$this->currentPage = new BrokerConfigurationListingPage($this); | ||
$this->assertFind('css', 'table.ToolbarTable.table a.btc.bt_success')->click(); | ||
$page = $this->currentPage = new BrokerConfigurationPage($this); | ||
$this->currentPage->setProperties($this->initialProperties); | ||
$this->assertFind('css', '#c4')->click(); | ||
$this->selectInList('#block_output', 'Lua - Lua script'); | ||
$this->assertFind('css', 'a#add_output.btc.bt_success')->click(); | ||
$this->currentPage; | ||
|
||
$this->spin( | ||
function ($context) use ($page) { | ||
return $context->getSession()->getPage()->has('css', 'tbody#output_1 tr.list_one td input.v_required'); | ||
} | ||
); | ||
|
||
$this->assertFind('css', 'tbody#output_1 tr.list_one td input.v_required')->setValue($this->luaProperties['name']); | ||
$this->assertFind('css', 'tbody#output_1 tr.list_two td input.v_required')->setValue($this->luaProperties['path']); | ||
$this->selectInList('tbody#output_1 tr:nth-child(1) td.FormRowValue:nth-child(2) select', $this->luaProperties['metricType']); | ||
$this->assertFind('css', 'tbody#output_1 tr.list_one:nth-child(2) td:nth-child(2).FormRowValue input')->setValue($this->luaProperties['metricName']); | ||
$this->assertFind('css', 'tbody#output_1 tr:nth-child(1) td.FormRowValue input.v_number')->setValue($this->luaProperties['metricValue']); | ||
|
||
$this->currentPage->save(); | ||
} | ||
|
||
/** | ||
* @Then the output is saved | ||
*/ | ||
public function theOutputIsSaved() | ||
{ | ||
$this->currentPage = new BrokerConfigurationListingPage($this); | ||
$this->currentPage->getEntry($this->initialProperties['name']); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.