2016-10-21 06:41:55 +02:00
|
|
|
<?php
|
2020-09-20 19:49:41 +02:00
|
|
|
|
2021-06-12 10:40:01 +02:00
|
|
|
class Admin_RecordsCest extends CestAbstract
|
2016-10-21 06:41:55 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
* @before login
|
|
|
|
*/
|
2020-09-20 19:49:41 +02:00
|
|
|
public function manageUsers(FunctionalTester $I): void
|
2016-10-21 06:41:55 +02:00
|
|
|
{
|
2017-08-20 19:44:51 +02:00
|
|
|
$I->wantTo('Manage users.');
|
2016-10-23 18:10:00 +02:00
|
|
|
|
2017-08-20 19:44:51 +02:00
|
|
|
// User homepage
|
2016-10-21 06:41:55 +02:00
|
|
|
$I->amOnPage('/admin/users');
|
2021-10-28 01:15:33 +02:00
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
/*
|
|
|
|
* TODO: Acceptance Testing with Vue Rendering
|
|
|
|
|
2016-10-21 06:41:55 +02:00
|
|
|
$I->see($this->login_username);
|
|
|
|
|
2017-08-20 19:44:51 +02:00
|
|
|
// Edit existing user
|
2016-10-23 18:10:00 +02:00
|
|
|
$I->click('Edit');
|
|
|
|
|
|
|
|
$I->submitForm('.form', []);
|
|
|
|
|
|
|
|
$I->seeCurrentUrlEquals('/admin/users');
|
|
|
|
$I->see($this->login_username);
|
|
|
|
|
2017-08-20 19:44:51 +02:00
|
|
|
// Add a secondary user
|
2021-03-19 15:11:42 +01:00
|
|
|
$I->click('Add User', '#content');
|
2017-08-20 19:44:51 +02:00
|
|
|
|
|
|
|
$I->submitForm('.form', [
|
|
|
|
'name' => 'ZZZ Test Administrator',
|
|
|
|
'email' => 'test@azuracast.com',
|
|
|
|
'auth_password' => 'CorrectBatteryStapleHorse',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$I->seeCurrentUrlEquals('/admin/users');
|
|
|
|
$I->see('test@azuracast.com');
|
|
|
|
|
|
|
|
// Delete the secondary user
|
|
|
|
$I->click(\Codeception\Util\Locator::lastElement('.btn-danger'));
|
|
|
|
|
|
|
|
$I->seeCurrentUrlEquals('/admin/users');
|
|
|
|
$I->dontSee('test@azuracast.com');
|
2021-10-28 01:15:33 +02:00
|
|
|
*/
|
2017-08-20 19:44:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
* @before login
|
|
|
|
*/
|
2020-09-20 19:49:41 +02:00
|
|
|
public function manageStations(FunctionalTester $I): void
|
2017-08-20 19:44:51 +02:00
|
|
|
{
|
|
|
|
$I->wantTo('Manage stations.');
|
2016-10-23 18:10:00 +02:00
|
|
|
|
2016-10-21 06:41:55 +02:00
|
|
|
$I->amOnPage('/admin/stations');
|
2021-10-23 19:11:20 +02:00
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
/*
|
|
|
|
* TODO: Acceptance Testing with Vue Rendering
|
|
|
|
|
2016-10-21 06:41:55 +02:00
|
|
|
$I->see('Functional Test Radio');
|
2016-10-23 18:10:00 +02:00
|
|
|
|
2021-10-23 19:11:20 +02:00
|
|
|
|
2016-10-23 18:10:00 +02:00
|
|
|
$I->click('Edit');
|
|
|
|
|
|
|
|
$I->submitForm('.form', [
|
2017-08-13 12:07:22 +02:00
|
|
|
'name' => 'Modification Test Radio',
|
2016-10-23 18:10:00 +02:00
|
|
|
]);
|
|
|
|
|
|
|
|
$I->seeCurrentUrlEquals('/admin/stations');
|
|
|
|
$I->see('Modification Test Radio');
|
2021-10-23 19:11:20 +02:00
|
|
|
*/
|
2017-08-20 19:44:51 +02:00
|
|
|
}
|
2016-10-23 18:10:00 +02:00
|
|
|
|
2017-08-20 19:44:51 +02:00
|
|
|
/**
|
|
|
|
* @before setupComplete
|
|
|
|
* @before login
|
|
|
|
*/
|
2020-09-20 19:49:41 +02:00
|
|
|
public function manageSettings(FunctionalTester $I): void
|
2017-08-20 19:44:51 +02:00
|
|
|
{
|
|
|
|
$I->wantTo('Manage settings.');
|
2016-10-23 18:10:00 +02:00
|
|
|
|
|
|
|
$I->amOnPage('/admin/settings');
|
2021-10-11 11:55:25 +02:00
|
|
|
$I->seeResponseCodeIs(200);
|
|
|
|
$I->seeInTitle('System Settings');
|
2016-10-21 06:41:55 +02:00
|
|
|
}
|
2018-10-11 19:01:00 +02:00
|
|
|
}
|