Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use appmodelsUsuario;
- class FirstTryLoginCest
- {
- public function _before(FunctionalTester $I)
- {
- $I->amOnRoute('site/login');
- }
- public function submitFormSuccessfully(FunctionalTester $I)
- {
- $I->submitForm('#login-form', [
- '#usuario-username' => 'Fulano',
- '#usuario-password' => '12345678'
- ]);
- $I->see('Mural');
- }
- public function internalLoginByInstance(FunctionalTester $I)
- {
- $admin = appmodelsUsuario::findOne(33);
- $I->amLoggedInAs($admin);
- $I->amOnPage('gestor/mural');
- $I->see('Fulano');
- }
- }
- Codeception PHP Testing Framework v2.4.1
- Powered by PHPUnit 7.1.5 by Sebastian Bergmann and contributors.
- Functional Tests (2) --------------------------------------------------
- ✖ FirstTryLoginCest: Submit form successfully (0.14s)
- ✖ FirstTryLoginCest: Internal login by instance (0.07s)
- -----------------------------------------------------------------------
- Unit Tests (0) --------------------------------------------------------
- -----------------------------------------------------------------------
- Time: 464 ms, Memory: 16.00MB
- There were 2 failures:
- ---------
- 1) FirstTryLoginCest: Submit form successfully
- Test tests/functional/FirstTryLoginCest.php:submitFormSuccessfully
- Step See "Mural"
- Fail Failed asserting that on page /index-test.php?r=site%2Flogin
- --> Username cannot be blank. Password cannot be blank. Lembrar no
- próximo acesso Entrar Esqueci minha senha Copyright © 2018 Nome da
- empresa
- --> contains "Mural".
- Scenario Steps:
- 3. $I->see("Mural") at tests/functional/FirstTryLoginCest.php:19
- 2. $I->submitForm("#login-form",{"#usuario-
- username":"Fulano","#usuario-password":"12345678"}) at
- tests/functional/FirstTryLoginCest.php:16
- 1. $I->amOnRoute("site/login") at
- tests/functional/FirstTryLoginCest.php:10
- ---------
- 2) FirstTryLoginCest: Internal login by instance
- Test tests/functional/FirstTryLoginCest.php:internalLoginByInstance
- Step See "Fulano"
- Fail Failed asserting that on page /gestor/mural
- --> Toggle navigation Fulano Fulano Fulaninho Administrador
- Perfil Sair Fulano Gii Debug Same tools Gii Debug Level One Level Two
- Level Two Level Three Level Three Nome da empresa © 2018 Nome da
- empresa Software Versão 9.0 β string(1) "0"
- --> contains "Fulano".
- Scenario Steps:
- 4. $I->see("Fulano") at tests/functional/FirstTryLoginCest.php:29
- 3. $I->amOnPage("gestor/mural") at
- tests/functional/FirstTryLoginCest.php:28
- <?php
- class BasicCest
- {
- // test
- public function tryToTest(AcceptanceTester $I)
- {
- $I->amOnPage('/');
- $I->click('Login');
- $I->fillField('username', 'john');
- $I->fillField('password', 'coltrane');
- $I->click('Enter');
- $I->see('Hello, John');
- $I->seeInCurrentUrl('/account');
- }
- }
Add Comment
Please, Sign In to add comment