1B_cablemodemCest.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. use Codeception\Util\Locator;
  3. class CablemodemCest
  4. {
  5. public function frontpageWorks(AcceptanceTester $I)
  6. {
  7. $I->maximizeWindow();
  8. $cliente = "fd3";
  9. shell_exec('mkdir -p ./tests/_output/debug/02_Add_Cablemodem/');
  10. #log in
  11. try{
  12. $I->amOnPage('/');
  13. try{
  14. $I->acceptPopup();
  15. }catch(\Exception $e){}
  16. $I->see('Nombre de usuario');
  17. $I->fillField('_username', 'admin');
  18. $I->fillField('_password', 'admin');
  19. $I->click('_submit');
  20. $I->wait('3');
  21. }catch(\Exception $e){
  22. $I->makeScreenshot('02_Add_Cablemodem/0_login');
  23. }
  24. # Nodo
  25. try{
  26. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/node/create');
  27. try{
  28. $I->acceptPopup();
  29. }catch(\Exception $e){
  30. }
  31. $I->fillField('Nombre', 'TestFernando');
  32. $I->click('Crear y regresar al listado');
  33. $I->wait('5');
  34. $I->see('ha sido creado con éxito.');
  35. }catch(\Exception $e){
  36. $I->makeScreenshot('02_Add_Cablemodem/1_Nodo');
  37. }
  38. # Nodo Padre
  39. try{
  40. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/node/create');
  41. try{
  42. $I->acceptPopup();
  43. }catch(\Exception $e){
  44. }
  45. $I->fillField('Nombre', 'TestFernandoP');
  46. $I->fillField('Padre','TestFernando'."\n");
  47. $I->click('Crear y regresar al listado');
  48. $I->wait('5');
  49. $I->see('ha sido creado con éxito.');
  50. }catch(\Exception $e){
  51. $I->makeScreenshot('02_Add_Cablemodem/2_NodoP');
  52. }
  53. # Perfil
  54. try{
  55. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/profile/create');
  56. try{
  57. $I->acceptPopup();
  58. }catch(\Exception $e){
  59. }
  60. $I->fillField('Nombre', 'TestFernando');
  61. $I->fillField('Downstream','5000');
  62. $I->fillField('Upstream','2000');
  63. $I->fillField('Filtro upload','50');
  64. $I->fillField('Filtro download','50');
  65. $I->fillField('Max cpe','5');
  66. $I->click('Crear y regresar al listado');
  67. $I->wait('5');
  68. $I->see('ha sido creado con éxito.');
  69. }catch(\Exception $e){
  70. $I->makeScreenshot('02_Add_Cablemodem/3_Perfil');
  71. }
  72. # Modelo Cablemodem
  73. try{
  74. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/cablemodemmodel/create');
  75. try{
  76. $I->acceptPopup();
  77. }catch(\Exception $e){
  78. }
  79. $I->fillField('Nombre', 'TestFernando');
  80. $I->click('Crear y regresar al listado');
  81. $I->wait('5');
  82. $I->see('ha sido creado con éxito.');
  83. }catch(\Exception $e){
  84. $I->makeScreenshot('02_Add_Cablemodem/4_ModCablemodem');
  85. }
  86. # Modelo CMTS
  87. try{
  88. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/cmtsmodel/create');
  89. try{
  90. $I->acceptPopup();
  91. }catch(\Exception $e){
  92. }
  93. $I->fillField('Nombre', 'TestFernando');
  94. $I->click('Crear y regresar al listado');
  95. $I->wait('5');
  96. $I->see('ha sido creado con éxito.');
  97. }catch(\Exception $e){
  98. $I->makeScreenshot('02_Add_Cablemodem/5_ModCMTS');
  99. }
  100. # CMTS
  101. try{
  102. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/cmts/create');
  103. try{
  104. $I->acceptPopup();
  105. }catch(\Exception $e){
  106. }
  107. $I->fillField('Nombre', 'TestFernando');
  108. $I->click('Configuración');
  109. $I->wait('5');
  110. $I->fillField('Host','cmts1.cabletv.com');
  111. $I->fillField('SNMP Community','ferNando2');
  112. $I->fillField('SNMP Version','2'."\n");
  113. $I->click('Crear y regresar al listado');
  114. $I->wait('5');
  115. $I->see('ha sido creado con éxito.');
  116. }catch(\Exception $e){
  117. $I->makeScreenshot('02_Add_Cablemodem/6_CMTS');
  118. }
  119. # Cablemodem
  120. try{
  121. $I->amOnUrl('https://cablemodem.'.$cliente.'.flowdat.com/admin/cablemodem/cablemodem/create');
  122. try{
  123. $I->acceptPopup();
  124. }catch(\Exception $e){
  125. }
  126. $I->fillField('Mac','foe1d2c3b4a3'); # Mac
  127. $I->fillField('Código activación','ferNando2'); # Codigo
  128. $I->fillField('Nodo','TestFernando'."\n");
  129. $I->fillField('Perfil','TestFernando'."\n");
  130. $I->fillField('clientId_search', 'TestFernando'); # Cliente
  131. $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
  132. $I->wait('3');
  133. $I->click("//*[@class='ui-corner-all']");
  134. $I->wait('3');
  135. #$I->click('Mapa');
  136. #$I->wait('3');
  137. # $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 535, Rosario'."\n"."\n");
  138. #$I->click("//*[@id='searchtext9']");
  139. # $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
  140. #$I->wait('3');
  141. $I->click('Crear y regresar al listado');
  142. $I->wait('8');
  143. $I->see('ha sido creado con éxito.');
  144. }catch(\Exception $e){
  145. $I->makeScreenshot('02_Add_Cablemodem/7_Cablemodem');
  146. }
  147. try{
  148. $I->wait('5');
  149. $I->acceptPopup();
  150. }catch(\Exception $e){}
  151. }
  152. }