1_baseCest.php 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use Codeception\Util\Locator;
  3. include ('variables.php');
  4. # comando para correr el test: php ./vendor/bin/codecept run --steps tests/acceptance/1_baseCest.php
  5. class BaseCest
  6. {
  7. public function frontpageWorks(AcceptanceTester $I)
  8. {
  9. $user= $_GET['USER'];
  10. $pass= $_GET['PASS'];
  11. shell_exec('mkdir -p ./tests/_output/debug/screen/');
  12. #log in
  13. #var_dump($I->see("UserName"));die();
  14. try{
  15. $I->amOnPage('/');
  16. $I->fillField('username', $user);
  17. $I->fillField('psd', $pass);
  18. $I->click('Login');
  19. $I->wait('3');
  20. }catch(\Exception $e){
  21. $I->makeScreenshot('screen/0_login');
  22. }
  23. # Catv
  24. try{
  25. $I->amOnPage('/catv.asp');
  26. $I->wait('3');
  27. $I->click("(//*[@name='catv_enabled'])");
  28. $I->wait('5');
  29. $I->click('Apply Changes');
  30. $I->wait('5');
  31. $I->see('Change setting successfully!');
  32. $I->click('OK');
  33. }catch(\Exception $e){
  34. $I->makeScreenshot('screen/6_action');
  35. }
  36. $I->wait('3');
  37. $I->amOnPage('/boaform/admin/formLogout');
  38. }
  39. }