2020-01-22 17:12:56 +00:00
|
|
|
<?php
|
|
|
|
namespace App\Tests;
|
|
|
|
|
2020-05-13 13:05:53 +01:00
|
|
|
use Codeception\Actor;
|
|
|
|
use Codeception\Lib\Friend;
|
|
|
|
|
2020-01-22 17:12:56 +00:00
|
|
|
/**
|
|
|
|
* Inherited Methods
|
|
|
|
* @method void wantToTest($text)
|
|
|
|
* @method void wantTo($text)
|
|
|
|
* @method void execute($callable)
|
|
|
|
* @method void expectTo($prediction)
|
|
|
|
* @method void expect($prediction)
|
|
|
|
* @method void amGoingTo($argumentation)
|
|
|
|
* @method void am($role)
|
|
|
|
* @method void lookForwardTo($achieveValue)
|
|
|
|
* @method void comment($description)
|
2020-05-13 13:05:53 +01:00
|
|
|
* @method Friend haveFriend($name, $actorClass = NULL)
|
2020-01-22 17:12:56 +00:00
|
|
|
*
|
|
|
|
* @SuppressWarnings(PHPMD)
|
|
|
|
*/
|
2020-05-13 13:05:53 +01:00
|
|
|
class AcceptanceTester extends Actor
|
2020-01-22 17:12:56 +00:00
|
|
|
{
|
|
|
|
use _generated\AcceptanceTesterActions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define custom actions here
|
|
|
|
*/
|
2020-01-17 17:08:32 +00:00
|
|
|
|
2020-05-13 13:05:53 +01:00
|
|
|
/**
|
|
|
|
* @param string $name
|
|
|
|
* @param string $password
|
|
|
|
*/
|
|
|
|
public function login(string $name, string $password): void
|
2020-01-17 17:08:32 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* To implement when auth is working
|
|
|
|
*/
|
|
|
|
}
|
2020-05-13 13:05:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Login using legacy app
|
|
|
|
* @param string $name
|
|
|
|
* @param string $password
|
|
|
|
*/
|
|
|
|
public function loginInLegacy(string $name, string $password): void
|
|
|
|
{
|
|
|
|
$this->amOnPage('/legacy/index.php?action=Login&module=Users');
|
|
|
|
$this->fillField('user_name', $name);
|
|
|
|
$this->fillField('username_password', $password);
|
|
|
|
$this->click('Log In');
|
|
|
|
$this->seeInCurrentUrl('index.php?module=Home&action=index');
|
|
|
|
}
|
2020-01-22 17:12:56 +00:00
|
|
|
}
|