AzuraCast/tests/functional/Admin_RecordsCest.php

89 lines
2.1 KiB
PHP
Raw Normal View History

2016-10-21 06:41:55 +02:00
<?php
class Admin_RecordsCest extends CestAbstract
2016-10-21 06:41:55 +02:00
{
/**
* @before setupComplete
* @before login
*/
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
*/
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');
$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
2016-10-23 18:10:00 +02:00
$I->click('Edit');
$I->submitForm('.form', [
'name' => 'Modification Test Radio',
2016-10-23 18:10:00 +02:00
]);
$I->seeCurrentUrlEquals('/admin/stations');
$I->see('Modification Test Radio');
*/
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
*/
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
}