Guest User

Untitled

a guest
May 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. <?php
  2.  
  3. use appmodelsUsuario;
  4.  
  5. class FirstTryLoginCest
  6. {
  7.  
  8. public function _before(FunctionalTester $I)
  9. {
  10. $I->amOnRoute('site/login');
  11. }
  12.  
  13. public function submitFormSuccessfully(FunctionalTester $I)
  14. {
  15. $I->submitForm('#login-form', [
  16. '#usuario-username' => 'Fulano',
  17. '#usuario-password' => '12345678'
  18. ]);
  19. $I->see('Mural');
  20. }
  21.  
  22. public function internalLoginByInstance(FunctionalTester $I)
  23. {
  24. $admin = appmodelsUsuario::findOne(33);
  25. $I->amLoggedInAs($admin);
  26. $I->amOnPage('gestor/mural');
  27. $I->see('Fulano');
  28. }
  29.  
  30. }
  31.  
  32. Codeception PHP Testing Framework v2.4.1
  33. Powered by PHPUnit 7.1.5 by Sebastian Bergmann and contributors.
  34.  
  35. Functional Tests (2) --------------------------------------------------
  36. ✖ FirstTryLoginCest: Submit form successfully (0.14s)
  37. ✖ FirstTryLoginCest: Internal login by instance (0.07s)
  38. -----------------------------------------------------------------------
  39.  
  40. Unit Tests (0) --------------------------------------------------------
  41. -----------------------------------------------------------------------
  42.  
  43. Time: 464 ms, Memory: 16.00MB
  44.  
  45. There were 2 failures:
  46.  
  47. ---------
  48. 1) FirstTryLoginCest: Submit form successfully
  49. Test tests/functional/FirstTryLoginCest.php:submitFormSuccessfully
  50. Step See "Mural"
  51. Fail Failed asserting that on page /index-test.php?r=site%2Flogin
  52. --> Username cannot be blank. Password cannot be blank. Lembrar no
  53. próximo acesso Entrar Esqueci minha senha Copyright &COPY; 2018 Nome da
  54. empresa
  55. --> contains "Mural".
  56.  
  57. Scenario Steps:
  58.  
  59. 3. $I->see("Mural") at tests/functional/FirstTryLoginCest.php:19
  60. 2. $I->submitForm("#login-form",{"#usuario-
  61. username":"Fulano","#usuario-password":"12345678"}) at
  62. tests/functional/FirstTryLoginCest.php:16
  63. 1. $I->amOnRoute("site/login") at
  64. tests/functional/FirstTryLoginCest.php:10
  65.  
  66.  
  67. ---------
  68. 2) FirstTryLoginCest: Internal login by instance
  69. Test tests/functional/FirstTryLoginCest.php:internalLoginByInstance
  70. Step See "Fulano"
  71. Fail Failed asserting that on page /gestor/mural
  72. --> Toggle navigation Fulano Fulano Fulaninho Administrador
  73. Perfil Sair Fulano Gii Debug Same tools Gii Debug Level One Level Two
  74. Level Two Level Three Level Three Nome da empresa &COPY; 2018   Nome da
  75. empresa Software Versão 9.0 β string(1) "0"
  76. --> contains "Fulano".
  77.  
  78. Scenario Steps:
  79.  
  80. 4. $I->see("Fulano") at tests/functional/FirstTryLoginCest.php:29
  81. 3. $I->amOnPage("gestor/mural") at
  82. tests/functional/FirstTryLoginCest.php:28
  83.  
  84. <?php
  85. class BasicCest
  86. {
  87. // test
  88. public function tryToTest(AcceptanceTester $I)
  89. {
  90. $I->amOnPage('/');
  91. $I->click('Login');
  92. $I->fillField('username', 'john');
  93. $I->fillField('password', 'coltrane');
  94. $I->click('Enter');
  95. $I->see('Hello, John');
  96. $I->seeInCurrentUrl('/account');
  97. }
  98. }
Add Comment
Please, Sign In to add comment