1_baseCest.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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 BaseCest
  5. {
  6. public function frontpageWorks(AcceptanceTester $I)
  7. {
  8. $cliente = "fd3";
  9. shell_exec('mkdir -p ./tests/_output/debug/Add/');
  10. #log in
  11. try{
  12. $I->amOnPage('/');
  13. $I->see('Nombre de usuario');
  14. $I->fillField('_username', 'admin');
  15. $I->fillField('_password', 'admin');
  16. $I->click('_submit');
  17. $I->wait('3');
  18. }catch(\Exception $e){
  19. $I->makeScreenshot('Add/0_login');
  20. }
  21. # ____________________ Base _____________________
  22. # Codigos de Autenticación
  23. try{
  24. $I->amOnUrl('http://base.' . $cliente . '.flowdat.com/admin/base/oauthserver/authcode/create');
  25. $I->fillField('Usuario', 'iksop'."\n");
  26. $I->fillField('Token', '002');
  27. $I->fillField('URI de Redirección','TestDirección');
  28. $I->fillField('Expiración','4');
  29. $I->fillField('Alcance','TestFernando');
  30. $I->click('button.btn.btn-success');
  31. $I->wait('5');
  32. $I->see('ha sido creado con éxito');
  33. }catch(\Exception $e){
  34. $I->makeScreenshot('Add/1_oauthcode');
  35. }
  36. # Clientes OAuth
  37. try{
  38. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/oauthclient/create');
  39. $I->click('button.btn.btn-success');
  40. $I->wait('5');
  41. $I->see('ha sido creado con éxito');
  42. }catch(\Exception $e){
  43. $I->makeScreenshot('Add/2_oauthclient');
  44. }
  45. # Tokens de Acceso
  46. try{
  47. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/accesstoken/create');
  48. $I->fillField('Usuario', 'iksop'."\n");
  49. $I->fillField('Token', '002');
  50. $I->fillField('Expiración','4');
  51. $I->fillField('Alcance','TestFernando');
  52. $I->click('button.btn.btn-success');
  53. $I->wait('5');
  54. $I->see('ha sido creado con éxito');
  55. }catch(\Exception $e){
  56. $I->makeScreenshot('Add/3_accesstoken');
  57. }
  58. # Tokens de Refresco
  59. try{
  60. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/refreshtoken/create');
  61. $I->fillField('Usuario', 'iksop'."\n");
  62. $I->fillField('Token', '002');
  63. $I->fillField('Expiración','4');
  64. $I->fillField('Alcance','TestFernando');
  65. $I->click('button.btn.btn-success');
  66. $I->wait('5');
  67. $I->see('ha sido creado con éxito');
  68. }catch(\Exception $e){
  69. $I->makeScreenshot('Add/4_refreshtoken');
  70. }
  71. # Workflow
  72. try{
  73. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
  74. $I->fillField('Nombre','fernandotest');
  75. $I->fillField('Descripción', 'FernandoTest');
  76. $I->fillField('Tipo de Workflow', 'workflow'."\n");
  77. $I->fillField('Supports', 'ClientBundle\Entity\Client'."\n");
  78. $I->click('button.btn.btn-success');
  79. $I->wait('18');
  80. $I->see('ha sido creado con éxito');
  81. }catch(\Exception $e){
  82. $I->makeScreenshot('Add/5_workflow');
  83. }
  84. # Action
  85. try{
  86. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/workflow/action/create');
  87. $I->fillField('Nombre', 'FernandoTest');
  88. $I->fillField('Evento', 'transition'."\n");
  89. $I->fillField('Workflow', 'FernandoTest');
  90. $I->fillField('Referencia', 'FernandoTest'."\t");
  91. $I->fillField('Clase', "\n"."\n");
  92. $I->fillField("//*[@class='ace_text-input']", 'template');
  93. $I->wait('5');
  94. $I->click('button.btn.btn-success');
  95. $I->wait('5');
  96. $I->see('ha sido creado con éxito');
  97. }catch(\Exception $e){
  98. $I->makeScreenshot('Add/6_action');
  99. }
  100. # Alertas
  101. try{
  102. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/alert/alert/create');
  103. $I->fillField('Título','TestFernando');
  104. $I->fillField('Cuerpo','TestFernando');
  105. $I->click('span.control-label__text');
  106. $I->click('button.btn.btn-success');
  107. $I->wait('5');
  108. $I->see('ha sido creado con éxito');
  109. }catch(\Exception $e){
  110. $I->makeScreenshot('Add/7_alert');
  111. }
  112. # Tipo de Alertas
  113. try{
  114. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/alert/alerttype/create');
  115. $I->fillField('Nombre Corto','Test');
  116. $I->fillField("(//*[@class=' form-control'])[2]",'TestFernando');
  117. $I->wait('5');
  118. $I->click("(//*[@class='iCheck-helper'])[1]");
  119. $I->click("(//*[@class='iCheck-helper'])[2]");
  120. $I->click('button.btn.btn-success');
  121. $I->wait('5');
  122. $I->see('ha sido creado con éxito');
  123. }catch(\Exception $e){
  124. $I->makeScreenshot('Add/8_alerttype');
  125. }
  126. # Crear Usuarios
  127. try{
  128. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/user/create');
  129. $I->fillField('Nombre de Usuario', 'TestFernando');
  130. $I->fillField('E-Mail', 'TestFernando@test');
  131. $I->fillField('Contraseña', 'TestFernando');
  132. $I->fillField('Nombre', 'TestFernando');
  133. $I->fillField('Apellido', 'TestFernando');
  134. $I->fillField('Acción inicial', 'Inicio'."\n");
  135. $I->fillField('Tenencias', 'Base'."\n");
  136. $I->click("Roles");
  137. # solo Role de Admin y User
  138. # Roles
  139. $I->click("(//*[@class='iCheck-helper'])[1]");
  140. # $I->click("(//*[@class='iCheck-helper'])[4]");
  141. # $I->click("(//*[@class='iCheck-helper'])[5]");
  142. $I->click('Crear y regresar al listado');
  143. $I->wait('5');
  144. $I->see('ha sido creado con éxito');
  145. }catch(\Exception $e){
  146. $I->makeScreenshot('Add/9_user');
  147. }
  148. # Grupos
  149. try{
  150. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/group/create');
  151. $I->fillField('Nombre de Grupo', 'TestFernando');
  152. $I->click("(//*[@class='icheckbox_square-blue'])[1]"); # selecciona el checkbox 1
  153. $I->fillField('Usuarios', 'TestFernando'."\n");
  154. $I->click('Crear y regresar al listado');
  155. $I->wait('5');
  156. $I->see('ha sido creado con éxito');
  157. }catch(\Exception $e){
  158. $I->makeScreenshot('Add/10_group');
  159. }
  160. # Tenencias
  161. # ________________________ NO BORRA LA TENENCIA DESPUÉS ________________________
  162. try{
  163. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/tenancy/create');
  164. $I->fillField('Tenencia','TestFernando');
  165. $I->click("(//*[@class='icheckbox_square-blue'])[1]");
  166. $I->click('Crear y regresar al listado');
  167. $I->wait('5');
  168. $I->see('ha sido creado con éxito');
  169. }catch(\Exception $e){
  170. $I->makeScreenshot('Add/11_tenancy');
  171. }
  172. # Clientes
  173. try{
  174. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/client/client/create');
  175. $I->fillField('External Id', 'extId_001336');
  176. $I->fillField('Nombre', 'TestFernando');
  177. $I->fillField('Companía', 'TestFernando');
  178. $I->fillField('Comentario', 'TestFernando');
  179. $I->fillField('Email', 'fernando@interlink.com.ar');
  180. $I->fillField('Teléfono', '034070304');
  181. $I->click('Crear y regresar al listado');
  182. $I->wait('5');
  183. $I->see('ha sido creado con éxito');
  184. }catch(\Exception $e){
  185. $I->makeScreenshot('Add/12_client');
  186. }
  187. # Dispositivos
  188. try{
  189. $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/license/device/create');
  190. $I->fillField('Id Dispositivo', '342234');
  191. $I->fillField('Ip', '193.12.29.4');
  192. $I->click('Crear y regresar al listado');
  193. $I->wait('8');
  194. $I->see('ha sido creado con éxito');
  195. }catch(\Exception $e){
  196. $I->makeScreenshot('Add/13_device');
  197. }
  198. # ____________ FTTH _________________
  199. # Modelo OLT
  200. try{
  201. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/oltmodel/create');
  202. $I->fillField('Nombre','TestFernando');
  203. $I->fillField('Propiedades','TestFernando');
  204. #$I->fillField('Extra Data','TestFernando');
  205. $I->click('Crear y regresar al listado');
  206. $I->wait('5');
  207. $I->see('ha sido creado con éxito');
  208. }catch(\Exception $e){
  209. $I->makeScreenshot('Add/14_oltmodel');
  210. }
  211. # Modelo ONU
  212. try{
  213. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/onumodel/create');
  214. $I->fillField('Nombre','TestFernando');
  215. $I->fillField('Extra Data','
  216. {
  217. "type": "HG260",
  218. "telnet": "/tmp"
  219. }');
  220. $I->click('Crear y regresar al listado');
  221. $I->wait('5');
  222. $I->see('ha sido creado con éxito');
  223. }catch(\Exception $e){
  224. $I->makeScreenshot('Add/15_onumodel');
  225. }
  226. # Perfil
  227. try{
  228. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/profile/create');
  229. $I->fillField('Nombre','TestFernando');
  230. $I->fillField('Upload','6');
  231. $I->fillField('Download','10');
  232. $I->click('Crear y regresar al listado');
  233. $I->wait('5');
  234. $I->see('ha sido creado con éxito');
  235. }catch(\Exception $e){
  236. $I->makeScreenshot('Add/16_profile');
  237. }
  238. # OLT
  239. # _____________ Crea la OLT NO HABILITADA ___________________
  240. try{
  241. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/olt/create');
  242. $I->fillField('Nombre', 'TestFernando');
  243. $I->fillField('Modelo','FiberHome-AN5516-01'."\n");
  244. $I->click('Configuración');
  245. $I->wait('1');
  246. $I->fillField('Ip','195.12.1.6');
  247. $I->fillField('SSH USER','TestFernando');
  248. $I->fillField('SSH PASS','TestFernando');
  249. $I->click('Crear y regresar al listado');
  250. $I->wait('5');
  251. $I->see('ha sido creado con éxito');
  252. }catch(\Exception $e){
  253. $I->makeScreenshot('Add/17_olt');
  254. }
  255. # NAP
  256. try{
  257. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/nap/create');
  258. $I->fillField('Nombre','TestFernando');
  259. # $I->fillField('Padre','Centro'."\n");
  260. $I->click('Crear y regresar al listado');
  261. $I->wait('5');
  262. $I->see('ha sido creado con éxito');
  263. }catch(\Exception $e){
  264. $I->makeScreenshot('Add/18_nap');
  265. }
  266. # ONU
  267. # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
  268. # Clave duplicada
  269. try{
  270. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
  271. $I->fillField('clientId_search', 'TestFernando');
  272. $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
  273. $I->wait('3');
  274. $I->click("//*[@class='ui-corner-all']");
  275. $I->wait('3');
  276. $I->fillField('Número Serie Pon','fhtt041a89pe');
  277. $I->fillField('Perfil','Base'."\n");
  278. $I->fillField('NAP','TestFernando'."\n");
  279. $I->fillField('Modelo','TestFernando'."\n");
  280. $I->wait('3');
  281. $I->click('Avanzado');
  282. $I->wait('5');
  283. $I->fillField('Número Serie', '234234232');
  284. $I->fillField('Mac', 'fd34sd24fgr4');
  285. $I->fillField('OLT', 'TestFernando'."\n");
  286. # $I->click("(//*[@class='select2-arrow'])[5]");
  287. #$I->wait('3');
  288. # $I->click("(//*[@class='select2-result-label'])[1]");
  289. $I->click('Crear y regresar al listado');
  290. $I->wait('18');
  291. $I->see('ha sido creado con éxito');
  292. #$I->click("(//*[@class='icheckbox_square-blue'])[1]");
  293. }catch(\Exception $e){
  294. $I->makeScreenshot('Add/19_onu');
  295. }
  296. # Workflow
  297. try{
  298. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
  299. $I->fillField('Nombre','testfernando');
  300. $I->fillField('Descripción','TestFernando');
  301. $I->fillField('Supports',"\n"."\n");
  302. $I->click('Crear y regresar al listado');
  303. $I->wait('15');
  304. $I->see('ha sido creado con éxito');
  305. }catch(\Exception $e){
  306. $I->makeScreenshot('Add/20_workflow');
  307. }
  308. # Action Workflow
  309. try{
  310. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/workflow/action/create');
  311. $I->fillField('Nombre','testfernando');
  312. $I->fillField('Evento','enter'."\n");
  313. $I->fillField('Workflow','TestFernando');
  314. $I->fillField('Referencia', 'TestFernando');
  315. $I->fillField('Clase',"\n"."\n");
  316. $I->fillField("//*[@class='ace_text-input']",'TestFernando');
  317. $I->click('Crear y regresar al listado');
  318. $I->wait('5');
  319. $I->see('ha sido creado con éxito');
  320. }catch(\Exception $e){
  321. $I->makeScreenshot('Add/21_action');
  322. }
  323. # Template
  324. try{
  325. $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/template/template/create');
  326. $I->fillField('Nombre','TestFernando');
  327. $I->fillField('Contenido','TestFernando');
  328. $I->click('Crear y regresar al listado');
  329. $I->wait('5');
  330. $I->see('ha sido creado con éxito');
  331. }catch(\Exception $e){
  332. $I->makeScreenshot('Add/22_template');
  333. }
  334. /*
  335. # ____________ Maps ______________
  336. # Mapas
  337. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/map/create');
  338. # Vectores
  339. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/vector/create');
  340. # Objetos
  341. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/object/create');
  342. # Tipos
  343. $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/objecttype/create');
  344. */
  345. # ________________ STATS ________________________
  346. # Servidor Dispositivos
  347. # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/deviceserver/create');
  348. # $I->fillField('Nombre','TestFernando');
  349. # $I->fillField('Url','http://base'.$cliente.'.flowdat.com/api/devices.json');
  350. # $I->click("//*[@class='icheckbox_square-blue']");
  351. # $I->click('Crear y regresar al listado');
  352. # $I->wait('5');
  353. # $I->see('ha sido creado con éxito');
  354. # Dispositivo
  355. # ____________ Está roto el formulario ________________________
  356. # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/device/create');
  357. # $I->fillField('Servidor','TestFernando'."\n");
  358. # $I->fillField('Id Dispositivo','3');
  359. # $I->fillField('Tipo Dispositivo',"\n"."\n");
  360. # $I->fillField('Ip','199.29.43.9');
  361. # $I->click('Crear y regresar al listado');
  362. # $I->wait('5');
  363. # $I->see('ha sido creado con éxito');
  364. }
  365. }