1_cablemodemCest.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?php
  2. use Codeception\Util\Locator;
  3. class CablemodemCest
  4. {
  5. public function frontpageWorks(AcceptanceTester $I)
  6. {
  7. shell_exec('mkdir -p ./tests/_output/debug/Add_Cablemodem/');
  8. #log in
  9. try{
  10. $I->amOnPage('/');
  11. $I->see('Nombre de usuario');
  12. $I->fillField('_username', 'admin');
  13. $I->fillField('_password', 'admin');
  14. $I->click('_submit');
  15. $I->wait('3');
  16. }catch(\Exception $e){
  17. $I->makeScreenshot('Add_Cablemodem/0_login');
  18. }
  19. /*
  20. # ____________________ Base _____________________
  21. # Nodo
  22. try{
  23. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/node/create');
  24. $I->fillField('Nombre', 'TestFernando'."\n");
  25. $I->click('Crear y regresar al listado');
  26. $I->wait('5');
  27. $I->see('ha sido creado con éxito.');
  28. }catch(\Exception $e){
  29. $I->makeScreenshot('Add_Cablemodem/1_Nodo');
  30. }
  31. # Nodo Padre
  32. try{
  33. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/node/create');
  34. $I->fillField('Nombre', 'TestFernandoP'."\n");
  35. $I->fillField('Padre','TestFernando'."\n");
  36. $I->click('Crear y regresar al listado');
  37. $I->wait('5');
  38. $I->see('ha sido creado con éxito.');
  39. }catch(\Exception $e){
  40. $I->makeScreenshot('Add_Cablemodem/2_NodoP');
  41. }
  42. # Perfil
  43. try{
  44. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/profile/create');
  45. $I->fillField('Nombre', 'TestFernando'."\n");
  46. $I->fillField('Downstream','5'."\n");
  47. $I->fillField('Upstream','5'."\n");
  48. $I->fillField('Filtro upload','5'."\n");
  49. $I->fillField('Filtro download','5'."\n");
  50. $I->fillField('Max cpe','5'."\n");
  51. $I->click('Crear y regresar al listado');
  52. $I->wait('5');
  53. $I->see('ha sido creado con éxito.');
  54. }catch(\Exception $e){
  55. $I->makeScreenshot('Add_Cablemodem/3_Perfil');
  56. }
  57. # Modelo Cablemodem
  58. try{
  59. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/cablemodemmodel/create');
  60. $I->fillField('Nombre', 'TestFernando'."\n");
  61. $I->click('Crear y regresar al listado');
  62. $I->wait('5');
  63. $I->see('ha sido creado con éxito.');
  64. }catch(\Exception $e){
  65. $I->makeScreenshot('Add_Cablemodem/4_ModCablemodem');
  66. }
  67. # Modelo CMTS
  68. try{
  69. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/cmtsmodel/create');
  70. $I->fillField('Nombre', 'TestFernando'."\n");
  71. $I->click('Crear y regresar al listado');
  72. $I->wait('5');
  73. $I->see('ha sido creado con éxito.');
  74. }catch(\Exception $e){
  75. $I->makeScreenshot('Add_Cablemodem/5_ModCMTS');
  76. }
  77. # CMTS
  78. try{
  79. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/cmts/create');
  80. $I->fillField('Nombre', 'TestFernando'."\n");
  81. $I->fillField('Host','cmts1.cabletv.com'."\n");
  82. $I->fillField('SNMP Comunity','ferNando2'."\n");
  83. $I->fillField('SNMP Version','2'."\n");
  84. $I->click('Crear y regresar al listado');
  85. $I->wait('5');
  86. $I->see('ha sido creado con éxito.');
  87. }catch(\Exception $e){
  88. $I->makeScreenshot('Add_Cablemodem/6_CMTS');
  89. }
  90. */
  91. # Cablemodem
  92. try{
  93. $I->amOnUrl('http://cablemodem.fd3.flowdat.com/admin/cablemodem/cablemodem/create');
  94. # $I->fillField('Cliente', 'TestFernando'."\n");
  95. $I->fillField('clientId_search', 'TestFernando');
  96. $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
  97. $I->wait('3');
  98. $I->click("//*[@class='ui-corner-all']");
  99. $I->wait('3');
  100. $I->fillField('Mac','F0:E1:D2:C3:B4:A5'."\n");
  101. $I->fillField('Código activación','ferNando2'."\n");
  102. $I->click('Crear y regresar al listado');
  103. $I->wait('5');
  104. $I->see('ha sido creado con éxito.');
  105. }catch(\Exception $e){
  106. $I->makeScreenshot('Add_Cablemodem/7_Cablemodem');
  107. }
  108. }
  109. }