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

[DOC] Add best practice for functional tests #87

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions Documentation/BestPractices/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,23 @@ preprocessors:
'@sitepackage/Resources/.../MyFont.eot'
);
}

.. _functional-tests:

Configuration for Functional Tests
==================================

If you use the extension in a project that utilizes `TYPO3's testing framework <https://github.com/TYPO3/testing-framework>`__
to validate the HTML output for certain pages, the following adjustments need to be made:

* Make sure that `vite_asset_collector` is loaded in your testing setup by adding it to the list in
:php:`$testExtensionsToLoad`
* To get a consistent frontend output, it is recommended to use the dev server configuration. Because tests
are run in `TYPO3_CONTEXT=Testing`, it might be necessary to specify this option explicitly within your testing
setup:

.. code-block:: php

$this->get(\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class)->set('vite_asset_collector', [
'useDevServer' => '1',
]);
Loading