1C_FTTHCest.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <?php
  2. use Codeception\Util\Locator;
  3. # comando para correr el test: php ./vendor/bin/codecept run --steps tests/acceptance/1_baseCest.php
  4. class FTTHCest
  5. {
  6. public function frontpageWorks(AcceptanceTester $I)
  7. {
  8. $I->maximizeWindow();
  9. $cliente = "fd3";
  10. shell_exec('mkdir -p ./tests/_output/debug/03_Add_FTTH/');
  11. #log in
  12. try{
  13. $I->amOnPage('/');
  14. try{
  15. $I->acceptPopup();
  16. }catch(\Exception $e){}
  17. $I->see('Nombre de usuario');
  18. $I->fillField('_username', 'admin');
  19. $I->fillField('_password', 'admin');
  20. #$I->click("//*[@title='Close Toolbar']");
  21. $I->click('_submit');
  22. $I->wait('5');
  23. }catch(\Exception $e){
  24. $I->makeScreenshot('03_Add_FTTH/0_login');
  25. }
  26. # ____________ FTTH _________________
  27. # Modelo OLT
  28. try{
  29. try{
  30. $I->acceptPopup();
  31. }catch(\Exception $e){}
  32. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/oltmodel/create');
  33. try{
  34. $I->acceptPopup();
  35. }catch(\Exception $e){}
  36. $I->fillField('Nombre','TestFernando');
  37. $I->fillField('Propiedades','TestFernando');
  38. #$I->fillField('Extra Data','TestFernando');
  39. $I->click('Crear y regresar al listado');
  40. $I->wait('5');
  41. $I->see('ha sido creado con éxito');
  42. }catch(\Exception $e){
  43. $I->makeScreenshot('03_Add_FTTH/1_oltmodel');
  44. }
  45. # Modelo ONU
  46. try{
  47. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onumodel/create');
  48. try{
  49. $I->acceptPopup();
  50. }catch(\Exception $e){
  51. }
  52. $I->fillField('Nombre','TestFernando');
  53. $I->fillField('Extra Data','
  54. {
  55. "type": "HG260",
  56. "telnet": "/tmp"
  57. }');
  58. $I->click('Crear y regresar al listado');
  59. $I->wait('5');
  60. $I->see('ha sido creado con éxito');
  61. }catch(\Exception $e){
  62. $I->makeScreenshot('03_Add_FTTH/2_onumodel');
  63. }
  64. # Plantilla ONU
  65. try{
  66. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onutemplate/create');
  67. try{
  68. $I->acceptPopup();
  69. }catch(\Exception $e){}
  70. $I->fillField('Modelo','FiberHome-AN5506-04-b2'."\n");
  71. $I->fillField('Perfil','Base'."\n");
  72. $I->click('Crear y regresar al listado');
  73. $I->wait('5');
  74. $I->see('ha sido creado con éxito');
  75. }catch(\Exception $e){
  76. $I->makeScreenshot('03_Add_FTTH/3_plantillaONU');
  77. }
  78. # Perfil
  79. try{
  80. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/profile/create');
  81. try{
  82. $I->acceptPopup();
  83. }catch(\Exception $e){
  84. }
  85. $I->fillField('Nombre','TestFernando');
  86. $I->fillField('Upload','6');
  87. $I->fillField('Download','10');
  88. $I->click('Crear y regresar al listado');
  89. $I->wait('5');
  90. $I->see('ha sido creado con éxito');
  91. }catch(\Exception $e){
  92. $I->makeScreenshot('03_Add_FTTH/3_profile');
  93. }
  94. # OLT
  95. # _____________ Crea la OLT NO HABILITADA ___________________
  96. try{
  97. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/olt/create');
  98. try{
  99. $I->acceptPopup();
  100. }catch(\Exception $e){
  101. }
  102. $I->fillField('Nombre', 'TestFernando');
  103. $I->fillField('Modelo','FiberHome-AN5516-01'."\n");
  104. $I->click('Configuración');
  105. $I->wait('1');
  106. $I->fillField('Ip','195.12.1.6');
  107. $I->fillField('SSH USER','TestFernando');
  108. $I->fillField('SSH PASS','TestFernando');
  109. $I->click('Mapa');
  110. $I->wait('3');
  111. $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 900, Rosario'."\n"."\n");
  112. $I->click("//*[@id='searchtext9']");
  113. $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
  114. $I->wait('3');
  115. $I->click('Crear y regresar al listado');
  116. $I->wait('10');
  117. $I->see('ha sido creado con éxito');
  118. }catch(\Exception $e){
  119. $I->makeScreenshot('03_Add_FTTH/4_olt');
  120. }
  121. # NAP
  122. try{
  123. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/nap/create');
  124. try{
  125. $I->acceptPopup();
  126. }catch(\Exception $e){
  127. }
  128. $I->fillField('Nombre','TestFernando');
  129. # $I->fillField('Padre','Centro'."\n");
  130. $I->fillField('OLT', 'TestFernando'."\n");
  131. $I->fillField('Slot', '5');
  132. $I->fillField('Link', '5');
  133. $I->click('Mapa');
  134. $I->wait('3');
  135. $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 500, Rosario'."\n"."\n");
  136. $I->click("//*[@id='searchtext9']");
  137. $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
  138. $I->wait('3');
  139. $I->click('Crear y regresar al listado');
  140. $I->wait('8');
  141. $I->see('ha sido creado con éxito');
  142. }catch(\Exception $e){
  143. $I->makeScreenshot('03_Add_FTTH/5_nap');
  144. }
  145. # ONU
  146. # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
  147. # Clave duplicada
  148. try{
  149. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
  150. try{
  151. $I->acceptPopup();
  152. }catch(\Exception $e){
  153. }
  154. $I->fillField('clientId_search', 'TestFernando');
  155. $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
  156. $I->wait('3');
  157. $I->click("//*[@class='ui-corner-all']");
  158. $I->wait('3');
  159. #$I->click("//*[@title='Close Toolbar']");
  160. $I->fillField('Identificador','fhtt041a89pe');
  161. $I->fillField('Perfil','Base'."\n");
  162. $I->fillField('NAP','TestFernando'."\n");
  163. $I->fillField('Modelo','TestFernando'."\n");
  164. $I->wait('3');
  165. $I->click('Avanzado');
  166. $I->wait('8');
  167. $I->fillField('Número Serie', '1234567890987654');
  168. $I->fillField('Número Serie Pon', '123456789098');
  169. # $I->fillField('Mac', 'fd34sd24fgr4');
  170. $I->fillField('OLT', 'TestFernando'."\n");
  171. $I->click('Mapa');
  172. $I->wait('3');
  173. $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 535, Rosario'."\n"."\n");
  174. $I->click("//*[@id='searchtext9']");
  175. $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
  176. $I->wait('3');
  177. $I->click('Crear y regresar al listado');
  178. $I->wait('18');
  179. $I->see('ha sido creado con éxito');
  180. }catch(\Exception $e){
  181. $I->makeScreenshot('03_Add_FTTH/6_onu');
  182. }
  183. # ONU 2
  184. # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
  185. # Clave duplicada
  186. try{
  187. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
  188. try{
  189. $I->acceptPopup();
  190. }catch(\Exception $e){
  191. }
  192. $I->fillField('clientId_search', 'TestFernando');
  193. $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
  194. $I->wait('3');
  195. $I->click("//*[@class='ui-corner-all']");
  196. $I->wait('3');
  197. #$I->click("//*[@title='Close Toolbar']");
  198. $I->fillField('Identificador','fhtt041a89pf');
  199. $I->fillField('Perfil','Base'."\n");
  200. $I->fillField('NAP','TestFernando'."\n");
  201. $I->fillField('Modelo','TestFernando'."\n");
  202. $I->wait('3');
  203. $I->click('Avanzado');
  204. $I->wait('8');
  205. $I->fillField('Número Serie', '1234567890987653');
  206. $I->fillField('Número Serie Pon', '123456789097');
  207. # $I->fillField('Mac', 'fd34sd24fgf2');
  208. $I->fillField('OLT', 'TestFernando'."\n");
  209. $I->click('Mapa');
  210. $I->wait('3');
  211. $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 525, Rosario'."\n"."\n");
  212. $I->click("//*[@id='searchtext9']");
  213. $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
  214. $I->wait('3');
  215. $I->click('Crear y regresar al listado');
  216. $I->wait('18');
  217. $I->see('ha sido creado con éxito');
  218. }catch(\Exception $e){
  219. $I->makeScreenshot('03_Add_FTTH/7_onu2');
  220. }
  221. # Workflow
  222. try{
  223. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
  224. try{
  225. $I->acceptPopup();
  226. }catch(\Exception $e){
  227. }
  228. $I->fillField('Nombre','testfernando');
  229. $I->fillField('Descripción','TestFernando');
  230. $I->fillField('Supports',"\n"."\n");
  231. $I->click('Crear y regresar al listado');
  232. $I->wait('15');
  233. $I->see('ha sido creado con éxito');
  234. }catch(\Exception $e){
  235. $I->makeScreenshot('03_Add_FTTH/8_workflow');
  236. }
  237. # Action Workflow
  238. try{
  239. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/workflow/action/create');
  240. try{
  241. $I->acceptPopup();
  242. }catch(\Exception $e){
  243. }
  244. $I->fillField('Nombre','testfernando');
  245. $I->fillField('Evento','enter'."\n");
  246. $I->fillField('Workflow','TestFernando');
  247. $I->fillField('Referencia', 'TestFernando');
  248. $I->fillField('Clase',"\n"."\n");
  249. $I->fillField("//*[@class='ace_text-input']",'TestFernando');
  250. $I->click('Crear y regresar al listado');
  251. $I->wait('5');
  252. $I->see('ha sido creado con éxito');
  253. }catch(\Exception $e){
  254. $I->makeScreenshot('03_Add_FTTH/9_action');
  255. }
  256. # Template
  257. try{
  258. $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/template/template/create');
  259. try{
  260. $I->acceptPopup();
  261. }catch(\Exception $e){
  262. }
  263. $I->fillField('Nombre','TestFernando');
  264. $I->fillField('Contenido','TestFernandoTest');
  265. $I->click('Crear y regresar al listado');
  266. $I->wait('5');
  267. $I->see('ha sido creado con éxito');
  268. }catch(\Exception $e){
  269. $I->makeScreenshot('03_Add_FTTH/10_template');
  270. }
  271. /*
  272. # ____________ Maps ______________
  273. # Mapas
  274. $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/map/create');
  275. # Vectores
  276. $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/vector/create');
  277. # Objetos
  278. $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/object/create');
  279. # Tipos
  280. $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/objecttype/create');
  281. */
  282. # ________________ STATS ________________________
  283. # Servidor Dispositivos
  284. # $I->amOnUrl('https://stats.fd3.flowdat.com/admin/stats/deviceserver/create');
  285. # $I->fillField('Nombre','TestFernando');
  286. # $I->fillField('Url','https://base'.$cliente.'.flowdat.com/api/devices.json');
  287. # $I->click("//*[@class='icheckbox_square-blue']");
  288. # $I->click('Crear y regresar al listado');
  289. # $I->wait('5');
  290. # $I->see('ha sido creado con éxito');
  291. # Dispositivo
  292. # ____________ Está roto el formulario ________________________
  293. # $I->amOnUrl('https://stats.fd3.flowdat.com/admin/stats/device/create');
  294. # $I->fillField('Servidor','TestFernando'."\n");
  295. # $I->fillField('Id Dispositivo','3');
  296. # $I->fillField('Tipo Dispositivo',"\n"."\n");
  297. # $I->fillField('Ip','199.29.43.9');
  298. # $I->click('Crear y regresar al listado');
  299. # $I->wait('5');
  300. # $I->see('ha sido creado con éxito');
  301. # SELECT * FROM `GuiaTelefonica` WHERE NOT `ciudad` IN (SELECT `ciudad` FROM `Prefijo`)
  302. # UPDATE `GuiaTelefonica` SET `ciudad`='San Jeronimo del Sauce' WHERE ciudad='San Jer&oacute;nimo del Sauce'
  303. # INSERT INTO GuiaTelefonica(nombre, direccion, ciudad, telefono, prefijo)
  304. # SELECT nombre, direccion, ciudad, telefono, prefijo FROM TREntry
  305. try{
  306. $I->acceptPopup();
  307. }catch(\Exception $e){}
  308. }
  309. }