1_baseCest.php 8.9 KB

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