Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests/edit classroom #524

Draft
wants to merge 35 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f7e3d83
tests/ selenium-standalone install, and implementing class acceptance
evellynreis Oct 11, 2023
9b55221
tests/ acceptance form students
evellynreis Oct 16, 2023
bdff5c5
tests/ methods filiation with mother and father
evellynreis Oct 16, 2023
f5feb36
tests/ implementation methods WhitMotherAndFather
evellynreis Oct 17, 2023
d9d392f
Merge branch 'dev' into tests/acceptance
evellynreis Oct 17, 2023
3cec4d3
tests/ add test groupEnrollment
evellynreis Oct 17, 2023
b1d860d
Merge branch 'tests/acceptance' into tests_class
evellynreis Oct 18, 2023
3ff503c
tests/ implementing class builders
evellynreis Oct 26, 2023
2742777
Merge branch 'dev' into tests/implementing-builders
evellynreis Oct 26, 2023
faec0e3
tests/ correction sonarlint
evellynreis Oct 26, 2023
4882c1b
tests/ remove students case tests completed
evellynreis Oct 30, 2023
514ab11
tests/ documention
evellynreis Oct 30, 2023
ddbf126
tests/ documention
evellynreis Oct 30, 2023
7f2b22c
tests/ implement edit tests
evellynreis Oct 31, 2023
1d26308
Merge branch 'dev' into tests/edit-remove-students
evellynreis Oct 31, 2023
eb9e264
tests/ correction merge
evellynreis Oct 31, 2023
63dd4f9
tests/ correction tabulation
evellynreis Oct 31, 2023
b17740b
tests/ implementing function for in classrooms acceptance tests
evellynreis Nov 1, 2023
561be9e
testes/ implementing cases tests for classroom, and too, add robots a…
evellynreis Nov 3, 2023
81e8f4c
tests/ add tests in matrix
evellynreis Nov 6, 2023
8b81bda
tests/ corrections methods
evellynreis Nov 6, 2023
cf1d5fa
Merge branch 'dev' into tests/add-classrom
evellynreis Nov 6, 2023
1165db7
tests/correction methods, implementing tests class
evellynreis Nov 8, 2023
d8004d2
Merge branch 'tests/add-classrom' of https://github.com/ipti/br.tag i…
evellynreis Nov 8, 2023
b85b7e3
tests/implementing remove classroom
evellynreis Nov 8, 2023
83ade18
Merge branch 'dev' into tests/add-classrom
evellynreis Nov 8, 2023
e772430
tests/ finalization tests in add classroom
evellynreis Nov 9, 2023
7f86096
tests/correction tests manage stage
evellynreis Nov 9, 2023
cc7b4d9
tests/ correction sonar lint, problem segurity
evellynreis Nov 10, 2023
ac85db2
Merge branch 'dev' into tests/edit-classroom
evellynreis Nov 10, 2023
dce54ab
tests/ implementing case tests edit classroom
evellynreis Nov 13, 2023
de69179
tests/ add case tests editClassroomInPerson
evellynreis Nov 13, 2023
4e32c32
Merge branch 'dev' into tests/edit-classroom
evellynreis Nov 13, 2023
b182923
tests/ correction according to sonarlint
evellynreis Nov 13, 2023
2ebfa43
tests/improvements
evellynreis Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/controllers/StudentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,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 " .
Expand All @@ -151,7 +151,7 @@ public function actionGetStudentAjax()
$criteria->order = $sortColumn ." ". $sortDirection;




$students = StudentIdentification::model()->findAll($criteria);

