1_baseCest.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <?php
  2. use Codeception\Util\Locator;
  3. class BaseCest
  4. {
  5. public function frontpageWorks(AcceptanceTester $I)
  6. {
  7. #log in
  8. $I->amOnPage('/');
  9. $I->see('Nombre de usuario');
  10. $I->fillField('_username', 'admin');
  11. $I->fillField('_password', 'adminpass');
  12. $I->click('_submit');
  13. $I->wait('3');
  14. # ____________________ Base _____________________
  15. # Codigos de Autenticación
  16. $I->amOnUrl('http://base.fd3.flowdat.com/admin/base/oauthserver/authcode/create');
  17. $I->fillField('Usuario', 'iksop'."\n");
  18. $I->fillField('Token', '002');
  19. $I->fillField('URI de Redirección','TestDirección');
  20. $I->fillField('Expiración','4');
  21. $I->fillField('Alcance','TestFernando');
  22. $I->click('button.btn.btn-success');
  23. $I->wait('5');
  24. $I->see('ha sido creado con éxito');
  25. # Clientes OAuth
  26. $I->amOnUrl('http://base.fd3.flowdat.com/admin/base/oauthserver/oauthclient/create');
  27. $I->click('button.btn.btn-success');
  28. $I->wait('5');
  29. $I->see('ha sido creado con éxito');
  30. # Tokens de Acceso
  31. $I->amOnUrl('http://base.fd3.flowdat.com/admin/base/oauthserver/accesstoken/create');
  32. $I->fillField('Usuario', 'iksop'."\n");
  33. $I->fillField('Token', '002');
  34. $I->fillField('Expiración','4');
  35. $I->fillField('Alcance','TestFernando');
  36. $I->click('button.btn.btn-success');
  37. $I->wait('5');
  38. $I->see('ha sido creado con éxito');
  39. # Tokens de Refresco
  40. $I->amOnUrl('http://base.fd3.flowdat.com/admin/base/oauthserver/refreshtoken/create');
  41. $I->fillField('Usuario', 'iksop'."\n");
  42. $I->fillField('Token', '002');
  43. $I->fillField('Expiración','4');
  44. $I->fillField('Alcance','TestFernando');
  45. $I->click('button.btn.btn-success');
  46. $I->wait('5');
  47. $I->see('ha sido creado con éxito');
  48. # Workflow
  49. $I->amOnUrl('http://base.fd3.flowdat.com/admin/workflow/workflow/create');
  50. $I->fillField('Nombre','fernandotest');
  51. $I->fillField('Descripción', 'FernandoTest');
  52. $I->fillField('Tipo de Workflow', 'workflow'."\n");
  53. $I->fillField('Supports', 'ClientBundle\Entity\Client'."\n");
  54. $I->click('button.btn.btn-success');
  55. $I->wait('18');
  56. $I->see('ha sido creado con éxito');
  57. # Action
  58. $I->amOnUrl('http://base.fd3.flowdat.com/admin/workflow/action/create');
  59. $I->fillField('Nombre', 'FernandoTest');
  60. $I->fillField('Evento', 'transition'."\n");
  61. $I->fillField('Workflow', 'FernandoTest');
  62. $I->fillField('Referencia', 'FernandoTest'."\t");
  63. $I->fillField('Clase', "\n"."\n");
  64. $I->fillField("//*[@class='ace_text-input']", 'template');
  65. $I->wait('5');
  66. $I->click('button.btn.btn-success');
  67. $I->wait('5');
  68. $I->see('ha sido creado con éxito');
  69. # Alertas
  70. $I->amOnUrl('http://base.fd3.flowdat.com/admin/alert/alert/create');
  71. $I->fillField('Título','TestFernando');
  72. $I->fillField('Cuerpo','TestFernando');
  73. $I->click('span.control-label__text');
  74. $I->click('button.btn.btn-success');
  75. $I->wait('5');
  76. $I->see('ha sido creado con éxito');
  77. # Tipo de Alertas
  78. $I->amOnUrl('http://base.fd3.flowdat.com/admin/alert/alerttype/create');
  79. $I->fillField('Nombre Corto','Test');
  80. $I->fillField("(//*[@class=' form-control'])[2]",'TestFernando');
  81. $I->wait('5');
  82. $I->click("(//*[@class='iCheck-helper'])[1]");
  83. $I->click("(//*[@class='iCheck-helper'])[2]");
  84. $I->click('button.btn.btn-success');
  85. $I->wait('5');
  86. $I->see('ha sido creado con éxito');
  87. # Crear Usuarios
  88. $I->amOnUrl('http://base.fd3.flowdat.com/admin/user/create');
  89. $I->fillField('Nombre de Usuario', 'TestFernando');
  90. $I->fillField('E-Mail', 'TestFernando@test');
  91. $I->fillField('Contraseña', 'TestFernando');
  92. $I->fillField('Nombre', 'TestFernando');
  93. $I->fillField('Apellido', 'TestFernando');
  94. # Roles
  95. $I->click("(//*[@class='iCheck-helper'])[2]");
  96. $I->click("(//*[@class='iCheck-helper'])[3]");
  97. $I->click("(//*[@class='iCheck-helper'])[5]");
  98. $I->fillField('Acción inicial',"\n"."\n");
  99. $I->fillField('Tenencias', 'Tenencia Base'."\n");
  100. $I->click('Crear y regresar al listado');
  101. $I->wait('5');
  102. $I->see('ha sido creado con éxito');
  103. # Grupos
  104. $I->amOnUrl('http://base.fd3.flowdat.com/admin/group/create');
  105. $I->fillField('Nombre de Grupo', 'TestFernando');
  106. $I->click("(//*[@class='icheckbox_square-blue'])[1]"); # selecciona el checkbox 1
  107. $I->fillField('Usuarios', 'TestFernando'."\n");
  108. $I->click('Crear y regresar al listado');
  109. $I->wait('5');
  110. $I->see('ha sido creado con éxito');
  111. # Tenencias
  112. # ________________________ NO BORRA LA TENENCIA DESPUÉS ________________________
  113. $I->amOnUrl('http://base.fd3.flowdat.com/admin/tenancy/create');
  114. $I->fillField('Tenencia','TestFernando');
  115. $I->click("(//*[@class='icheckbox_square-blue'])[1]");
  116. $I->click('Crear y regresar al listado');
  117. $I->wait('5');
  118. $I->see('ha sido creado con éxito');
  119. # Clientes
  120. $I->amOnUrl('http://base.fd3.flowdat.com/admin/client/client/create');
  121. $I->fillField('External Id', 'extId_001336');
  122. $I->fillField('Nombre', 'TestFernando');
  123. $I->fillField('Companía', 'TestFernando');
  124. $I->fillField('Comentario', 'TestFernando');
  125. $I->fillField('Email', 'fernando@interlink.com.ar');
  126. $I->fillField('Teléfono', '034070304');
  127. $I->click('Crear y regresar al listado');
  128. $I->wait('5');
  129. $I->see('ha sido creado con éxito');
  130. # Dispositivos
  131. $I->amOnUrl('http://base.fd3.flowdat.com/admin/license/device/create');
  132. $I->fillField('Id Dispositivo', '342234');
  133. $I->fillField('Ip', '193.12.29.4');
  134. $I->click('Crear y regresar al listado');
  135. $I->wait('8');
  136. $I->see('ha sido creado con éxito');
  137. # ____________ FTTH _________________
  138. # ONU
  139. # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
  140. # Clave duplicada
  141. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/onu/create');
  142. $I->click("//*[@class='select2-selection__arrow']");
  143. $I->wait('3');
  144. $I->fillField("//*[@class='select2-search__field']",'TestFernando'."\n");
  145. $I->wait('3');
  146. $I->pressKey("//*[@class='select2-search__field']",WebDriverKeys::ENTER);
  147. $I->wait('3');
  148. $I->fillField('Número Serie Pon','fhtt041a8pe');
  149. $I->selectOption('Perfil','3');
  150. $I->selectOption('NAP','2');
  151. $I->selectOption('Modelo','2');
  152. $I->wait('3');
  153. # $I->click("(//*[@class='select2-arrow'])[5]");
  154. #$I->wait('3');
  155. # $I->click("(//*[@class='select2-result-label'])[1]");
  156. $I->click('Crear y regresar al listado');
  157. $I->wait('18');
  158. $I->see('ha sido creado con éxito');
  159. #$I->click("(//*[@class='icheckbox_square-blue'])[1]");
  160. # OLT
  161. # _____________ Crea la OLT NO HABILITADA ___________________
  162. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/olt/create');
  163. $I->fillField('Nombre', 'TestFernando');
  164. $I->selectOption('Modelo','FiberHome-AN5516-01');
  165. $I->click('Configuración');
  166. $I->wait('1');
  167. $I->fillField('Ip','195.12.1.6');
  168. $I->fillField('SSH USER','TestFernando');
  169. $I->fillField('SSH PASS','TestFernando');
  170. $I->click('Crear y regresar al listado');
  171. $I->wait('5');
  172. $I->see('ha sido creado con éxito');
  173. # Modelo OLT
  174. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/oltmodel/create');
  175. $I->fillField('Nombre','TestFernando');
  176. $I->fillField('Propiedades','TestFernando');
  177. #$I->fillField('Extra Data','TestFernando');
  178. $I->click('Crear y regresar al listado');
  179. $I->wait('5');
  180. $I->see('ha sido creado con éxito');
  181. # Modelo ONU
  182. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/onumodel/create');
  183. $I->fillField('Nombre','TestFernando');
  184. $I->fillField('Extra Data','
  185. {
  186. "type": "HG260",
  187. "telnet": "/tmp"
  188. }');
  189. $I->click('Crear y regresar al listado');
  190. $I->wait('5');
  191. $I->see('ha sido creado con éxito');
  192. # Perfil
  193. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/profile/create');
  194. $I->fillField('Nombre','TestFernando');
  195. $I->fillField('Upload','6');
  196. $I->fillField('Download','10');
  197. $I->click('Crear y regresar al listado');
  198. $I->wait('5');
  199. $I->see('ha sido creado con éxito');
  200. # NAP
  201. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/ftth/nap/create');
  202. $I->fillField('Nombre','TestFernando');
  203. $I->fillField('Padre','Centro'."\n");
  204. $I->click('Crear y regresar al listado');
  205. $I->wait('5');
  206. $I->see('ha sido creado con éxito');
  207. # Workflow
  208. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/workflow/workflow/create');
  209. $I->fillField('Nombre','testfernando');
  210. $I->fillField('Descripción','TestFernando');
  211. $I->fillField('Supports',"\n"."\n");
  212. $I->click('Crear y regresar al listado');
  213. $I->wait('8');
  214. $I->see('ha sido creado con éxito');
  215. # Action Workflow
  216. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/workflow/action/create');
  217. $I->fillField('Nombre','testfernando');
  218. $I->fillField('Evento','enter'."\n");
  219. $I->fillField('Workflow','TestFernando');
  220. $I->fillField('Referencia', 'TestFernando');
  221. $I->fillField('Clase',"\n"."\n");
  222. $I->fillField("//*[@class='ace_text-input']",'TestFernando');
  223. $I->click('Crear y regresar al listado');
  224. $I->wait('5');
  225. $I->see('ha sido creado con éxito');
  226. # Template
  227. $I->amOnUrl('http://ftth.fd3.flowdat.com/admin/template/template/create');
  228. $I->fillField('Nombre','TestFernando');
  229. $I->fillField('Contenido','TestFernando');
  230. $I->click('Crear y regresar al listado');
  231. $I->wait('5');
  232. $I->see('ha sido creado con éxito');
  233. /*
  234. # ____________ Maps ______________
  235. # Mapas
  236. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/map/create');
  237. # Vectores
  238. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/vector/create');
  239. # Objetos
  240. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/object/create');
  241. # Tipos
  242. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/objecttype/create');
  243. */
  244. # ________________ STATS ________________________
  245. # Servidor Dispositivos
  246. # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/deviceserver/create');
  247. # $I->fillField('Nombre','TestFernando');
  248. # $I->fillField('Url','http://base.fd3.flowdat.com/api/devices.json');
  249. # $I->click("//*[@class='icheckbox_square-blue']");
  250. # $I->click('Crear y regresar al listado');
  251. # $I->wait('5');
  252. # $I->see('ha sido creado con éxito');
  253. # Dispositivo
  254. # ____________ Está roto el formulario ________________________
  255. # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/device/create');
  256. # $I->fillField('Servidor','TestFernando'."\n");
  257. # $I->fillField('Id Dispositivo','3');
  258. # $I->fillField('Tipo Dispositivo',"\n"."\n");
  259. # $I->fillField('Ip','199.29.43.9');
  260. # $I->click('Crear y regresar al listado');
  261. # $I->wait('5');
  262. # $I->see('ha sido creado con éxito');
  263. }
  264. }