amoifr/pickle-panther-bundle
YAML-driven end-to-end testing for Symfony on top of Panther. Write browser scenarios in French or English, map steps to PHP “sentences,” and run them via a BasePantherTest. Generates a self-contained HTML report; supports context (desktop/mobile) and auth hooks.
[#Sentence] annotation system allows for modular, reusable test logic. This mirrors Symfony’s dependency injection and service-based architecture, ensuring consistency.BasePantherTest), it can likely integrate with other frameworks with minor adjustments (e.g., Pest).#[Sentence]) require PHP expertise. Teams without backend devs may struggle to extend functionality.panther.yaml).BasePantherTest).composer require amoifr/pickle-panther-bundle installation, with Panther as a sub-dependency.panther.yaml for base URLs, timeouts, and browser profiles.# config/packages/panther.yaml
panther:
selenium_url: 'http://localhost:4444/wd/hub'
browser: chrome
config/bundles.php:
return [
// ...
Amoifr\PicklePantherBundle\PicklePantherBundle::class => ['all' => true],
];
php bin/console pickle-panther:assets:install.tests/E2E/Scenario/ (e.g., homepage.yaml).scenarios:
- nom: "User logs in successfully"
contexte: { navigateur: desktop }
etapes:
- action: "Visite la page avec l'[/login]"
- action: "Remplit le champ [email] avec [user@example.com]"
args: { champ: "input[type=email]", valeur: "user@example.com" }
- action: "Clique sur le bouton [Submit]"
- action: "Vérifie que l'URL contient [/dashboard]"
[#Sentence] to handle custom logic.#[Sentence("Remplit le champ [champ] avec [valeur]")]
class FormFillerProvider
{
public function fillField(Client $client, string $champ, string $valeur): void
{
$client->fillField($champ, $valeur);
}
}
BasePantherTest and run scenarios:
final class LoginTest extends BasePantherTest
{
public function testLogin(): void
{
$this->createScenarioRunner()->runTest(__DIR__.'/Scenario/login.yaml');
}
}
- name: Run E2E Tests
run: php bin/phpunit tests/E2E
services:
selenium:
image: selenium/standalone-chrome
ports:
- "4444:4444"
panther.yaml includes DB setup/teardown hooks or use Symfony’s test fixtures.amoifr/pickle-panther-bundle for releases. Given its niche focus, updates may be infrequent.contexte fields) may require test suite updates.--parallel flag or a custom runner to distribute scenarios across CI workers.How can I help you explore Laravel packages today?