maximizeWindow(); $cliente = "fd3"; shell_exec('mkdir -p ./tests/_output/debug/01_Add_Base/'); #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('01_Add_Base/0_login'); } # ____________________ Base _____________________ /* # Codigos de Autenticación try{ $I->amOnUrl('https://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('01_Add_Base/1_oauthcode'); } # Clientes OAuth try{ $I->amOnUrl('https://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('01_Add_Base/2_oauthclient'); } # Tokens de Acceso try{ $I->amOnUrl('https://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('01_Add_Base/3_accesstoken'); } # Tokens de Refresco try{ $I->amOnUrl('https://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('01_Add_Base/4_refreshtoken'); } */ # Workflow try{ $I->amOnUrl('https://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('01_Add_Base/1_workflow'); } # Action try{ $I->amOnUrl('https://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('01_Add_Base/2_action'); } # Alertas try{ $I->amOnUrl('https://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('01_Add_Base/3_alert'); } # Tipo de Alertas try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/alert/alerttype/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $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('01_Add_Base/4_alerttype'); } # Crear Usuarios try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/user/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $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->click("(//*[@class='iCheck-helper'])[1]"); $I->fillField('Acción inicial', 'Inicio'."\n"); $I->fillField('Grupos', 'Administrador General'."\n"); $I->fillField('Tenencias', 'Base'."\n"); # solo Role de Admin y User # Roles # $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('01_Add_Base/5_user'); } # Grupos try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/group/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $I->fillField('Nombre de Grupo', 'TestFernando'); #$I->click("(//*[@class='icheckbox_square-blue'])[1]"); # selecciona el checkbox 1 #$I->fillField('Usuarios', 'TestFernando'."\n"); $I->fillField('Roles', 'ROLE_SONATA_ALERT_READER'."\n"); $I->click('Crear y regresar al listado'); $I->wait('5'); $I->see('ha sido creado con éxito'); }catch(\Exception $e){ $I->makeScreenshot('01_Add_Base/6_group'); } # Tenencias # ________________________ NO BORRA LA TENENCIA DESPUÉS ________________________ try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/tenancy/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $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('01_Add_Base/7_tenancy'); } # Clientes try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/client/client/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $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('01_Add_Base/8_client'); } # Dispositivos try{ $I->amOnUrl('https://base.'.$cliente.'.flowdat.com/admin/license/device/create'); try{ $I->acceptPopup(); }catch(\Exception $e){ } $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('01_Add_Base/9_device'); } try{ $I->acceptPopup(); }catch(\Exception $e){} } }