Browse Source

Tests : remise en place tests fonctionnels déjà écrits

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
1b2786b8d3
9 changed files with 46 additions and 20 deletions
  1. +9
    -0
      backend/config/test-local.php
  2. +8
    -1
      tests/codeception/config/backend/config.php
  3. +7
    -1
      tests/codeception/config/frontend/config.php
  4. +7
    -1
      tests/codeception/config/producer/config.php
  5. +2
    -2
      tests/codeception/frontend/functional/ContactCept.php
  6. +1
    -3
      tests/codeception/frontend/functional/HomeCept.php
  7. +0
    -9
      tests/codeception/frontend/functional/PricesCept.php
  8. +9
    -0
      tests/codeception/frontend/functional/ServiceCept.php
  9. +3
    -3
      tests/codeception/frontend/functional/SignupCept.php

+ 9
- 0
backend/config/test-local.php View File

<?php

return [
'components' => [
'view' => [
'class' => 'common\components\ViewBackend',
],
],
];

+ 8
- 1
tests/codeception/config/backend/config.php View File

/** /**
* Application configuration for all backend test types * Application configuration for all backend test types
*/ */
return [];

return [
'components' => [
'view' => [
'class' => 'common\components\ViewBackend',
],
],
];

+ 7
- 1
tests/codeception/config/frontend/config.php View File

* Application configuration for all frontend test types * Application configuration for all frontend test types
*/ */


return [];
return [
'components' => [
'view' => [
'class' => 'common\components\ViewFrontend',
],
],
];

+ 7
- 1
tests/codeception/config/producer/config.php View File

* Application configuration for all frontend test types * Application configuration for all frontend test types
*/ */


return [];
return [
'components' => [
'view' => [
'class' => 'producer\components\ProducerView',
],
],
];

+ 2
- 2
tests/codeception/frontend/functional/ContactCept.php View File

$contactPage = ContactPage::openBy($I); $contactPage = ContactPage::openBy($I);


$I->wantTo("m'assurer que le formulaire de contact fonctionne"); $I->wantTo("m'assurer que le formulaire de contact fonctionne");
$I->see('Me contacter', 'h1');
$I->see('Contact', 'h1');


$I->amGoingTo("envoyer un message"); $I->amGoingTo("envoyer un message");
$contactPage->submit([ $contactPage->submit([
'body' => 'Message', 'body' => 'Message',
'isTest' => 'isTest' 'isTest' => 'isTest'
]); ]);
$I->see('Votre message a bien été envoyé', '.alert-success');
$I->see('Merci pour votre message', '.alert-success');

+ 1
- 3
tests/codeception/frontend/functional/HomeCept.php View File

$I = new FunctionalTester($scenario); $I = new FunctionalTester($scenario);
$I->wantTo("m'assurer que la page d'accueil s'affiche"); $I->wantTo("m'assurer que la page d'accueil s'affiche");
$I->amOnPage('site/index'); $I->amOnPage('site/index');
$I->see('distribution alimentaire', 'h1');
$I->see('Fonctionnalités', '.the-title');
$I->see('Tarifs', '.the-title');
$I->see('un outil pour organiser des ventes en circuit court', 'h1');

+ 0
- 9
tests/codeception/frontend/functional/PricesCept.php View File

<?php
use tests\codeception\frontend\FunctionalTester;

/* @var $scenario Codeception\Scenario */

$I = new FunctionalTester($scenario);
$I->wantTo("m'assurer que la page des tarifs s'affiche");
$I->amOnPage('site/prices');
$I->see('Tarifs', 'h1');

+ 9
- 0
tests/codeception/frontend/functional/ServiceCept.php View File

<?php
use tests\codeception\frontend\FunctionalTester;

/* @var $scenario Codeception\Scenario */

$I = new FunctionalTester($scenario);
$I->wantTo("m'assurer que la page 'fonctionnalités, services & tarifs' fonctionne");
$I->amOnPage('site/service');
$I->see('Fonctionnalités, services & tarifs', 'h1');

+ 3
- 3
tests/codeception/frontend/functional/SignupCept.php View File

'id_producer' => '32', 'id_producer' => '32',
'is_test' => 'isTest' 'is_test' => 'isTest'
]); ]);
$I->see('Inscription confirmée', 'h1');
$I->see('Votre inscription a bien été prise en compte', '.alert-success');




$I->amOnPage('logout'); $I->amOnPage('logout');
$I->see('distribution alimentaire', 'h1');
$I->see('un outil pour organiser des ventes en circuit court', 'h1');




$I->amOnPage($signupPage->route); $I->amOnPage($signupPage->route);
'cgv' => '1', 'cgv' => '1',
'is_test' => 'isTest' 'is_test' => 'isTest'
]); ]);
$I->see('Inscription confirmée', 'h1');
$I->see('Votre inscription a bien été prise en compte', '.alert-success');

Loading…
Cancel
Save