3_baseUserCest.php 12 KB

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