parent
ec359c76d8
commit
0f36cfce62
|
@ -43,7 +43,7 @@ class LoginForm extends Form
|
|||
*/
|
||||
protected function create()
|
||||
{
|
||||
$this->setName('login');
|
||||
$this->setName('form_login');
|
||||
$this->addElement(
|
||||
'text',
|
||||
'username',
|
||||
|
|
|
@ -67,6 +67,7 @@ class DbBackendForm extends BaseBackendForm
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setName('form_modify_backend');
|
||||
$name = $this->filterName($this->getBackendName());
|
||||
|
||||
$this->addElement(
|
||||
|
|
|
@ -49,6 +49,7 @@ class LdapBackendForm extends BaseBackendForm
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setName('form_modify_backend');
|
||||
$name = $this->filterName($this->getBackendName());
|
||||
$backend = $this->getBackend();
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ class ConfirmRemovalForm extends Form
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setName('form_confirm_removal');
|
||||
$this->addElement(
|
||||
'hidden',
|
||||
$this->targetName,
|
||||
|
|
|
@ -32,19 +32,19 @@ var casper = icinga.getTestEnv();
|
|||
var assertLoginFormExists = function(test) {
|
||||
|
||||
test.assertExists(
|
||||
'form#login',
|
||||
'form#form_login',
|
||||
'Test whether the login form exists'
|
||||
);
|
||||
test.assertExists(
|
||||
'form#login input#username',
|
||||
'form#form_login input#username',
|
||||
'Test whether a username input field exists'
|
||||
);
|
||||
test.assertExists(
|
||||
'form#login input#password',
|
||||
'form#form_login input#password',
|
||||
'Test whether a password input field exists'
|
||||
);
|
||||
test.assertExists(
|
||||
'form#login input#submit',
|
||||
'form#form_login input#submit',
|
||||
'Test whether a submit input field exists'
|
||||
);
|
||||
};
|
||||
|
@ -71,11 +71,11 @@ casper.start('/', function() {
|
|||
* Login with invalid credentials
|
||||
*/
|
||||
casper.then(function() {
|
||||
this.fill('form#login', {
|
||||
this.fill('form#form_login', {
|
||||
'username' : 'no',
|
||||
'password' : 'existing_user'
|
||||
});
|
||||
this.click('form#login input#submit');
|
||||
this.click('form#form_login input#submit');
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -98,8 +98,8 @@ casper.then(function() {
|
|||
* Login with valid credentials
|
||||
*/
|
||||
casper.then(function() {
|
||||
this.fill('form#login', icinga.getCredentials());
|
||||
this.click('form#login input#submit');
|
||||
this.fill('form#form_login', icinga.getCredentials());
|
||||
this.click('form#form_login input#submit');
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -151,7 +151,7 @@ casper.then(function() {
|
|||
this.click('#icinga_app_nav_useraction');
|
||||
this.waitUntilVisible('#icinga_app_nav_logout', function() {
|
||||
this.click('#icinga_app_nav_logout a');
|
||||
this.waitForSelector('form#login', function() {
|
||||
this.waitForSelector('form#form_login', function() {
|
||||
this.test.assertDoesntExist(
|
||||
'#icinga_app_username',
|
||||
'Test if no username is set in the frontend after logout'
|
||||
|
|
|
@ -110,8 +110,8 @@ if (path === null) {
|
|||
|
||||
exports.performLogin = function() {
|
||||
casper.start("/authentication/login", function() {
|
||||
this.fill('form#login', icinga.getCredentials());
|
||||
this.click('form#login input#submit');
|
||||
this.fill('form#form_login', icinga.getCredentials());
|
||||
this.click('form#form_login input#submit');
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
|
|
@ -55,6 +55,7 @@ casper.then(function() {
|
|||
'div.alert.alert-success',
|
||||
'Assert no success notice existing when no changes have been done in the general form'
|
||||
);
|
||||
this.echo("Changing the default timezone");
|
||||
this.fill('#form_config_general', {
|
||||
'timezone': 'Europe/Minsk'
|
||||
});
|
||||
|
@ -65,6 +66,7 @@ casper.then(function() {
|
|||
* Check for the 'Successfully Update' information bubble
|
||||
*/
|
||||
casper.then(function() {
|
||||
this.echo("Clicked on save button of the general form, waiting for success");
|
||||
this.waitForSelector('div.alert.alert-success', function() {
|
||||
this.test.assertSelectorHasText(
|
||||
'div.alert.alert-success',
|
||||
|
@ -72,7 +74,7 @@ casper.then(function() {
|
|||
'Assert a success text to appear in the general form'
|
||||
);
|
||||
}, function() {
|
||||
this.die("No success text appeared in the general form");
|
||||
this.fail("No success text appeared in the general form");
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -85,9 +87,12 @@ casper.thenOpen('/config/authentication', function() {
|
|||
for (var i=0; i<links.length; i++) {
|
||||
if (/.* Edit This Authentication/.test(links[i].text)) {
|
||||
document.location.href = links[i].getAttribute('href');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.echo("Clicked on first authentication backend link");
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -96,8 +101,21 @@ casper.thenOpen('/config/authentication', function() {
|
|||
casper.then(function() {
|
||||
this.waitForSelector('input#btn_submit', function() {
|
||||
this.click('input#btn_submit');
|
||||
this.waitForSelector('div.alert.alert-success', function() {
|
||||
this.test.assertExists('div.alert.alert-success', 'Assert a success message to exist');
|
||||
this.echo("Submitted authentication form");
|
||||
|
||||
this.waitForSelector('div.alert', function() {
|
||||
// Force creation when message bubbled
|
||||
if (this.exists('form#form_modify_backend input#backend_force_creation')) {
|
||||
this.echo("Backend persistence requires an additional confirmation in this case");
|
||||
this.fill('#form_modify_backend', {
|
||||
'backend_force_creation' : '1'
|
||||
});
|
||||
this.click('input#btn_submit');
|
||||
}
|
||||
this.echo("Waiting for success feedback");
|
||||
this.waitForSelector('div.alert.alert-success', function() {
|
||||
this.test.assertExists('div.alert.alert-success', 'Assert a success message to exist');
|
||||
});
|
||||
}, function() {
|
||||
this.test.fail("Success message for authentication provider tests didn't pop up");
|
||||
});
|
||||
|
@ -113,15 +131,11 @@ casper.then(function() {
|
|||
casper.thenOpen('/config/logging', function() {
|
||||
this.test.assertExists('form#form_config_logging', 'Asserting the logging form to exist');
|
||||
this.click('form#form_config_logging input#btn_submit');
|
||||
this.echo("Submitting authentication form1");
|
||||
|
||||
this.waitForSelector('div.alert.alert-success', function() {
|
||||
this.test.assertExists('div.alert.alert-success', 'Assert a success message to exist');
|
||||
}, function() {
|
||||
this.test.fail('No success message popped up when saving logging configuration');
|
||||
});
|
||||
this.echo("Submitting authentication form2");
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue