1_baseCest.php 14 KB

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