Expand All @@ -164,7 +164,7 @@ public function actionGetStudentAjax()
$nestedData[] = $student->filiation_1;
$nestedData[] = $student->birthday;
$nestedData[] = $student->inep_id;
$nestedData[] = "<a style='cursor: pointer;' title='Editar' href='/?r=student/update&id=".$student->id."'>
$nestedData[] = "<a style='cursor: pointer;' title='Editar' id='student-edit' href='/?r=student/update&id=".$student->id."'>
<img src='" . Yii::app()->theme->baseUrl . '/img/editar.svg' . "' alt='Editar'></img>
</a>&nbsp;"
."<a style='cursor: pointer;' title='Excluir'
Expand Down Expand Up @@ -312,10 +312,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;
Expand Down Expand Up @@ -402,7 +402,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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tests/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class AcceptanceTester extends \Codeception\Actor
{
use _generated\AcceptanceTesterActions;


/**
* Define custom actions here
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# If you need both WebDriver and PHPBrowser tests - create a separate suite.

actor: AcceptanceTester
bootstrap: bootstrap.php
modules:
enabled:
- WebDriver:
Expand All @@ -13,5 +14,4 @@ modules:
window_size: 1280x960
capabilities:
chromeOptions:
args: ["--disable-gpu"]

args: ["--disable-gpu", "--headless"]
10 changes: 4 additions & 6 deletions tests/acceptance/ChangePasswordCest.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<?php

require_once __DIR__."/../robots/LoginRobots.php";

class ChangePasswordCest
{

public function _before(AcceptanceTester $tester)
{
$user = "admin";
$secret = "p@s4ipti";
$builder = new LoginBuilder();
$login = $builder->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);
}
Expand Down
212 changes: 212 additions & 0 deletions tests/acceptance/ClassroomCest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<?php

require_once __DIR__ . "\\MatrixCest.php";

class ClassroomCest
{
public function _before(AcceptanceTester $tester)
{
$builder = new LoginBuilder();
$login = $builder->buildCompleted();

$robots = new LoginRobots($tester);
$robots->pageLogin();
$robots->fieldUser($login['user']);
$robots->fieldPassword($login['secret']);
$robots->submit();
sleep(2);
}

// tests

/**
* Adicionar turmas, não preenchendo nenhum campo.
* @author Evellyn Jade de Cerqueira Reis- <ti.jade@ipti.org.br>
*/
public function fieldsNotFilledIn(AcceptanceTester $teste)
{
sleep(5);
$robots = new ClassroomRobots($teste);
$robots->pageAddClassroom();
$robots->btnCriar();

$teste->see('Campo Nome é obrigatório.
Campo Modalidade é obrigatório.
Campo Etapa de Ensino é obrigatório.
Campo Horário Inicial é obrigatório.
Campo Horário Final é obrigatório.
Campo Dias da semana é obrigatório. Selecione ao menos um dia.
Campo Tipo de Mediação Didático-Pedagógica é obrigatório.
Campo Tipos de Atendimento é obrigatório. Selecione ao menos uma opção.');
}

/**
* Adicionar turma, preenchendo apenas os campos obrigatórios.
* Tipo de Mediação Didático-Pedagógica - Educação a Distância - EAD.
*/
public function addClassroomEAD(AcceptanceTester $teste)
{
sleep(5);
$robots = new ClassroomRobots($teste);
$robots->pageAddClassroom();

$builder = new ClassroomBuilder();
$dataClassroom = $builder->buildCompleted();

$robots->name($dataClassroom['name']);
$robots->stageVsModalaty($dataClassroom['edcenso_stage_vs_modality_fk']);
$robots->typeMediation($dataClassroom['pedagogical_mediation_type_EAD']);
$robots->modality($dataClassroom['modality']);
$robots->initialTime($dataClassroom['initial_time']);
$robots->finalTime($dataClassroom['final_time']);
$robots->days($dataClassroom['week_days_monday']);
$robots->typeService($dataClassroom['assistance_complementary_activity']);
sleep(2);
$robots->activitiesComplementary($dataClassroom['complementary_activity_type_1']);
$robots->btnCriar();
sleep(2);

$teste->see('Turma adicionada com sucesso!');
$teste->canSeeInCurrentUrl('?r=classroom/index');

return $dataClassroom;
}

/**
* Adicionar turma, preenchendo apenas os campos obrigatórios.
* Tipo de Mediação Didático-Pedagógica - Presencial.
*/
public function addClassroomInPerson(AcceptanceTester $teste)
{
sleep(5);
$robots = new ClassroomRobots($teste);
$robots->pageAddClassroom();

$builder = new ClassroomBuilder();
$dataClassroom = $builder->buildCompleted();

$robots->name($dataClassroom['name']);
$robots->stageVsModalaty($dataClassroom['edcenso_stage_vs_modality_fk']);
$robots->typeMediation($dataClassroom['pedagogical_mediation_type_IN_PERSON']);
$robots->modality($dataClassroom['modality']);
$robots->location($dataClassroom['diff_location']);
$robots->initialTime($dataClassroom['initial_time']);
$robots->finalTime($dataClassroom['final_time']);
$robots->days($dataClassroom['week_days_monday']);
$robots->typeService($dataClassroom['assistance_complementary_activity']);
sleep(2);
$robots->activitiesComplementary($dataClassroom['complementary_activity_type_1']);
$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 - Educação a Distância - EAD.
*/
public function allFieldsAddClassroomEAD(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_EAD']);
$robots->modality($dataClassroom['modality']);
$robots->educationCourse($dataClassroom['edcenso_professional_education_course_fk']);
$robots->initialTime($dataClassroom['initial_time']);
$robots->finalTime($dataClassroom['final_time']);
$robots->turn($dataClassroom['turn']);
$robots->days($dataClassroom['week_days_monday']);
$robots->typeService($dataClassroom['assistance_complementary_activity']);
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();
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($dataClassroom['week_days_monday']);
$robots->typeService($dataClassroom['assistance_complementary_activity']);
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();
sleep(2);

$teste->see('Turma adicionada com sucesso!');
$teste->canSeeInCurrentUrl('?r=classroom/index');

return $dataClassroom;
}
}
Loading
Loading