diff --git a/app/migrations/2023-10-13_create_alias__edcenso_stage_vs_modality/create_alias.sql b/app/migrations/2023-10-13_create_alias__edcenso_stage_vs_modality/create_alias.sql index 3255f0660..945365fb7 100644 --- a/app/migrations/2023-10-13_create_alias__edcenso_stage_vs_modality/create_alias.sql +++ b/app/migrations/2023-10-13_create_alias__edcenso_stage_vs_modality/create_alias.sql @@ -1,5 +1,5 @@ -- Adiciona coluna alias na tabela edcenso_stage_vs_modality -ALTER TABLE edcenso_stage_vs_modality ADD alias varchar2(15); +ALTER TABLE edcenso_stage_vs_modality ADD alias varchar(15); UPDATE `edcenso_stage_vs_modality` set alias = SUBSTRING(trim(SUBSTRING_INDEX(SUBSTRING_INDEX(name , '-', -1), '-', -1)), 1, 20) diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php index 7359a122a..c9777459e 100644 --- a/tests/_support/AcceptanceTester.php +++ b/tests/_support/AcceptanceTester.php @@ -20,6 +20,7 @@ class AcceptanceTester extends \Codeception\Actor { use _generated\AcceptanceTesterActions; + /** * Define custom actions here */ diff --git a/tests/acceptance.suite.yml b/tests/acceptance.suite.yml index da9de4032..5165cbb05 100644 --- a/tests/acceptance.suite.yml +++ b/tests/acceptance.suite.yml @@ -5,6 +5,7 @@ # If you need both WebDriver and PHPBrowser tests - create a separate suite. actor: AcceptanceTester +bootstrap: bootstrap.php modules: enabled: - WebDriver: @@ -13,5 +14,4 @@ modules: window_size: 1280x960 capabilities: chromeOptions: - args: ["--disable-gpu"] - \ No newline at end of file + args: ["--disable-gpu", "--headless"] diff --git a/tests/acceptance/ChangePasswordCest.php b/tests/acceptance/ChangePasswordCest.php index d022e536b..2d6ce0311 100644 --- a/tests/acceptance/ChangePasswordCest.php +++ b/tests/acceptance/ChangePasswordCest.php @@ -1,19 +1,17 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } diff --git a/tests/acceptance/ClassroomCest.php b/tests/acceptance/ClassroomCest.php index 1eb04900f..ab2f638d0 100644 --- a/tests/acceptance/ClassroomCest.php +++ b/tests/acceptance/ClassroomCest.php @@ -1,22 +1,18 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } @@ -70,6 +66,8 @@ public function addClassroomEAD(AcceptanceTester $teste) $teste->see('Turma adicionada com sucesso!'); $teste->canSeeInCurrentUrl('?r=classroom/index'); + + return $dataClassroom; } /** @@ -99,6 +97,8 @@ public function addClassroomInPerson(AcceptanceTester $teste) $teste->see('Turma adicionada com sucesso!'); $teste->canSeeInCurrentUrl('?r=classroom/index'); + + return $dataClassroom; } /** @@ -137,10 +137,64 @@ public function allFieldsAddClassroomEAD(AcceptanceTester $teste) sleep(2); $robots->btnInstructor(); sleep(2); - // $robots->instructorsToClassroom(); - // $robots->role(); - // $robots->contractType(); - // $robots->createNewComponent(); + $robots->instructorsToClassroom($dataClassroom['Instructors']); + $robots->disciplines($addMatrix['disciplines']); + $robots->role($dataClassroom['Role']); + $robots->contractType($dataClassroom['ContractType']); + $robots->createNewComponent(); + sleep(2); + + $robots->btnCriar(); + sleep(2); + + $teste->see('Turma adicionada com sucesso!'); + $teste->canSeeInCurrentUrl('?r=classroom/index'); + + return $dataClassroom; + } + + /** + * Adicionar turma, preenchendo todos os campos. + * Tipo de Mediação Didático-Pedagógica - Presencial + */ + public function allFieldsAddInPerson(AcceptanceTester $teste) + { + sleep(5); + $matrix = new MatrixCest(); + $addMatrix = $matrix->addMatrix($teste); + + $robots = new ClassroomRobots($teste); + $robots->pageAddClassroom(); + + $builder = new ClassroomBuilder(); + $dataClassroom = $builder->buildCompleted(); + + // Classroom + $robots->name($dataClassroom['name']); + $robots->stageVsModalaty($addMatrix['stages']); + $robots->typeMediation($dataClassroom['pedagogical_mediation_type_IN_PERSON']); + $robots->modality($dataClassroom['modality']); + $robots->location($dataClassroom['diff_location']); + $robots->educationCourse($dataClassroom['edcenso_professional_education_course_fk']); + $robots->initialTime($dataClassroom['initial_time']); + $robots->finalTime($dataClassroom['final_time']); + $robots->turn($dataClassroom['turn']); + $robots->days(); + $robots->typeServiceActivitiesComplementary(); + sleep(2); + $robots->activitiesComplementary($dataClassroom['complementary_activity_type_1']); + $robots->activitiesEducation($dataClassroom['aee_braille']); + $robots->btn2Instructors(); + + // Instructors + sleep(2); + $robots->btnInstructor(); + sleep(2); + $robots->instructorsToClassroom($dataClassroom['Instructors']); + $robots->disciplines($addMatrix['disciplines']); + $robots->role($dataClassroom['Role']); + $robots->contractType($dataClassroom['ContractType']); + $robots->createNewComponent(); sleep(2); $robots->btnCriar(); @@ -148,5 +202,7 @@ public function allFieldsAddClassroomEAD(AcceptanceTester $teste) $teste->see('Turma adicionada com sucesso!'); $teste->canSeeInCurrentUrl('?r=classroom/index'); + + return $dataClassroom; } } diff --git a/tests/acceptance/ClassroomRemoveCest.php b/tests/acceptance/ClassroomRemoveCest.php index defc8056a..35c82d54c 100644 --- a/tests/acceptance/ClassroomRemoveCest.php +++ b/tests/acceptance/ClassroomRemoveCest.php @@ -1,20 +1,18 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } @@ -23,17 +21,20 @@ public function _before(AcceptanceTester $tester) public function sucess(AcceptanceTester $teste) { sleep(5); - $classroom = new StudentsCest(); - $addclassroom = $classroom->addStudentsRapidFieldsRequired($teste); + $classroom = new ClassroomCest(); + $addclassroom = $classroom->addClassroomInPerson($teste); $robots = new ClassroomRobots($teste); $robots->pageClassroom(); - $search = $addclassroom->classroom['name']; + $search = $addclassroom['name']; $robots->search($search); sleep(2); $robots->btnDelete(); $teste->acceptPopup(); - $teste->canSeeInCurrentUrl('?r=classroom/index'); } + + /** + * Verificar caso de não conseguir excluir a turma. + */ } diff --git a/tests/acceptance/ExitCest.php b/tests/acceptance/ExitCest.php index 94af4d36f..5f612de5f 100644 --- a/tests/acceptance/ExitCest.php +++ b/tests/acceptance/ExitCest.php @@ -1,19 +1,16 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } @@ -26,5 +23,4 @@ public function exitPage(AcceptanceTester $teste) sleep(5); $teste->canSeeInCurrentUrl('site/login'); } - } diff --git a/tests/acceptance/LoginCest.php b/tests/acceptance/LoginCest.php index c33488c80..579ad1646 100644 --- a/tests/acceptance/LoginCest.php +++ b/tests/acceptance/LoginCest.php @@ -1,19 +1,17 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); $tester->see('Bem vindo ao'); @@ -46,5 +44,4 @@ public function errorPassword(AcceptanceTester $tester) sleep(5); $tester->see('Usuário ou senha incorretos'); } - } diff --git a/tests/acceptance/ManageStagesCest.php b/tests/acceptance/ManageStagesCest.php index 25e4c59c3..a83919e41 100644 --- a/tests/acceptance/ManageStagesCest.php +++ b/tests/acceptance/ManageStagesCest.php @@ -1,23 +1,18 @@ buildCompleted(); $robots = new LoginRobots($teste); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); - sleep(3); + sleep(2); } // tests @@ -28,7 +23,7 @@ public function addStageRequired(AcceptanceTester $teste) $builder = new ManageStagesBuilder(); $targetUrl = '?r=stages/default/index'; - $stage= $builder->buildCompleted(); + $stage = $builder->buildCompleted(); //stages $robots->name($stage['name']); @@ -47,7 +42,7 @@ public function addStageFilledIn(AcceptanceTester $teste) $builder = new ManageStagesBuilder(); $targetUrl = '?r=stages/default/index'; - $stage= $builder->buildCompleted(); + $stage = $builder->buildCompleted(); //stages $robots->name($stage['name']); @@ -85,7 +80,7 @@ public function updateStage(AcceptanceTester $teste) $robots->btnCriar(); - $robots->checkUpdate($newStage['name'],$newStage['stage'],$newStage['alias']); + $robots->checkUpdate($newStage['name'], $newStage['stage'], $newStage['alias']); $teste->canSeeInCurrentUrl($targetUrl); } @@ -113,5 +108,4 @@ public function deleteStage(AcceptanceTester $teste) $teste->see('Aluno excluído com sucesso!'); $teste->canSeeInCurrentUrl($targetUrl); } - } diff --git a/tests/acceptance/MatrixCest.php b/tests/acceptance/MatrixCest.php index 5293ce332..6e3e1a66f 100644 --- a/tests/acceptance/MatrixCest.php +++ b/tests/acceptance/MatrixCest.php @@ -1,19 +1,16 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } diff --git a/tests/acceptance/RegisterUserCest.php b/tests/acceptance/RegisterUserCest.php index a03ece15d..ae18f1210 100644 --- a/tests/acceptance/RegisterUserCest.php +++ b/tests/acceptance/RegisterUserCest.php @@ -1,21 +1,20 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); - sleep(5); + sleep(2); } // tests diff --git a/tests/acceptance/StudentsCest.php b/tests/acceptance/StudentsCest.php index ed85a1f4a..1b649c2f1 100644 --- a/tests/acceptance/StudentsCest.php +++ b/tests/acceptance/StudentsCest.php @@ -1,22 +1,16 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } @@ -46,23 +40,23 @@ public function addStudentsRapidFieldsRequired(AcceptanceTester $teste) $robots->state($dataStudent->student['state']); sleep(2); $robots->city($dataStudent->student['city']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // filiation $robots->filiation($dataStudent->student['filiation_no_declared']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // address $robots->zone($dataStudent->studentDocument['residence_zone']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // matriculation $robots->btnAddMatriculation(); sleep(2); - $robots ->btnProximo(); + $robots->btnProximo(); // health $robots->btnCriar(); @@ -96,7 +90,7 @@ public function addStudentsRapidFieldsRequiredWithMotherAndFather(AcceptanceTest $robots->state($dataStudent->student['state']); sleep(2); $robots->city($dataStudent->student['city']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // filiation @@ -118,13 +112,13 @@ public function addStudentsRapidFieldsRequiredWithMotherAndFather(AcceptanceTest // address $robots->zone($dataStudent->studentDocument['residence_zone']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // matriculation $robots->btnAddMatriculation(); sleep(2); - $robots ->btnProximo(); + $robots->btnProximo(); // health $robots->btnCriar(); @@ -141,7 +135,7 @@ public function addStudentsRapidFieldsRequiredWithMotherAndFather(AcceptanceTest * Filiação - Não declarado/Ignorado. * @author Evellyn Jade de Cerqueira Reis- */ - public function addStudentsRapidAllFilledIn (AcceptanceTester $teste) + public function addStudentsRapidAllFilledIn(AcceptanceTester $teste) { sleep(5); $robots = new StudentsRobots($teste); @@ -205,7 +199,7 @@ public function addStudentsRapidAllFilledIn (AcceptanceTester $teste) * Filiação - Pai e/ou mãe. * @author Evellyn Jade de Cerqueira Reis- */ - public function addStudentsFieldsRequiredWithMotherAndFather (AcceptanceTester $teste) + public function addStudentsFieldsRequiredWithMotherAndFather(AcceptanceTester $teste) { sleep(5); $robots = new StudentsRobots($teste); @@ -327,7 +321,7 @@ public function addStudentsFieldsRequired(AcceptanceTester $teste) * Adicionar (normal) estudantes, não preenchido nenhum campo. * @author Evellyn Jade de Cerqueira Reis- */ - public function fieldsNotFilledIn (AcceptanceTester $teste) + public function fieldsNotFilledIn(AcceptanceTester $teste) { //Data Students sleep(5); @@ -372,7 +366,7 @@ public function fieldsNotFilledIn (AcceptanceTester $teste) * Dados Sociais - Modelo Novo. * @author Evellyn Jade de Cerqueira Reis- */ - public function allFilledInNewCivilWithMotherAndFather (AcceptanceTester $teste) + public function allFilledInNewCivilWithMotherAndFather(AcceptanceTester $teste) { sleep(5); $robots = new StudentsRobots($teste); @@ -471,7 +465,7 @@ public function allFilledInNewCivilWithMotherAndFather (AcceptanceTester $teste) sleep(2); $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); $robots->typeTransport(); - $robots->typeOfService(); + $robots->typeOfService(); $robots->btnProximo(); sleep(2); @@ -496,7 +490,7 @@ public function allFilledInNewCivilWithMotherAndFather (AcceptanceTester $teste) * Dados Sociais - Modelo Novo. * @author Evellyn Jade de Cerqueira Reis- */ - public function allFilledInNewCivil (AcceptanceTester $teste) + public function allFilledInNewCivil(AcceptanceTester $teste) { sleep(5); $robots = new StudentsRobots($teste); @@ -582,7 +576,7 @@ public function allFilledInNewCivil (AcceptanceTester $teste) sleep(2); $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); $robots->typeTransport(); - $robots->typeOfService(); + $robots->typeOfService(); $robots->btnProximo(); sleep(2); @@ -715,7 +709,7 @@ public function allFilledInOldCivilWithMotherAndFather(AcceptanceTester $teste) sleep(2); $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); $robots->typeTransport(); - $robots->typeOfService(); + $robots->typeOfService(); $robots->btnProximo(); sleep(2); @@ -837,7 +831,7 @@ public function allFilledInOldCivil(AcceptanceTester $teste) sleep(2); $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); $robots->typeTransport(); - $robots->typeOfService(); + $robots->typeOfService(); $robots->btnProximo(); sleep(2); @@ -855,5 +849,4 @@ public function allFilledInOldCivil(AcceptanceTester $teste) return $dataStudent; } - } diff --git a/tests/acceptance/StudentsEditCest.php b/tests/acceptance/StudentsEditCest.php index 7bab0c7f2..40437ed88 100644 --- a/tests/acceptance/StudentsEditCest.php +++ b/tests/acceptance/StudentsEditCest.php @@ -1,19 +1,18 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } diff --git a/tests/acceptance/StudentsRemoveCest.php b/tests/acceptance/StudentsRemoveCest.php index 8e0b9ad30..dd8cd0d8d 100644 --- a/tests/acceptance/StudentsRemoveCest.php +++ b/tests/acceptance/StudentsRemoveCest.php @@ -1,23 +1,19 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } diff --git a/tests/acceptance/WizardCest.php b/tests/acceptance/WizardCest.php index 614127345..906021757 100644 --- a/tests/acceptance/WizardCest.php +++ b/tests/acceptance/WizardCest.php @@ -1,20 +1,16 @@ buildCompleted(); $robots = new LoginRobots($tester); $robots->pageLogin(); - $robots->fieldUser($user); - $robots->fieldPassword($secret); + $robots->fieldUser($login['user']); + $robots->fieldPassword($login['secret']); $robots->submit(); sleep(2); } @@ -25,7 +21,7 @@ public function _before(AcceptanceTester $tester) * Matricula em grupo. * @author Evellyn Jade de Cerqueira Reis- */ - public function groupEnrollment (AcceptanceTester $teste) + public function groupEnrollment(AcceptanceTester $teste) { sleep(5); $robots = new WizardRobots($teste); @@ -41,5 +37,4 @@ public function groupEnrollment (AcceptanceTester $teste) $teste->see('Alunos matriculados com sucesso!'); $teste->canSeeInCurrentUrl('?r=wizard/configuration/student'); } - } diff --git a/tests/acceptance/bootstrap.php b/tests/acceptance/bootstrap.php new file mode 100644 index 000000000..30dcde5a3 --- /dev/null +++ b/tests/acceptance/bootstrap.php @@ -0,0 +1,29 @@ +faker = Faker\Factory::create('pt_BR'); $this->fakerCustom = new CustomProvider($this->faker); $this->classroom = []; } - public function buildCompleted () + public function buildCompleted() { $this->classroom['name'] = $this->fakerCustom->generateRandomClassName(); - $this->classroom['edcenso_stage_vs_modality_fk'] = '1'; + $this->classroom['edcenso_stage_vs_modality_fk'] = '1'; // Educação Infantil - Creche (0 a 3 anos) $this->classroom['pedagogical_mediation_type_IN_PERSON'] = '1'; $this->classroom['pedagogical_mediation_type_EAD'] = '3'; - $this->classroom['modality'] = $this->faker->randomElement(array (1,2,3,4)); - $this->classroom['diff_location'] = $this->faker->randomElement(array (0,1,2,3)); + $this->classroom['modality'] = $this->faker->randomElement(array(1, 2, 3, 4)); + $this->classroom['diff_location'] = $this->faker->randomElement(array(0, 1, 2, 3)); $this->classroom['edcenso_professional_education_course_fk'] = '8120'; // Ações de Comandos $this->classroom['initial_time'] = $this->fakerCustom->generateRandomTime(); $this->classroom['final_time'] = $this->fakerCustom->generateRandomEndTime($this->classroom['initial_time']); - $this->classroom['turn'] = $this->faker->randomElement(array ('M','T','N','I')); + $this->classroom['turn'] = $this->faker->randomElement(array('M', 'T', 'N', 'I')); $this->classroom['complementary_activity_type_1'] = '10102'; // Robótica Educacional $this->classroom['aee_braille'] = '#Ensino\ do\ Sistema\ Braille'; + $this->classroom['Instructors'] = $this->faker->randomElement(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + $this->classroom['Role'] = $this->faker->randomElement(array(1, 2, 3, 4, 5, 6, 7, 8)); + $this->classroom['ContractType'] = $this->faker->randomElement(array(1, 2, 3, 4)); + + //sedsp + + $this->classroom['sedsp_school_unity_fk'] = ''; + $this->classroom['sedsp_acronym'] = $this->fakerCustom->identificationClass(); + $this->classroom['sedsp_classnumber'] = $this->faker->randomDigit(); + $this->classroom['sedsp_max_physical_capacity'] = $this->faker->randomDigit(); return $this->classroom; } - } diff --git a/tests/builders/LoginBuilder.php b/tests/builders/LoginBuilder.php new file mode 100644 index 000000000..ab06231aa --- /dev/null +++ b/tests/builders/LoginBuilder.php @@ -0,0 +1,31 @@ +faker = Faker\Factory::create('pt_BR'); + $this->fakerCustom = new CustomProvider($this->faker); + $this->login = []; + } + + public function buildCompleted() + { + $this->login['user'] = 'admin'; + $this->login['secret'] = 'p@s4ipti'; + + return $this->login; + } +} diff --git a/tests/builders/ManageStagesBuilder.php b/tests/builders/ManageStagesBuilder.php index e3d1180a3..af6de8063 100644 --- a/tests/builders/ManageStagesBuilder.php +++ b/tests/builders/ManageStagesBuilder.php @@ -1,45 +1,32 @@ faker = Faker\Factory::create('pt_BR'); $this->fakerCustom = new CustomProvider($this->faker); $this->stageVsModality = []; } - /** - * @return ManageStagesBuilder - */ - public function buildCompleted() { - $stageVsModality['name'] = $this->faker->name(); - $stageVsModality['stage'] = $this->faker->randomElement(array (1,2,3,4,5,6,7,8,9,10)); - $stageVsModality['alias'] = substr($this->faker->name(), 15); - return $stageVsModality; + public function buildCompleted() + { + $this->stageVsModality['name'] = $this->faker->name(); + $this->stageVsModality['stage'] = $this->faker->randomElement(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + $this->stageVsModality['alias'] = substr($this->faker->name(), 15); + return $this->stageVsModality; } - } diff --git a/tests/builders/MatrixBuilder.php b/tests/builders/MatrixBuilder.php index 7bb5e3b51..736db6607 100644 --- a/tests/builders/MatrixBuilder.php +++ b/tests/builders/MatrixBuilder.php @@ -1,14 +1,4 @@ faker = Faker\Factory::create('pt_BR'); $this->fakerCustom = new CustomProvider($this->faker); @@ -37,87 +28,82 @@ public function __construct () $this->studentEnrollment = []; } - public function buildCompleted () + public function buildCompleted() { - $this->student['name'] = $this->faker->name(); - $this->student['civil_name'] = $this->faker->name(); - $this->student['birthday'] = $this->faker->date('d/m/Y'); - $this->studentDocument['cpf'] = $this->faker->cpf(); - $this->student['sex'] = $this->faker->randomElement(array (1,2)); - $this->student['color_race'] = $this->faker->randomElement(array (0,1,2,3,4,5)); - $this->student['nationality'] = '1'; // Brasileira - $this->student['state'] = '28'; // Sergipe - $this->student['city'] = '2800308'; // Aracaju - $this->student['id_email'] = $this->faker->email(); - $this->student['scholarity'] = $this->faker->randomElement(array (1,2,3,4)); - $this->student['filiation_no_declared'] = '0'; // Não declarado/Ignorado - $this->student['filiation_with_and_father'] = '1'; // Pai e/ou mãe - $this->student['responsable'] = $this->faker->randomElement(array (0,1,2)); - $this->student['responsable_telephone'] = $this->faker->cellphoneNumber(); - $this->student['responsable_name'] = $this->faker->name(); - $this->student['responsable_email'] = $this->faker->email(); - $this->student['responsable_job'] = $this->faker->jobTitle(); - $this->student['responsable_scholarity'] = $this->faker->randomElement(array (1,2,3,4)); - $this->student['responsable_rg'] = $this->faker->rg(); - $this->student['responsable_cpf'] = $this->faker->cpf(); - $this->student['filiation_1'] = $this->fakerCustom->filiationName(); - $this->student['filiation_1_cpf'] = $this->faker->cpf(); - $this->student['filiation_1_birthday'] = $this->faker->date('d/m/Y'); - $this->student['filiation_1_rg'] = $this->faker->rg(); - $this->student['filiation_1_scholarity'] = $this->faker->randomElement(array (0,1,2,3,4,5,6,7)); - $this->student['filiation_1_job'] = $this->faker->jobTitle(); - $this->student['filiation_2'] = $this->fakerCustom->filiationName(); - $this->student['filiation_2_cpf'] = $this->faker->cpf(); - $this->student['filiation_2_birthday'] = $this->faker->date('d/m/Y'); - $this->student['filiation_2_rg'] = $this->faker->rg(); - $this->student['filiation_2_scholarity'] = $this->faker->randomElement(array (0,1,2,3,4,5,6,7)); - $this->student['filiation_2_job'] = $this->faker->jobTitle(); - $this->studentDocument['civil_certification_type_old'] = '1'; - $this->studentDocument['civil_certification_type_new'] = '2'; - $this->studentDocument['civil_certification_type'] = $this->faker->randomElement(array (1,2)); - $this->studentDocument['civil_certification_term_number'] = $this->fakerCustom->termCivil(); - $this->studentDocument['civil_certification_sheet'] = $this->fakerCustom->sheetCivil(); - $this->studentDocument['civil_certification_book'] = $this->fakerCustom->bookCivil(); - $this->studentDocument['civil_certification_date'] = $this->faker->date('d/m/Y'); - $this->studentDocument['notary_office_uf_fk'] = '28'; // Sergipe - $this->studentDocument['notary_office_city_fk'] = '2800308'; // Aracaju - $this->studentDocument['edcenso_notary_office_fk'] = '5573'; // 13º Oficio - $this->studentDocument['civil_certification_term_number'] = $this->fakerCustom->matriculaRegistroCivil(); - $this->studentDocument['cns'] = $this->fakerCustom->cnsNumber(); - $this->studentDocument['rg_number'] = $this->faker->rg(); - $this->studentDocument['rg_number_edcenso_organ_id_emitter_fk'] = '10'; // SSP - $this->studentDocument['rg_number_expediction_date'] = $this->faker->date('d/m/Y'); - $this->studentDocument['rg_number_edcenso_uf_fk'] = '28'; // Sergipe - $this->studentDocument['justice_restriction'] = $this->faker->randomElement(array (0,1,2)); - $this->studentDocument['justification'] = $this->faker->randomElement(array (1,2)); - $this->studentDocument['nis'] = $this->fakerCustom->nisNumber(); - $this->student['inep_id'] = $this->fakerCustom->inepId(); - $this->studentDocument['edcenso_uf_fk'] = '28'; // Sergipe - $this->studentDocument['cep'] = $this->faker->postcode(); - $this->studentDocument['edcenso_city_fk'] = '2800308'; // Aracaju - $this->studentDocument['address'] = $this->faker->streetName(); - $this->studentDocument['neighborhood'] = $this->faker->region(); - $this->studentDocument['number'] = $this->faker->buildingNumber(); - $this->studentDocument['complement'] = $this->fakerCustom->complementLocation(); - $this->studentDocument['diff_location'] = $this->faker->randomElement(array (1,2,3,7)); - $this->studentDocument['residence_zone'] = $this->faker->randomElement(array (1,2)); - $this->studentEnrollment['classroom_fk'] = $this->faker->randomElement(array (7,3,2,1)); - $this->studentEnrollment['admission_type'] = $this->faker->randomElement(array (1,2,3)); - $this->studentEnrollment['school_admission_date'] = $this->faker->date('d/m/Y'); - $this->studentEnrollment['current_stage_situation'] = $this->faker->randomElement(array (0,1,2)); - $this->studentEnrollment['status'] = $this->faker->randomElement(array (1,2,3,4,5,6,7,8,9,10,11)); - $this->studentEnrollment['previous_stage_situation'] = $this->faker->randomElement(array (0,1,2,3,4,5)); - $this->studentEnrollment['unified_class'] = $this->faker->randomElement(array (1,2)); - $this->studentEnrollment['another_scholarization_place'] = $this->faker->randomElement(array (1,2,3)); - $this->studentEnrollment['stage'] = $this->faker->randomElement(array (0,1,2,3,4,5,6,7)); - $this->studentEnrollment['edcenso_stage_vs_modality_fk'] = '1'; - $this->studentEnrollment['transport_responsable_government'] = $this->faker->randomElement(array (1,2)); + $this->student['name'] = $this->faker->name(); + $this->student['civil_name'] = $this->faker->name(); + $this->student['birthday'] = $this->faker->date('d/m/Y'); + $this->studentDocument['cpf'] = $this->faker->cpf(); + $this->student['sex'] = $this->faker->randomElement(array(1, 2)); + $this->student['color_race'] = $this->faker->randomElement(array(0, 1, 2, 3, 4, 5)); + $this->student['nationality'] = '1'; // Brasileira + $this->student['state'] = '28'; // Sergipe + $this->student['city'] = '2800308'; // Aracaju + $this->student['id_email'] = $this->faker->email(); + $this->student['scholarity'] = $this->faker->randomElement(array(1, 2, 3, 4)); + $this->student['filiation_no_declared'] = '0'; // Não declarado/Ignorado + $this->student['filiation_with_and_father'] = '1'; // Pai e/ou mãe + $this->student['responsable'] = $this->faker->randomElement(array(0, 1, 2)); + $this->student['responsable_telephone'] = $this->faker->cellphoneNumber(); + $this->student['responsable_name'] = $this->faker->name(); + $this->student['responsable_email'] = $this->faker->email(); + $this->student['responsable_job'] = $this->faker->jobTitle(); + $this->student['responsable_scholarity'] = $this->faker->randomElement(array(1, 2, 3, 4)); + $this->student['responsable_rg'] = $this->faker->rg(); + $this->student['responsable_cpf'] = $this->faker->cpf(); + $this->student['filiation_1'] = $this->fakerCustom->filiationName(); + $this->student['filiation_1_cpf'] = $this->faker->cpf(); + $this->student['filiation_1_birthday'] = $this->faker->date('d/m/Y'); + $this->student['filiation_1_rg'] = $this->faker->rg(); + $this->student['filiation_1_scholarity'] = $this->faker->randomElement(array(0, 1, 2, 3, 4, 5, 6, 7)); + $this->student['filiation_1_job'] = $this->faker->jobTitle(); + $this->student['filiation_2'] = $this->fakerCustom->filiationName(); + $this->student['filiation_2_cpf'] = $this->faker->cpf(); + $this->student['filiation_2_birthday'] = $this->faker->date('d/m/Y'); + $this->student['filiation_2_rg'] = $this->faker->rg(); + $this->student['filiation_2_scholarity'] = $this->faker->randomElement(array(0, 1, 2, 3, 4, 5, 6, 7)); + $this->student['filiation_2_job'] = $this->faker->jobTitle(); + $this->studentDocument['civil_certification_type_old'] = '1'; + $this->studentDocument['civil_certification_type_new'] = '2'; + $this->studentDocument['civil_certification_type'] = $this->faker->randomElement(array(1, 2)); + $this->studentDocument['civil_certification_term_number'] = $this->fakerCustom->termCivil(); + $this->studentDocument['civil_certification_sheet'] = $this->fakerCustom->sheetCivil(); + $this->studentDocument['civil_certification_book'] = $this->fakerCustom->bookCivil(); + $this->studentDocument['civil_certification_date'] = $this->faker->date('d/m/Y'); + $this->studentDocument['notary_office_uf_fk'] = '28'; // Sergipe + $this->studentDocument['notary_office_city_fk'] = '2800308'; // Aracaju + $this->studentDocument['edcenso_notary_office_fk'] = '5573'; // 13º Oficio + $this->studentDocument['civil_certification_term_number'] = $this->fakerCustom->matriculaRegistroCivil(); + $this->studentDocument['cns'] = $this->fakerCustom->cnsNumber(); + $this->studentDocument['rg_number'] = $this->faker->rg(); + $this->studentDocument['rg_number_edcenso_organ_id_emitter_fk'] = '10'; // SSP + $this->studentDocument['rg_number_expediction_date'] = $this->faker->date('d/m/Y'); + $this->studentDocument['rg_number_edcenso_uf_fk'] = '28'; // Sergipe + $this->studentDocument['justice_restriction'] = $this->faker->randomElement(array(0, 1, 2)); + $this->studentDocument['justification'] = $this->faker->randomElement(array(1, 2)); + $this->studentDocument['nis'] = $this->fakerCustom->nisNumber(); + $this->student['inep_id'] = $this->fakerCustom->inepId(); + $this->studentDocument['edcenso_uf_fk'] = '28'; // Sergipe + $this->studentDocument['cep'] = $this->faker->postcode(); + $this->studentDocument['edcenso_city_fk'] = '2800308'; // Aracaju + $this->studentDocument['address'] = $this->faker->streetName(); + $this->studentDocument['neighborhood'] = $this->faker->region(); + $this->studentDocument['number'] = $this->faker->buildingNumber(); + $this->studentDocument['complement'] = $this->fakerCustom->complementLocation(); + $this->studentDocument['diff_location'] = $this->faker->randomElement(array(1, 2, 3, 7)); + $this->studentDocument['residence_zone'] = $this->faker->randomElement(array(1, 2)); + $this->studentEnrollment['classroom_fk'] = $this->faker->randomElement(array(7, 3, 2, 1)); + $this->studentEnrollment['admission_type'] = $this->faker->randomElement(array(1, 2, 3)); + $this->studentEnrollment['school_admission_date'] = $this->faker->date('d/m/Y'); + $this->studentEnrollment['current_stage_situation'] = $this->faker->randomElement(array(0, 1, 2)); + $this->studentEnrollment['status'] = $this->faker->randomElement(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); + $this->studentEnrollment['previous_stage_situation'] = $this->faker->randomElement(array(0, 1, 2, 3, 4, 5)); + $this->studentEnrollment['unified_class'] = $this->faker->randomElement(array(1, 2)); + $this->studentEnrollment['another_scholarization_place'] = $this->faker->randomElement(array(1, 2, 3)); + $this->studentEnrollment['stage'] = $this->faker->randomElement(array(0, 1, 2, 3, 4, 5, 6, 7)); + $this->studentEnrollment['edcenso_stage_vs_modality_fk'] = '1'; + $this->studentEnrollment['transport_responsable_government'] = $this->faker->randomElement(array(1, 2)); return $this; } - } - - - - diff --git a/tests/builders/WizardBuilder.php b/tests/builders/WizardBuilder.php index be7ad52c1..c80ca4781 100644 --- a/tests/builders/WizardBuilder.php +++ b/tests/builders/WizardBuilder.php @@ -1,42 +1,32 @@ faker = Faker\Factory::create('pt_BR'); $this->fakerCustom = new CustomProvider($this->faker); $this->wizard = []; } - public function buildCompleted () + public function buildCompleted() { $this->wizard['classrooms'] = '483'; // Turma 1 $this->wizard['oneClassrom'] = '494'; // 261605877 1 ETAPA PREESCOLA D TARDE ANUAL return $this->wizard; } - } diff --git a/tests/providers/CustomProvider.php b/tests/providers/CustomProvider.php index 6c2a47d60..17ecfb87e 100644 --- a/tests/providers/CustomProvider.php +++ b/tests/providers/CustomProvider.php @@ -181,4 +181,21 @@ private function compareTimes($time1, $time2) { return $hour1 - $hour2; } + /** + * Gera a identificação da turma. + */ + public function identificationClass() + { + $letras = ['A', 'B', 'C', 'D', 'E', 'F', 'G']; + $numeros = [1, 2, 3, 4, 5, 6, 7]; + + $identificacao = $this->generator->randomElement($letras); + + if ($this->generator->boolean(50)) { + $identificacao .= $this->generator->randomElement($numeros); + } + + return $identificacao; + } + } diff --git a/tests/robots/ClassroomRobots.php b/tests/robots/ClassroomRobots.php index 39e663aae..3cb51f535 100644 --- a/tests/robots/ClassroomRobots.php +++ b/tests/robots/ClassroomRobots.php @@ -45,6 +45,16 @@ public function btnCriar() $this->tester->executeJS("document.querySelector('.save-classroom').click();"); } + /** + * Botão de deletar. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btnDelete () + { + $this->tester->waitForElement('.delete'); + $this->tester->executeJS("document.querySelector('.delete').click();"); + } + /** * Botão 1: Dados da turma. * @author Evellyn Jade de Cerqueira Reis- @@ -132,21 +142,21 @@ public function modality($modality) } /** - * Seleciona a localização, caso a turma seja presencial. + * Selecione o curso. * @author Evellyn Jade de Cerqueira Reis- */ - public function location($location) + public function educationCourse($educationCourse) { - $this->tester->selectOption('#Classroom_diff_location', $location); + $this->tester->selectOption('#Classroom_edcenso_professional_education_course_fk', $educationCourse); } /** - * Selecione o curso. + * Seleciona a localização, caso a turma seja presencial. * @author Evellyn Jade de Cerqueira Reis- */ - public function educationCourse($educationCourse) + public function location($location) { - $this->tester->selectOption('#Classroom_edcenso_professional_education_course_fk', $educationCourse); + $this->tester->selectOption('#Classroom_diff_location', $location); } /** @@ -234,13 +244,18 @@ public function instructorsToClassroom($instructors) $this->tester->selectOption('#Instructors', $instructors); } + public function disciplines ($disciplines) + { + $this->tester->selectOption('#Disciplines', $disciplines); + } + /** * Selecionar um cargo para turma. * @author Evellyn Jade de Cerqueira Reis- */ public function role($role) { - $this->tester->selectOption('#role', $role); + $this->tester->selectOption('#Role', $role); } /** @@ -260,4 +275,44 @@ public function createNewComponent() { $this->tester->click('.ui-dialog-buttonset > button:nth-child(1)'); } + + + // sedsp + + /** + * Selecione a unidade escolar. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function unity($unity) + { + $this->tester->selectOption('#Classroom_sedsp_school_unity_fk', $unity); + } + + /** + * Inserir a turma. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function classroom($classroom) + { + $this->tester->selectOption('#Classroom_sedsp_acronym', $classroom); + } + + /** + * Inserir a sala de aula. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function numberClassroom($numberClassroom) + { + $this->tester->fillField('#Classroom_sedsp_classnumber', $numberClassroom); + } + + /** + * Inserir a capacidade fisica máxima. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function capacity($capacity) + { + $this->tester->fillField('#Classroom_sedsp_max_physical_capacity', $capacity); + } + } diff --git a/tests/robots/SchoolRobots.php b/tests/robots/SchoolRobots.php index ca31debfc..0358ebe34 100644 --- a/tests/robots/SchoolRobots.php +++ b/tests/robots/SchoolRobots.php @@ -2,6 +2,7 @@ class SchoolRobots { + public AcceptanceTester $tester; public function __construct(AcceptanceTester $tester) { $this->tester = $tester; @@ -37,7 +38,6 @@ public function linkedSchool() $this->tester->checkOption('#SchoolIdentification_linked_army'); } - } -?> \ No newline at end of file +?> diff --git a/tests/robots/WizardRobots.php b/tests/robots/WizardRobots.php index 64a398f9d..d729a5912 100644 --- a/tests/robots/WizardRobots.php +++ b/tests/robots/WizardRobots.php @@ -45,5 +45,4 @@ public function btnSave () $this->tester->executeJS("document.querySelector('#save button').click();"); } - }