[TESTS][CodeCeption] Update acceptance tests to remove accesibility test kludge

This commit is contained in:
Hugo Sales 2022-01-16 19:03:32 +00:00
parent a59997b41f
commit 6c6c0270c5
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0
2 changed files with 73 additions and 3 deletions

View File

@ -0,0 +1,26 @@
<?php
declare(strict_types = 1);
class LoggedInCest
{
public function _before(AcceptanceTester $I)
{
$I->wantTo('Login');
$I->amOnPage('/main/login');
$I->fillField('_username', 'taken_user');
$I->fillField('_password', 'foobar');
$I->click('Sign in');
}
private function run(AcceptanceTester $I, string $page, string $see): void
{
$I->amOnPage($page);
$I->see($see);
}
public function root(AcceptanceTester $I)
{
$this->run($I, '/', 'Feed');
}
}

View File

@ -4,10 +4,54 @@ declare(strict_types = 1);
class LoggedOutCest class LoggedOutCest
{ {
private function run(AcceptanceTester $I, string $page, string $see): void
{
$I->amOnPage($page);
$I->see($see);
}
public function root(AcceptanceTester $I) public function root(AcceptanceTester $I)
{ {
$I->amOnPage('/'); $this->run($I, '/', 'Feed');
$I->see('Feed'); }
$I->validatePa11y(\Helper\AccessibilityValidator::STANDARD_WCAG2AAA);
public function loginPage(AcceptanceTester $I)
{
$this->run($I, '/main/login', 'Login');
}
public function registerPage(AcceptanceTester $I)
{
$this->run($I, '/main/register', 'Register');
}
public function feed(AcceptanceTester $I)
{
$this->run($I, '/feed/public', 'Feed');
}
public function faq(AcceptanceTester $I)
{
$this->run($I, '/doc/faq', 'What is this site?');
}
public function tos(AcceptanceTester $I)
{
$this->run($I, '/doc/tos', 'TOS');
}
public function privacy(AcceptanceTester $I)
{
$this->run($I, '/doc/privacy', 'Privacy');
}
public function source(AcceptanceTester $I)
{
$this->run($I, '/doc/source', 'Source');
}
public function version(AcceptanceTester $I)
{
$this->run($I, '/doc/version', 'GNU social 3');
} }
} }