Add browser and unit test suite with Pest + Playwright
Add comprehensive test coverage for core site features (content, navigation, language, FAQ, news, petition, newsletter) using Pest browser tests and unit tests for custom plugins. Includes test infrastructure (Containerfile.test, compose.test.yaml), test documentation, and test files covering petition form logic, CSV handling, translation, date formatting, rate limiting, and map data building.
This commit is contained in:
parent
0b61643ec5
commit
b8e6d2537d
20 changed files with 1331 additions and 33 deletions
46
tests/Browser/ContentTest.php
Normal file
46
tests/Browser/ContentTest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
it('about page shows organization history', function () {
|
||||
$this->visit(BASE_URL . '/om-oss')
|
||||
->assertSee('Vår historie');
|
||||
});
|
||||
|
||||
it('about page mentions the organization name', function () {
|
||||
$this->visit(BASE_URL . '/om-oss')
|
||||
->assertSourceHas('Stopp lidelsen');
|
||||
});
|
||||
|
||||
it('privacy page loads with correct heading', function () {
|
||||
$this->visit(BASE_URL . '/personvern')
|
||||
->assertSee('Personvernerklæring');
|
||||
});
|
||||
|
||||
it('contact page loads with content', function () {
|
||||
$this->visit(BASE_URL . '/kontakt')
|
||||
->assertSourceHas('<main');
|
||||
});
|
||||
|
||||
it('brochures page loads with intro text', function () {
|
||||
$this->visit(BASE_URL . '/brosjyrer')
|
||||
->assertSee('Brosjyrer');
|
||||
});
|
||||
|
||||
it('articles section loads', function () {
|
||||
$this->visit(BASE_URL . '/artikler')
|
||||
->assertSourceHas('<main');
|
||||
});
|
||||
|
||||
it('patient info article loads', function () {
|
||||
$this->visit(BASE_URL . '/artikler/pasientinfo')
|
||||
->assertSee('pasienter');
|
||||
});
|
||||
|
||||
it('homepage shows goals section heading', function () {
|
||||
$this->visit(BASE_URL . '/')
|
||||
->assertSee('oppnå');
|
||||
});
|
||||
|
||||
it('homepage shows intro text about the organization', function () {
|
||||
$this->visit(BASE_URL . '/')
|
||||
->assertSee('frivillig');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue