123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- <?php
- use Codeception\Util\Locator;
- # comando para correr el test: php ./vendor/bin/codecept run --steps tests/acceptance/1_baseCest.php
- class BaseCest
- {
- public function frontpageWorks(AcceptanceTester $I)
- {
- $cliente = "fd3";
- shell_exec('mkdir -p ./tests/_output/debug/Add/');
- #log in
- try{
- $I->amOnPage('/');
- $I->see('Nombre de usuario');
- $I->fillField('_username', 'admin');
- $I->fillField('_password', 'admin');
- $I->click("//*[@title='Close Toolbar']");
- $I->click('_submit');
- $I->wait('3');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/0_login');
- }
- /*
- # ____________________ Base _____________________
- # Codigos de Autenticación
- try{
- $I->amOnUrl('http://base.' . $cliente . '.flowdat.com/admin/base/oauthserver/authcode/create');
- $I->fillField('Usuario', 'iksop'."\n");
- $I->fillField('Token', '002');
- $I->fillField('URI de Redirección','TestDirección');
- $I->fillField('Expiración','4');
- $I->fillField('Alcance','TestFernando');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/1_oauthcode');
- }
- # Clientes OAuth
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/oauthclient/create');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/2_oauthclient');
- }
- # Tokens de Acceso
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/accesstoken/create');
- $I->fillField('Usuario', 'iksop'."\n");
- $I->fillField('Token', '002');
- $I->fillField('Expiración','4');
- $I->fillField('Alcance','TestFernando');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/3_accesstoken');
- }
- # Tokens de Refresco
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/base/oauthserver/refreshtoken/create');
- $I->fillField('Usuario', 'iksop'."\n");
- $I->fillField('Token', '002');
- $I->fillField('Expiración','4');
- $I->fillField('Alcance','TestFernando');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/4_refreshtoken');
- }
- */
- # Workflow
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
- $I->fillField('Nombre','fernandotest');
- $I->fillField('Descripción', 'FernandoTest');
- $I->fillField('Tipo de Workflow', 'workflow'."\n");
- $I->fillField('Supports', 'ClientBundle\Entity\Client'."\n");
- $I->click('button.btn.btn-success');
- $I->wait('18');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/5_workflow');
- }
- # Action
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/workflow/action/create');
- $I->fillField('Nombre', 'FernandoTest');
- $I->fillField('Evento', 'transition'."\n");
- $I->fillField('Workflow', 'FernandoTest');
- $I->fillField('Referencia', 'FernandoTest'."\t");
- $I->fillField('Clase', "\n"."\n");
- $I->fillField("//*[@class='ace_text-input']", 'template');
- $I->wait('5');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/6_action');
- }
- # Alertas
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/alert/alert/create');
- $I->fillField('Título','TestFernando');
- $I->fillField('Cuerpo','TestFernando');
- $I->click('span.control-label__text');
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/7_alert');
- }
- # Tipo de Alertas
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/alert/alerttype/create');
- $I->fillField('Nombre Corto','Test');
- $I->fillField("(//*[@class=' form-control'])[2]",'TestFernando');
- $I->wait('5');
- $I->click("(//*[@class='iCheck-helper'])[1]");
- $I->click("(//*[@class='iCheck-helper'])[2]");
- $I->click('button.btn.btn-success');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/8_alerttype');
- }
- # Crear Usuarios
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/user/create');
- $I->fillField('Nombre de Usuario', 'TestFernando');
- $I->fillField('E-Mail', 'TestFernando@test');
- $I->fillField('Contraseña', 'TestFernando');
- $I->fillField('Nombre', 'TestFernando');
- $I->fillField('Apellido', 'TestFernando');
- $I->fillField('Acción inicial', 'Inicio'."\n");
- $I->fillField('Tenencias', 'Base'."\n");
- $I->click("Roles");
- # solo Role de Admin y User
- # Roles
- $I->click("(//*[@class='iCheck-helper'])[1]");
- # $I->click("(//*[@class='iCheck-helper'])[4]");
- # $I->click("(//*[@class='iCheck-helper'])[5]");
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/9_user');
- }
- # Grupos
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/group/create');
- $I->fillField('Nombre de Grupo', 'TestFernando');
- $I->click("(//*[@class='icheckbox_square-blue'])[1]"); # selecciona el checkbox 1
- $I->fillField('Usuarios', 'TestFernando'."\n");
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/10_group');
- }
- # Tenencias
- # ________________________ NO BORRA LA TENENCIA DESPUÉS ________________________
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/tenancy/create');
- $I->fillField('Tenencia','TestFernando');
- $I->click("(//*[@class='icheckbox_square-blue'])[1]");
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/11_tenancy');
- }
- # Clientes
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/client/client/create');
- $I->fillField('External Id', 'extId_001336');
- $I->fillField('Nombre', 'TestFernando');
- $I->fillField('Companía', 'TestFernando');
- $I->fillField('Comentario', 'TestFernando');
- $I->fillField('Email', 'fernando@interlink.com.ar');
- $I->fillField('Teléfono', '034070304');
- $I->click('Mapa');
- $I->wait('3');
- $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 535, Rosario'."\n"."\n");
- $I->click("//*[@id='searchtext9']");
- $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
- $I->wait('3');
- $I->click('Crear y regresar al listado');
- $I->wait('8');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/12_client');
- }
- # Dispositivos
- try{
- $I->amOnUrl('http://base.'.$cliente.'.flowdat.com/admin/license/device/create');
- $I->fillField('Id Dispositivo', '342234');
- $I->fillField('Ip', '193.12.29.4');
- $I->click('Crear y regresar al listado');
- $I->wait('8');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/13_device');
- }
- # ____________ FTTH _________________
- # Modelo OLT
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/oltmodel/create');
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Propiedades','TestFernando');
- $I->click("//*[@title='Close Toolbar']");
- #$I->fillField('Extra Data','TestFernando');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/14_oltmodel');
- }
- # Modelo ONU
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/onumodel/create');
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Extra Data','
- {
- "type": "HG260",
- "telnet": "/tmp"
- }');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/15_onumodel');
- }
- # Perfil
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/profile/create');
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Upload','6');
- $I->fillField('Download','10');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/16_profile');
- }
- # OLT
- # _____________ Crea la OLT NO HABILITADA ___________________
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/olt/create');
- $I->fillField('Nombre', 'TestFernando');
- $I->fillField('Modelo','FiberHome-AN5516-01'."\n");
- $I->click('Configuración');
- $I->wait('1');
- $I->fillField('Ip','195.12.1.6');
- $I->fillField('SSH USER','TestFernando');
- $I->fillField('SSH PASS','TestFernando');
- $I->click('Mapa');
- $I->wait('3');
- $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 900, Rosario'."\n"."\n");
- $I->click("//*[@id='searchtext9']");
- $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
- $I->wait('3');
- $I->click('Crear y regresar al listado');
- $I->wait('10');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/17_olt');
- }
- # NAP
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/nap/create');
- $I->fillField('Nombre','TestFernando');
- # $I->fillField('Padre','Centro'."\n");
- $I->fillField('OLT', 'TestFernando'."\n");
- $I->fillField('Slot', '5');
- $I->fillField('Link', '5');
- $I->click('Mapa');
- $I->wait('3');
- $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 500, Rosario'."\n"."\n");
- $I->click("//*[@id='searchtext9']");
- $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
- $I->wait('3');
- $I->click('Crear y regresar al listado');
- $I->wait('8');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/18_nap');
- }
- # ONU
- # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
- # Clave duplicada
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
- $I->fillField('clientId_search', 'TestFernando');
- $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
- $I->wait('3');
- $I->click("//*[@class='ui-corner-all']");
- $I->wait('3');
- #$I->click("//*[@title='Close Toolbar']");
- $I->fillField('Número Serie Pon','fhtt041a89pe');
- $I->fillField('Perfil','Base'."\n");
- $I->fillField('NAP','TestFernando'."\n");
- $I->fillField('Modelo','TestFernando'."\n");
- $I->wait('3');
- $I->click('Avanzado');
- $I->wait('8');
- # $I->fillField('Número Serie', '2342342');
- $I->fillField('Mac', 'fd34sd24fgr4');
- $I->fillField('OLT', 'TestFernando'."\n");
- $I->click('Mapa');
- $I->wait('3');
- $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 535, Rosario'."\n"."\n");
- $I->click("//*[@id='searchtext9']");
- $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
- $I->wait('3');
- $I->click('Crear y regresar al listado');
- $I->wait('18');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/19_onu');
- }
- # ONU 2
- # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
- # Clave duplicada
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
- $I->fillField('clientId_search', 'TestFernando');
- $I->pressKey("//*[@class='form-control ui-autocomplete-input']", WebDriverKeys::DOWN);
- $I->wait('3');
- $I->click("//*[@class='ui-corner-all']");
- $I->wait('3');
- #$I->click("//*[@title='Close Toolbar']");
- $I->fillField('Número Serie Pon','fhtt041a89pf');
- $I->fillField('Perfil','Base'."\n");
- $I->fillField('NAP','TestFernando'."\n");
- $I->fillField('Modelo','TestFernando'."\n");
- $I->wait('3');
- $I->click('Avanzado');
- $I->wait('8');
- # $I->fillField('Número Serie', '2342342');
- $I->fillField('Mac', 'fd34sd24fgf2');
- $I->fillField('OLT', 'TestFernando'."\n");
- $I->click('Mapa');
- $I->wait('3');
- $I->fillField("//*[@id='searchtext9']",'Mariano Moreno 525, Rosario'."\n"."\n");
- $I->click("//*[@id='searchtext9']");
- $I->pressKey("//*[@id='searchtext9']", WebDriverKeys::ENTER);
- $I->wait('3');
- $I->click('Crear y regresar al listado');
- $I->wait('18');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/19_onu2');
- }
- # Workflow
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
- $I->fillField('Nombre','testfernando');
- $I->fillField('Descripción','TestFernando');
- $I->fillField('Supports',"\n"."\n");
- $I->click('Crear y regresar al listado');
- $I->wait('15');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/20_workflow');
- }
- # Action Workflow
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/workflow/action/create');
- $I->fillField('Nombre','testfernando');
- $I->fillField('Evento','enter'."\n");
- $I->fillField('Workflow','TestFernando');
- $I->fillField('Referencia', 'TestFernando');
- $I->fillField('Clase',"\n"."\n");
- $I->fillField("//*[@class='ace_text-input']",'TestFernando');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/21_action');
- }
- # Template
- try{
- $I->amOnUrl('http://ftth.'.$cliente.'.flowdat.com/admin/template/template/create');
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Contenido','TestFernando');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('Add/22_template');
- }
- /*
- # ____________ Maps ______________
- # Mapas
- $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/map/create');
- # Vectores
- $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/vector/create');
- # Objetos
- $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/object/create');
- # Tipos
- $I->amOnUrl('http://mapas.fd3.flowdat.com/admin/map/objecttype/create');
- */
- # ________________ STATS ________________________
- # Servidor Dispositivos
- # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/deviceserver/create');
- # $I->fillField('Nombre','TestFernando');
- # $I->fillField('Url','http://base'.$cliente.'.flowdat.com/api/devices.json');
- # $I->click("//*[@class='icheckbox_square-blue']");
- # $I->click('Crear y regresar al listado');
- # $I->wait('5');
- # $I->see('ha sido creado con éxito');
- # Dispositivo
- # ____________ Está roto el formulario ________________________
- # $I->amOnUrl('http://stats.fd3.flowdat.com/admin/stats/device/create');
- # $I->fillField('Servidor','TestFernando'."\n");
- # $I->fillField('Id Dispositivo','3');
- # $I->fillField('Tipo Dispositivo',"\n"."\n");
- # $I->fillField('Ip','199.29.43.9');
- # $I->click('Crear y regresar al listado');
- # $I->wait('5');
- # $I->see('ha sido creado con éxito');
- }
- }
|