123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?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)
- {
- $I->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){}
- }
- }
|