123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <?php
- use Codeception\Util\Locator;
- # comando para correr el test: php ./vendor/bin/codecept run --steps tests/acceptance/1_baseCest.php
- class FTTHCest
- {
- public function frontpageWorks(AcceptanceTester $I)
- {
- $I->maximizeWindow();
- $cliente = "fd3";
- shell_exec('mkdir -p ./tests/_output/debug/03_Add_FTTH/');
- #log in
- try{
- $I->amOnPage('/');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){}
- $I->see('Nombre de usuario');
- $I->fillField('_username', 'admin');
- $I->fillField('_password', 'admin');
- #$I->click("//*[@title='Close Toolbar']");
- $I->click('_submit');
- $I->wait('5');
- }catch(\Exception $e){
- $I->makeScreenshot('03_Add_FTTH/0_login');
- }
- # ____________ FTTH _________________
- # Modelo OLT
- try{
- try{
- $I->acceptPopup();
- }catch(\Exception $e){}
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/oltmodel/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){}
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Propiedades','TestFernando');
- #$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('03_Add_FTTH/1_oltmodel');
- }
- # Modelo ONU
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onumodel/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/2_onumodel');
- }
- # Plantilla ONU
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onutemplate/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){}
- $I->fillField('Modelo','FiberHome-AN5506-04-b2'."\n");
- $I->fillField('Perfil','Base'."\n");
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('03_Add_FTTH/3_plantillaONU');
- }
- # Perfil
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/profile/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/3_profile');
- }
- # OLT
- # _____________ Crea la OLT NO HABILITADA ___________________
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/olt/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/4_olt');
- }
- # NAP
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/nap/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/5_nap');
- }
- # ONU
- # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
- # Clave duplicada
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('Identificador','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', '1234567890987654');
- $I->fillField('Número Serie Pon', '123456789098');
- # $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('03_Add_FTTH/6_onu');
- }
- # ONU 2
- # ___________________ No me deja crear la ONU para mi cliente TestFernando _______________
- # Clave duplicada
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/ftth/onu/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('Identificador','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', '1234567890987653');
- $I->fillField('Número Serie Pon', '123456789097');
- # $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('03_Add_FTTH/7_onu2');
- }
- # Workflow
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/workflow/workflow/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/8_workflow');
- }
- # Action Workflow
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/workflow/action/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $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('03_Add_FTTH/9_action');
- }
- # Template
- try{
- $I->amOnUrl('https://ftth.'.$cliente.'.flowdat.com/admin/template/template/create');
- try{
- $I->acceptPopup();
- }catch(\Exception $e){
- }
- $I->fillField('Nombre','TestFernando');
- $I->fillField('Contenido','TestFernandoTest');
- $I->click('Crear y regresar al listado');
- $I->wait('5');
- $I->see('ha sido creado con éxito');
- }catch(\Exception $e){
- $I->makeScreenshot('03_Add_FTTH/10_template');
- }
- /*
- # ____________ Maps ______________
- # Mapas
- $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/map/create');
- # Vectores
- $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/vector/create');
- # Objetos
- $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/object/create');
- # Tipos
- $I->amOnUrl('https://mapas.fd3.flowdat.com/admin/map/objecttype/create');
- */
- # ________________ STATS ________________________
- # Servidor Dispositivos
- # $I->amOnUrl('https://stats.fd3.flowdat.com/admin/stats/deviceserver/create');
- # $I->fillField('Nombre','TestFernando');
- # $I->fillField('Url','https://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('https://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');
- # SELECT * FROM `GuiaTelefonica` WHERE NOT `ciudad` IN (SELECT `ciudad` FROM `Prefijo`)
- # UPDATE `GuiaTelefonica` SET `ciudad`='San Jeronimo del Sauce' WHERE ciudad='San Jerónimo del Sauce'
- # INSERT INTO GuiaTelefonica(nombre, direccion, ciudad, telefono, prefijo)
- # SELECT nombre, direccion, ciudad, telefono, prefijo FROM TREntry
- try{
- $I->acceptPopup();
- }catch(\Exception $e){}
- }
- }
|