-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from eluhr/feature/redirects-test
Enhanced redirects test
- Loading branch information
Showing
3 changed files
with
75 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
namespace extensions; | ||
|
||
|
||
use E2eTester; | ||
|
||
/** | ||
* @package extensions | ||
* @author Elias Luhr <[email protected]> | ||
* | ||
* @group mandatory | ||
*/ | ||
class RedirectsCest | ||
{ | ||
|
||
private $_test_redirect; | ||
|
||
public function _before(E2eTester $I) | ||
{ | ||
if (empty($this->_test_redirect)) { | ||
$this->_test_redirect = dechex(time()); | ||
} | ||
} | ||
|
||
/** | ||
* @param E2eTester $I | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function backend(E2eTester $I) | ||
{ | ||
$I->wantTo("ensure that 'redirects' module works"); | ||
|
||
$I->amGoingTo('try to login with correct credentials'); | ||
$I->login('master', 'master1'); | ||
|
||
$I->amOnPage('/redirects'); | ||
$I->click('New'); | ||
|
||
$I->waitForElementVisible('.redirect-form', 10); | ||
$I->selectOption('Redirect[type]', 'Path redirect'); | ||
$I->fillField('Redirect[from_path]', '/' . $this->_test_redirect); | ||
$I->fillField('Redirect[to_path]', '/site/index'); | ||
$I->selectOption('#redirect-status_code input', 301); | ||
$I->click('Create'); | ||
|
||
$I->waitForElementNotVisible('.redirect-form'); | ||
$I->see($this->_test_redirect, 'table'); | ||
|
||
$I->makeScreenshot('redirect-create'); | ||
|
||
} | ||
|
||
/** | ||
* @param E2eTester $I | ||
* | ||
* @throws \Exception | ||
*/ | ||
public function frontend(E2eTester $I) | ||
{ | ||
$I->wantTo("ensure that 'redirects' module works"); | ||
|
||
$I->amGoingTo('try to login with correct credentials'); | ||
|
||
$I->login('preview', 'preview1'); | ||
$I->amGoingTo('test the redirect'); | ||
$I->amOnPage('/' . $this->_test_redirect); | ||
$I->seeInCurrentUrl('/site/index'); | ||
$I->waitForElementVisible('.site-index'); | ||
|
||
$I->makeScreenshot('after-redirect'); | ||
|
||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
tests/codeception/e2e/extensions/RedirectsFrontendCept.php
This file was deleted.
Oops, something went wrong.