Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ibexa Behat Bundle Laravel Package

elbformat/ibexa-behat-bundle

A Behat bundle for Ibexa offering a fast, Symfony Kernel-based testing approach with partial database resets, strict behavioral wording, and support for page builder blocks.

View on GitHub
Deep Wiki
Context7

ibexa-behat-bundle

Although there already is an official behat bundle for ibexa, this bundle has a completely different approach. It is optimized for faster execution by using the Symfony Kernel directly and only partially reset the database. Also, it has more strict wordings in a behavioural manner. Last but not least it also supports creating page builder blocks.

Installation

  1. Add the bundle via composer
composer require elbformat/ibexa-behat-bundle
  1. Activate bundles in config/bundles.php
Elbformat\SymfonyBehatBundle\ElbformatSymfonyBehatBundle::class => ['test' => true],
Elbformat\IbexaBehatBundle\ElbformatIbexaBehatBundle::class => ['test' => true],
  1. Configure behat.yml See the symfony-behat-bundle installation instructions. Add more contexts as you like
default:
  suites:
    default:
      contexts:
        - Elbformat\IbexaBehatBundle\Context\AdminContext
        - Elbformat\IbexaBehatBundle\Context\ContentContext
        - Elbformat\IbexaBehatBundle\Context\LandingpageContext
        - Elbformat\IbexaBehatBundle\Context\ObjectstateContext
        - Elbformat\IbexaBehatBundle\Context\SolrContext
        - Elbformat\IbexaBehatBundle\Context\TrashContext
  1. Use TestFilePathNormalizer In order to test uploaded images, you need a predictable filename. This can be achieved by skipping the random hash at the end, when running test. Just put the following line in your config/services_behat.yaml to
services:
  # Prevent random character in image urls for tests
  Elbformat\IbexaBehatBundle\IO\TestFilePathNormalizer:
    decorates: 'Ibexa\Core\IO\FilePathNormalizer\Flysystem'
    arguments: ['@.inner']

Run tests

Make sure you have a database configured for the test environment. It's recommended to have an extra database configured for tests in .env.test, to not accidentally delete real contents. After configuration you should initialise it once, before running any test against it.

bin/console -e test do:da:cr
bin/console -e test do:mi:mi -n
bin/console -e test ib:mi:mi -n
bin/console -e test ibexa:reindex

Then you can simply run the tests.

vendor/bin/behat

Tweaks

When you have internal, fixed content/location ids > 1000 you may want to change the minimum id for resetting the database. To do this, you can simply add an enviromment variable BEHAT_CONTENT_MIN_ID=10000 to .env.behat

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings