diff --git a/app/controllers/StudentController.php b/app/controllers/StudentController.php index f13f5ffa8..367cdcb34 100755 --- a/app/controllers/StudentController.php +++ b/app/controllers/StudentController.php @@ -100,10 +100,10 @@ public function actionGetStudentAjax() 3 => 'inep_id', 4 => 'actions' ); - + $criteria = new CDbCriteria(); - + // Filtrar a pesquisa if (!empty($requestData['search']['value'])) { $criteria->condition = "name LIKE '%" . $requestData['search']['value'] . "%' OR " . @@ -129,7 +129,7 @@ public function actionGetStudentAjax() $criteria->order = $sortColumn ." ". $sortDirection; - + $students = StudentIdentification::model()->findAll($criteria); @@ -142,7 +142,7 @@ public function actionGetStudentAjax() $nestedData[] = $student->filiation_1; $nestedData[] = $student->birthday; $nestedData[] = $student->inep_id; - $nestedData[] = " + $nestedData[] = " Editar  " ." @@ -287,10 +287,10 @@ public function actionCreate() $modelStudentDocumentsAndAddress->student_fk = $modelStudentIdentification->inep_id; date_default_timezone_set("America/Recife"); $modelStudentIdentification->last_change = date('Y-m-d G:i:s'); - + if ($modelStudentIdentification->validate() && $modelStudentDocumentsAndAddress->validate()) { - + if ($modelStudentIdentification->save()) { $modelStudentDocumentsAndAddress->id = $modelStudentIdentification->id; $modelStudentRestrictions->student_fk = $modelStudentIdentification->id; @@ -355,7 +355,7 @@ public function actionCreate() } - /** + /** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated diff --git a/tests/acceptance/StudentsCest.php b/tests/acceptance/StudentsCest.php index 3400c2a72..6c55498a3 100644 --- a/tests/acceptance/StudentsCest.php +++ b/tests/acceptance/StudentsCest.php @@ -69,6 +69,8 @@ public function addStudentsRapidFieldsRequired(AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -129,6 +131,8 @@ public function addStudentsRapidFieldsRequiredWithMotherAndFather(AcceptanceTest $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } @@ -172,14 +176,14 @@ public function addStudentsRapidAllFilledIn (AcceptanceTester $teste) // address $robots->zone($dataStudent->studentDocument['residence_zone']); - $robots ->btnProximo(); + $robots->btnProximo(); sleep(2); // matriculation $robots->btnAddMatriculation(); sleep(2); $robots->classroom($dataStudent->studentEnrollment['classroom_fk']); - $robots ->btnProximo(); + $robots->btnProximo(); // health $robots->deficiency(); @@ -192,6 +196,8 @@ public function addStudentsRapidAllFilledIn (AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -254,6 +260,8 @@ public function addStudentsFieldsRequiredWithMotherAndFather (AcceptanceTester $ $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -311,6 +319,8 @@ public function addStudentsFieldsRequired(AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -475,6 +485,8 @@ public function allFilledInNewCivilWithMotherAndFather (AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -584,6 +596,8 @@ public function allFilledInNewCivil (AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -715,6 +729,8 @@ public function allFilledInOldCivilWithMotherAndFather(AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } /** @@ -835,6 +851,8 @@ public function allFilledInOldCivil(AcceptanceTester $teste) $teste->see('O Cadastro de ' . $dataStudent->student['name'] . ' foi criado com sucesso!'); $teste->canSeeInCurrentUrl('?r=student/index&'); + + return $dataStudent; } } diff --git a/tests/acceptance/StudentsEditCest.php b/tests/acceptance/StudentsEditCest.php new file mode 100644 index 000000000..7bab0c7f2 --- /dev/null +++ b/tests/acceptance/StudentsEditCest.php @@ -0,0 +1,521 @@ +pageLogin(); + $robots->fieldUser($user); + $robots->fieldPassword($secret); + $robots->submit(); + sleep(2); + } + + // tests + + /** + * Editar estudantes, todos os campos. + * Filiação - Pai e/ou mãe. + * Dados Sociais - Modelo Novo. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function editWithMotherAndFather(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->allFilledInNewCivilWithMotherAndFather($teste); + $robots = new StudentsRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnEdit(); + sleep(2); + + $builder = new StudentBuilder(); + $dataStudent = $builder->buildCompleted(); + + //Data Students + $robots->name($dataStudent->student['name']); + $robots->civilName($dataStudent->student['civil_name']); + $robots->dateOfBirth($dataStudent->student['birthday']); + $robots->cpf($dataStudent->studentDocument['cpf']); + $robots->gender($dataStudent->student['sex']); + $robots->color($dataStudent->student['color_race']); + $robots->email($dataStudent->student['id_email']); + $robots->scholarity($dataStudent->student['scholarity']); + $robots->btn2Affiliation(); + sleep(2); + + // filiation + $robots->filiation($dataStudent->student['filiation_with_and_father']); + $robots->responsable($dataStudent->student['responsable']); + $robots->responsableTelephone($dataStudent->student['responsable_telephone']); + $robots->nameResponsable($dataStudent->student['responsable_name']); + $robots->emailResponsable($dataStudent->student['responsable_email']); + $robots->responsableJob($dataStudent->student['responsable_job']); + $robots->scholarityResponsable($dataStudent->student['responsable_scholarity']); + $robots->rgResposable($dataStudent->student['responsable_rg']); + $robots->cpfResponsable($dataStudent->student['responsable_cpf']); + $robots->filiationMain($dataStudent->student['filiation_1']); + $robots->cpfFiliation1($dataStudent->student['filiation_1_cpf']); + $robots->dateOfBirthFiliation($dataStudent->student['filiation_1_birthday']); + $robots->rgFiliation1($dataStudent->student['filiation_1_rg']); + $robots->scholarityFiliation1($dataStudent->student['filiation_1_scholarity']); + $robots->professionFiliation1($dataStudent->student['filiation_1_job']); + $robots->filiationSecondary($dataStudent->student['filiation_2']); + $robots->cpfFiliation2($dataStudent->student['filiation_2_cpf']); + $robots->dateOfBirthFiliationSecondary($dataStudent->student['filiation_2_birthday']); + $robots->rgFiliation2($dataStudent->student['filiation_2_rg']); + $robots->scholarityFiliation2($dataStudent->student['filiation_2_scholarity']); + $robots->jobFiliation2($dataStudent->student['filiation_2_job']); + $robots->btn3Documents(); + sleep(2); + + // social data + $robots->civilCertification($dataStudent->studentDocument['civil_certification_type_new']); + $robots->numberRegistration($dataStudent->studentDocument['civil_certification_term_number']); + $robots->numberCns($dataStudent->studentDocument['cns']); + $robots->numberIdentity($dataStudent->studentDocument['rg_number']); + $robots->rgOrgan($dataStudent->studentDocument['rg_number_edcenso_organ_id_emitter_fk']); + $robots->identityDate($dataStudent->studentDocument['civil_certification_date']); + $robots->identyUF($dataStudent->studentDocument['rg_number_edcenso_uf_fk']); + $robots->justice($dataStudent->studentDocument['justice_restriction']); + $robots->justification($dataStudent->studentDocument['justification']); + $robots->nis($dataStudent->studentDocument['nis']); + $robots->idInep($dataStudent->student['inep_id']); + $robots->participantBF(); + $robots->postCensus(); + $robots->btn4Address(); + sleep(2); + + // residence + $robots->stateAddress($dataStudent->studentDocument['edcenso_uf_fk']); + $robots->cep($dataStudent->studentDocument['cep']); + sleep(2); + $robots->cityAddress($dataStudent->studentDocument['edcenso_city_fk']); + sleep(2); + $robots->address($dataStudent->studentDocument['address']); + $robots->neighborhood($dataStudent->studentDocument['neighborhood']); + $robots->number($dataStudent->studentDocument['number']); + $robots->complement($dataStudent->studentDocument['complement']); + $robots->location($dataStudent->studentDocument['diff_location']); + $robots->zone($dataStudent->studentDocument['residence_zone']); + $robots->btn5Enrollment(); + sleep(2); + + // registration + $robots->btnAddMatriculation(); + $robots->classroom($dataStudent->studentEnrollment['classroom_fk']); + $robots->ticketType($dataStudent->studentEnrollment['admission_type']); + $robots->ticketDate($dataStudent->studentEnrollment['school_admission_date']); + $robots->situationSerie($dataStudent->studentEnrollment['current_stage_situation']); + $robots->registrationStatus($dataStudent->studentEnrollment['status']); + $robots->situationYear($dataStudent->studentEnrollment['previous_stage_situation']); + $robots->unifiedClassroom($dataStudent->studentEnrollment['unified_class']); + $robots->schooling($dataStudent->studentEnrollment['another_scholarization_place']); + $robots->stage($dataStudent->studentEnrollment['stage']); + $robots->teachingStage($dataStudent->studentEnrollment['edcenso_stage_vs_modality_fk']); + $robots->publicTransport(); + sleep(2); + $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); + $robots->typeTransport(); + $robots->typeOfService(); + $robots->btn6Health(); + sleep(2); + + // health + $robots->deficiency(); + $robots->typeDeficiency(); + $robots->resourcesInep(); + $robots->vaccine(); + $robots->restrictions(); + $robots->btnCriar(); + sleep(2); + } + + /** + * Editar estudantes, todos os campos. + * Filiação - Não declarado/Ignorado. + * Dados Sociais - Modelo Novo. + * @author Evellyn Jade de Cerqueira Reis- + */ + + public function editNewCivil(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->allFilledInNewCivil($teste); + $robots = new StudentsRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnEdit(); + sleep(2); + + $builder = new StudentBuilder(); + $dataStudent = $builder->buildCompleted(); + + //Data Students + $robots->name($dataStudent->student['name']); + $robots->civilName($dataStudent->student['civil_name']); + $robots->dateOfBirth($dataStudent->student['birthday']); + $robots->cpf($dataStudent->studentDocument['cpf']); + $robots->gender($dataStudent->student['sex']); + $robots->color($dataStudent->student['color_race']); + $robots->nationality($dataStudent->student['nationality']); + $robots->state($dataStudent->student['state']); + sleep(2); + $robots->city($dataStudent->student['city']); + $robots->email($dataStudent->student['id_email']); + $robots->scholarity($dataStudent->student['scholarity']); + $robots->btn2Affiliation(); + sleep(2); + + // filiation + $robots->filiation($dataStudent->student['filiation_no_declared']); + $robots->responsable($dataStudent->student['responsable']); + $robots->responsableTelephone($dataStudent->student['responsable_telephone']); + $robots->nameResponsable($dataStudent->student['responsable_name']); + $robots->emailResponsable($dataStudent->student['responsable_email']); + $robots->responsableJob($dataStudent->student['responsable_job']); + $robots->scholarityResponsable($dataStudent->student['responsable_scholarity']); + $robots->rgResposable($dataStudent->student['responsable_rg']); + $robots->cpfResponsable($dataStudent->student['responsable_cpf']); + $robots->btn3Documents(); + + // social data + $robots->civilCertification($dataStudent->studentDocument['civil_certification_type_new']); + $robots->numberRegistration($dataStudent->studentDocument['civil_certification_term_number']); + $robots->numberCns($dataStudent->studentDocument['cns']); + $robots->numberIdentity($dataStudent->studentDocument['rg_number']); + $robots->rgOrgan($dataStudent->studentDocument['rg_number_edcenso_organ_id_emitter_fk']); + $robots->identityDate($dataStudent->studentDocument['civil_certification_date']); + $robots->identyUF($dataStudent->studentDocument['rg_number_edcenso_uf_fk']); + $robots->justice($dataStudent->studentDocument['justice_restriction']); + $robots->justification($dataStudent->studentDocument['justification']); + $robots->nis($dataStudent->studentDocument['nis']); + $robots->idInep($dataStudent->student['inep_id']); + $robots->participantBF(); + $robots->postCensus(); + $robots->btn4Address(); + sleep(2); + + // residence + $robots->stateAddress($dataStudent->studentDocument['edcenso_uf_fk']); + $robots->cep($dataStudent->studentDocument['cep']); + sleep(2); + $robots->cityAddress($dataStudent->studentDocument['edcenso_city_fk']); + sleep(2); + $robots->address($dataStudent->studentDocument['address']); + $robots->neighborhood($dataStudent->studentDocument['neighborhood']); + $robots->number($dataStudent->studentDocument['number']); + $robots->complement($dataStudent->studentDocument['complement']); + $robots->location($dataStudent->studentDocument['diff_location']); + $robots->zone($dataStudent->studentDocument['residence_zone']); + $robots->btn5Enrollment(); + sleep(2); + + // registration + $robots->btnAddMatriculation(); + $robots->classroom($dataStudent->studentEnrollment['classroom_fk']); + $robots->ticketType($dataStudent->studentEnrollment['admission_type']); + $robots->ticketDate($dataStudent->studentEnrollment['school_admission_date']); + $robots->situationSerie($dataStudent->studentEnrollment['current_stage_situation']); + $robots->registrationStatus($dataStudent->studentEnrollment['status']); + $robots->situationYear($dataStudent->studentEnrollment['previous_stage_situation']); + $robots->unifiedClassroom($dataStudent->studentEnrollment['unified_class']); + $robots->schooling($dataStudent->studentEnrollment['another_scholarization_place']); + $robots->stage($dataStudent->studentEnrollment['stage']); + $robots->teachingStage($dataStudent->studentEnrollment['edcenso_stage_vs_modality_fk']); + $robots->publicTransport(); + sleep(2); + $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); + $robots->typeTransport(); + $robots->typeOfService(); + $robots->btn6Health(); + sleep(2); + + // health + $robots->deficiency(); + $robots->typeDeficiency(); + $robots->resourcesInep(); + $robots->vaccine(); + $robots->restrictions(); + $robots->btnCriar(); + sleep(2); + } + + /** + * Editar estudantes, todos os campos. + * Filiação - Pai e/ou mãe. + * Dados Sociais - Modelo Antigo. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function editOldCivilWithMotherAndFather(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->allFilledInOldCivilWithMotherAndFather($teste); + $robots = new StudentsRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnEdit(); + sleep(2); + + $builder = new StudentBuilder(); + $dataStudent = $builder->buildCompleted(); + + //Data Students + $robots->name($dataStudent->student['name']); + $robots->civilName($dataStudent->student['civil_name']); + $robots->dateOfBirth($dataStudent->student['birthday']); + $robots->cpf($dataStudent->studentDocument['cpf']); + $robots->gender($dataStudent->student['sex']); + $robots->color($dataStudent->student['color_race']); + $robots->nationality($dataStudent->student['nationality']); + $robots->state($dataStudent->student['state']); + sleep(2); + $robots->city($dataStudent->student['city']); + $robots->email($dataStudent->student['id_email']); + $robots->scholarity($dataStudent->student['scholarity']); + $robots->btn2Affiliation(); + sleep(2); + + // filiation + $robots->filiation($dataStudent->student['filiation_with_and_father']); + $robots->responsable($dataStudent->student['responsable']); + $robots->responsableTelephone($dataStudent->student['responsable_telephone']); + $robots->nameResponsable($dataStudent->student['responsable_name']); + $robots->emailResponsable($dataStudent->student['responsable_email']); + $robots->responsableJob($dataStudent->student['responsable_job']); + $robots->scholarityResponsable($dataStudent->student['responsable_scholarity']); + $robots->rgResposable($dataStudent->student['responsable_rg']); + $robots->cpfResponsable($dataStudent->student['responsable_cpf']); + $robots->filiationMain($dataStudent->student['filiation_1']); + $robots->cpfFiliation1($dataStudent->student['filiation_1_cpf']); + $robots->dateOfBirthFiliation($dataStudent->student['filiation_1_birthday']); + $robots->rgFiliation1($dataStudent->student['filiation_1_rg']); + $robots->scholarityFiliation1($dataStudent->student['filiation_1_scholarity']); + $robots->professionFiliation1($dataStudent->student['filiation_1_job']); + $robots->filiationSecondary($dataStudent->student['filiation_2']); + $robots->cpfFiliation2($dataStudent->student['filiation_2_cpf']); + $robots->dateOfBirthFiliationSecondary($dataStudent->student['filiation_2_birthday']); + $robots->rgFiliation2($dataStudent->student['filiation_2_rg']); + $robots->scholarityFiliation2($dataStudent->student['filiation_2_scholarity']); + $robots->jobFiliation2($dataStudent->student['filiation_2_job']); + $robots->btn3Documents(); + sleep(2); + + // social data + $robots->civilCertification($dataStudent->studentDocument['civil_certification_type_old']); + $robots->typeOfCivilCertificate($dataStudent->studentDocument['civil_certification_type']); + $robots->termNumber($dataStudent->studentDocument['civil_certification_term_number']); + $robots->sheet($dataStudent->studentDocument['civil_certification_sheet']); + $robots->civilCertificationBook($dataStudent->studentDocument['civil_certification_book']); + $robots->dateOfIssue($dataStudent->studentDocument['civil_certification_date']); + $robots->ufRegistry($dataStudent->studentDocument['notary_office_uf_fk']); + sleep(2); + $robots->municipalityRegistry($dataStudent->studentDocument['notary_office_city_fk']); + sleep(2); + $robots->notaryOffice($dataStudent->studentDocument['edcenso_notary_office_fk']); + $robots->numberCns($dataStudent->studentDocument['cns']); + $robots->numberIdentity($dataStudent->studentDocument['rg_number']); + $robots->rgOrgan($dataStudent->studentDocument['rg_number_edcenso_organ_id_emitter_fk']); + $robots->identityDate($dataStudent->studentDocument['rg_number_expediction_date']); + $robots->identyUF($dataStudent->studentDocument['rg_number_edcenso_uf_fk']); + $robots->justice($dataStudent->studentDocument['justice_restriction']); + $robots->justification($dataStudent->studentDocument['justification']); + $robots->nis($dataStudent->studentDocument['nis']); + $robots->idInep($dataStudent->student['inep_id']); + $robots->participantBF(); + $robots->postCensus(); + $robots->btn4Address(); + sleep(2); + + // residence + $robots->stateAddress($dataStudent->studentDocument['edcenso_uf_fk']); + $robots->cep($dataStudent->studentDocument['cep']); + sleep(2); + $robots->cityAddress($dataStudent->studentDocument['edcenso_city_fk']); + sleep(2); + $robots->address($dataStudent->studentDocument['address']); + $robots->neighborhood($dataStudent->studentDocument['neighborhood']); + $robots->number($dataStudent->studentDocument['number']); + $robots->complement($dataStudent->studentDocument['complement']); + $robots->location($dataStudent->studentDocument['diff_location']); + $robots->zone($dataStudent->studentDocument['residence_zone']); + $robots->btn5Enrollment(); + sleep(2); + + // registration + $robots->btnAddMatriculation(); + $robots->classroom($dataStudent->studentEnrollment['classroom_fk']); + $robots->ticketType($dataStudent->studentEnrollment['admission_type']); + $robots->ticketDate($dataStudent->studentEnrollment['school_admission_date']); + $robots->situationSerie($dataStudent->studentEnrollment['current_stage_situation']); + $robots->registrationStatus($dataStudent->studentEnrollment['status']); + $robots->situationYear($dataStudent->studentEnrollment['previous_stage_situation']); + $robots->unifiedClassroom($dataStudent->studentEnrollment['unified_class']); + $robots->schooling($dataStudent->studentEnrollment['another_scholarization_place']); + $robots->stage($dataStudent->studentEnrollment['stage']); + $robots->teachingStage($dataStudent->studentEnrollment['edcenso_stage_vs_modality_fk']); + $robots->publicTransport(); + sleep(2); + $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); + $robots->typeTransport(); + $robots->typeOfService(); + $robots->btn6Health(); + sleep(2); + + // health + $robots->deficiency(); + $robots->typeDeficiency(); + $robots->resourcesInep(); + $robots->vaccine(); + $robots->restrictions(); + $robots->btnCriar(); + sleep(2); + } + + /** + * Editar estudantes, todos os campos. + * Filiação - Não declarado/Ignorado. + * Dados Sociais - Modelo Antigo. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function editOldCivil(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->allFilledInOldCivil($teste); + $robots = new StudentsRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnEdit(); + sleep(2); + + $builder = new StudentBuilder(); + $dataStudent = $builder->buildCompleted(); + + //Data Students + $robots->name($dataStudent->student['name']); + $robots->civilName($dataStudent->student['civil_name']); + $robots->dateOfBirth($dataStudent->student['birthday']); + $robots->cpf($dataStudent->studentDocument['cpf']); + $robots->gender($dataStudent->student['sex']); + $robots->color($dataStudent->student['color_race']); + $robots->nationality($dataStudent->student['nationality']); + sleep(2); + $robots->state($dataStudent->student['state']); + sleep(4); + $robots->city($dataStudent->student['city']); + $robots->email($dataStudent->student['id_email']); + $robots->scholarity($dataStudent->student['scholarity']); + $robots->btn2Affiliation(); + sleep(2); + + // filiation + $robots->filiation($dataStudent->student['filiation_no_declared']); + $robots->responsable($dataStudent->student['responsable']); + $robots->responsableTelephone($dataStudent->student['responsable_telephone']); + $robots->nameResponsable($dataStudent->student['responsable_name']); + $robots->emailResponsable($dataStudent->student['responsable_email']); + $robots->responsableJob($dataStudent->student['responsable_job']); + $robots->scholarityResponsable($dataStudent->student['responsable_scholarity']); + $robots->rgResposable($dataStudent->student['responsable_rg']); + $robots->cpfResponsable($dataStudent->student['responsable_cpf']); + $robots->btn3Documents(); + + // social data + $robots->civilCertification($dataStudent->studentDocument['civil_certification_type_old']); + $robots->typeOfCivilCertificate($dataStudent->studentDocument['civil_certification_type']); + $robots->termNumber($dataStudent->studentDocument['civil_certification_term_number']); + $robots->sheet($dataStudent->studentDocument['civil_certification_sheet']); + $robots->civilCertificationBook($dataStudent->studentDocument['civil_certification_book']); + $robots->dateOfIssue($dataStudent->studentDocument['civil_certification_date']); + $robots->ufRegistry($dataStudent->studentDocument['notary_office_uf_fk']); + sleep(2); + $robots->municipalityRegistry($dataStudent->studentDocument['notary_office_city_fk']); + sleep(2); + $robots->notaryOffice($dataStudent->studentDocument['edcenso_notary_office_fk']); + $robots->numberCns($dataStudent->studentDocument['cns']); + $robots->numberIdentity($dataStudent->studentDocument['rg_number']); + $robots->rgOrgan($dataStudent->studentDocument['rg_number_edcenso_organ_id_emitter_fk']); + $robots->identityDate($dataStudent->studentDocument['rg_number_expediction_date']); + $robots->identyUF($dataStudent->studentDocument['rg_number_edcenso_uf_fk']); + $robots->justice($dataStudent->studentDocument['justice_restriction']); + $robots->justification($dataStudent->studentDocument['justification']); + $robots->nis($dataStudent->studentDocument['nis']); + $robots->idInep($dataStudent->student['inep_id']); + $robots->participantBF(); + $robots->postCensus(); + $robots->btn4Address(); + sleep(2); + + + // residence + $robots->stateAddress($dataStudent->studentDocument['edcenso_uf_fk']); + $robots->cep($dataStudent->studentDocument['cep']); + sleep(2); + $robots->cityAddress($dataStudent->studentDocument['edcenso_city_fk']); + sleep(2); + $robots->address($dataStudent->studentDocument['address']); + $robots->neighborhood($dataStudent->studentDocument['neighborhood']); + $robots->number($dataStudent->studentDocument['number']); + $robots->complement($dataStudent->studentDocument['complement']); + $robots->location($dataStudent->studentDocument['diff_location']); + $robots->zone($dataStudent->studentDocument['residence_zone']); + $robots->btn5Enrollment(); + sleep(2); + + // registration + $robots->btnAddMatriculation(); + $robots->classroom($dataStudent->studentEnrollment['classroom_fk']); + $robots->ticketType($dataStudent->studentEnrollment['admission_type']); + $robots->ticketDate($dataStudent->studentEnrollment['school_admission_date']); + $robots->situationSerie($dataStudent->studentEnrollment['current_stage_situation']); + $robots->registrationStatus($dataStudent->studentEnrollment['status']); + $robots->situationYear($dataStudent->studentEnrollment['previous_stage_situation']); + $robots->unifiedClassroom($dataStudent->studentEnrollment['unified_class']); + $robots->schooling($dataStudent->studentEnrollment['another_scholarization_place']); + $robots->stage($dataStudent->studentEnrollment['stage']); + $robots->teachingStage($dataStudent->studentEnrollment['edcenso_stage_vs_modality_fk']); + $robots->publicTransport(); + sleep(2); + $robots->transportResponsable($dataStudent->studentEnrollment['transport_responsable_government']); + $robots->typeTransport(); + $robots->typeOfService(); + $robots->btn6Health(); + sleep(2); + + // health + $robots->deficiency(); + $robots->typeDeficiency(); + $robots->resourcesInep(); + $robots->vaccine(); + $robots->restrictions(); + $robots->btnCriar(); + sleep(2); + } +} diff --git a/tests/acceptance/StudentsRemoveCest.php b/tests/acceptance/StudentsRemoveCest.php new file mode 100644 index 000000000..8e0b9ad30 --- /dev/null +++ b/tests/acceptance/StudentsRemoveCest.php @@ -0,0 +1,62 @@ +pageLogin(); + $robots->fieldUser($user); + $robots->fieldPassword($secret); + $robots->submit(); + sleep(2); + } + + // tests + public function falied(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->allFilledInOldCivil($teste); + $robots = new StudentRemoveRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnDelete(); + $teste->acceptPopup(); + $teste->see('Esse aluno não pode ser excluído, pois existem dados de frequência, + notas ou matrículadas vinculadas a ele!'); + $teste->canSeeInCurrentUrl('?r=student'); + } + + public function sucess(AcceptanceTester $teste) + { + sleep(5); + $student = new StudentsCest(); + $addStudent = $student->addStudentsRapidFieldsRequired($teste); + $robots = new StudentRemoveRobots($teste); + $robots->pageStudents(); + + $search = $addStudent->student['name']; + + $robots->search($search); + sleep(2); + $robots->btnDelete(); + $teste->acceptPopup(); + $teste->see('Aluno excluído com sucesso!'); + $teste->canSeeInCurrentUrl('?r=student/index'); + } +} diff --git a/tests/robots/StudentRemoveRobots.php b/tests/robots/StudentRemoveRobots.php new file mode 100644 index 000000000..84899680e --- /dev/null +++ b/tests/robots/StudentRemoveRobots.php @@ -0,0 +1,41 @@ +tester = $tester; + } + + /** + * Url da página de estudantes. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function pageStudents () + { + $this->tester->amOnPage('?r=student'); + } + + /** + * Botão de deletar. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btnDelete () + { + $this->tester->waitForElement('#student-delete'); + $this->tester->executeJS("document.querySelector('#student-delete').click();"); + } + + /** + * Pesquisar usuários. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function search ($search) + { + $this->tester->click('.dataTables_filter input[type="search"]'); + $this->tester->fillField('.dataTables_filter input[type="search"]', $search); + } + +} diff --git a/tests/robots/StudentsRobots.php b/tests/robots/StudentsRobots.php index 281f578c4..52a532a32 100644 --- a/tests/robots/StudentsRobots.php +++ b/tests/robots/StudentsRobots.php @@ -3,12 +3,21 @@ class StudentsRobots { public AcceptanceTester $tester; - + public function __construct(AcceptanceTester $tester) { $this->tester = $tester; } + /** + * Página de estudantes. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function pageStudents () + { + $this->tester->amOnPage('?r=student'); + } + /** * Página de adicionar estudantes (normal). * @author Evellyn Jade de Cerqueira Reis- @@ -27,6 +36,16 @@ public function pageRapidAddStudents () $this->tester->amOnPage('?r=student/create&simple=1'); } + /** + * Pesquisar estudante. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function search ($search) + { + $this->tester->click('.dataTables_filter input[type="search"]'); + $this->tester->fillField('.dataTables_filter input[type="search"]', $search); + } + /** * Botão de próximo nas telas de cadastros de estudantes. * @author Evellyn Jade de Cerqueira Reis- @@ -47,6 +66,76 @@ public function btnCriar () $this->tester->executeJS("document.querySelector('.save-student').click();"); } + /** + * Botão 1: Dados do aluno. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn1Identify () + { + $this->tester->waitForElementVisible('#tab-student-identify'); + $this->tester->executeJS("document.querySelector('#tab-student-identify a').click();"); + } + + /** + * Botão 2: Filiação. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn2Affiliation () + { + $this->tester->waitForElementVisible('#tab-student-affiliation'); + $this->tester->executeJS("document.querySelector('#tab-student-affiliation a').click();"); + } + + /** + * Botão 3: Dados sociais. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn3Documents () + { + $this->tester->waitForElementVisible('#tab-student-documents'); + $this->tester->executeJS("document.querySelector('#tab-student-documents a').click();"); + } + + /** + * Botão 4: Endereço. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn4Address () + { + $this->tester->waitForElementVisible('#tab-student-address'); + $this->tester->executeJS("document.querySelector('#tab-student-address a').click();"); + } + + /** + * Botão 5: Matricula. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn5Enrollment () + { + $this->tester->waitForElementVisible('#tab-student-enrollment'); + $this->tester->executeJS("document.querySelector('#tab-student-enrollment a').click();"); + } + + /** + * Botão 6: Saúde. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btn6Health () + { + $this->tester->waitForElementVisible('#tab-student-health'); + $this->tester->executeJS("document.querySelector('#tab-student-health a').click();"); + } + + /** + * Botão de editar estudantes. + * @author Evellyn Jade de Cerqueira Reis- + */ + public function btnEdit () + { + $this->tester->waitForElement('#student-edit'); + $this->tester->executeJS("document.querySelector('#student-edit').click();"); + } + /** * Preencher nome do estudante. * @author Evellyn Jade de Cerqueira Reis- diff --git a/tests/robots/WizardRobots.php b/tests/robots/WizardRobots.php index acde9e836..64a398f9d 100644 --- a/tests/robots/WizardRobots.php +++ b/tests/robots/WizardRobots.php @@ -4,7 +4,6 @@ class WizardRobots { public AcceptanceTester $tester; - public function __construct(AcceptanceTester $tester) { $this->tester = $tester; @@ -48,5 +47,3 @@ public function btnSave () } - -?> \ No newline at end of file