Configuration


In order to configure your project and tell PrestaFlow the necessary data, you need to add the following elements to your .env file.

Since v1.2.4, you can also use an .env.local file to override values.

PRESTAFLOW_FO_URL is the only required configuration.

Adding the PRESTAFLOW_PS_VERSION and PRESTAFLOW_LOCALE configurations is strongly recommended.

#.env

#PrestaShop instance

Parameters Mandatory Example value Default value
PRESTAFLOW_PS_VERSION 9.0.0 8.1.0
PRESTAFLOW_LOCALE fr en
PRESTAFLOW_PREFIX_LOCALE true false

#Front Office

Parameters Mandatory Example value Default value
PRESTAFLOW_FO_URL Yes https://9.0.0.test/ false
PRESTAFLOW_FO_EMAIL front@prestaflow.io pub@prestashop.com
PRESTAFLOW_FO_PASSWD front-password 123456789

#Back Office

Parameters Mandatory Example value Default value
PRESTAFLOW_BO_URL admin-dev /admin-dev/
PRESTAFLOW_BO_EMAIL back@prestaflow.io demo@prestashop.com
PRESTAFLOW_BO_PASSWD back-password Correct Horse Battery Staple

The PRESTAFLOW_BO_URL could be an URL or a folder ; if PrestaFlow detects a string, the Front Office URL will be used as source.

#Browser options

Parameters Mandatory Example value Default value
PRESTAFLOW_HEADLESS false true
PRESTAFLOW_USER_AGENT PrestaFlow
PRESTAFLOW_WINDOW_SIZE_WIDTH 390 1920
PRESTAFLOW_WINDOW_SIZE_HEIGHT 844 1080

#HTTP presets

Parameters Mandatory Example value Default value
PRESTAFLOW_COOKIES [{"name":"___kbgdcc","value":"1","domain":".example.com"}]
PRESTAFLOW_BASIC_USER staging
PRESTAFLOW_BASIC_PASS staging-password

See HTTP presets for the full guide.

#Run selection

Parameters Mandatory Example value Default value
PRESTAFLOW_SUITES BackOffice,FrontOffice/Checkout all suites
PRESTAFLOW_DEVICE mobile first device the visual suite declares

PRESTAFLOW_SUITES is the environment twin of the CLI's --suites option, which wins when both are set. PRESTAFLOW_DEVICE picks the device of a data-driven visual suite.

#Theme

Parameters Mandatory Example value Default value
PRESTAFLOW_THEME hummingbird classic

See Theme selectors for the full guide.

#Misc

Parameters Mandatory Example value Default value
PRESTAFLOW_DEBUG true false
PRESTAFLOW_VERBOSE false true
PRESTAFLOW_TZ Europe/Paris UTC
PRESTAFLOW_HYPERLINKS 1 auto-detected

#More details

PRESTAFLOW_PS_VERSION

The PrestaShop version of the shop under test. It decides which page namespace the library loads (Pages\v7, Pages\v8, Pages\v9).

A suite can pin its own version, which wins over the environment: useful when one repository tests a 1.7 shop and a 9 shop. Use the $psVersion property, or the fluent onVersion(), which wins over both:

Copied!
1class MigrationBaselineSuite extends TestsSuite
2{
3 protected $psVersion = '1.7.8.11';
4 
5 public function init()
6 {
7 // ...or decided at run time
8 $this->onVersion($_ENV['SHOP_UNDER_TEST'] ?? '1.7.8.11');
9 $this->importPage('BackOffice\Login');
10 
11 return $this;
12 }
13}

The resolution order is onVersion(), then $psVersion, then PRESTAFLOW_PS_VERSION, then 8.1.0. Call onVersion() before importPage(): it decides which namespace the next pages come from. It rejects anything that is not a dotted version such as 1.7.8.11 or 9.0.1.

Both were introduced in 1.8.0 but had no effect there: the suite kept the environment's version.

PRESTAFLOW_PREFIX_LOCALE

Useful when your store is in multiple languages.

Allows PrestaFlow to add the language prefix to the desired URLs.

PRESTAFLOW_WINDOW_SIZE_WIDTH / PRESTAFLOW_WINDOW_SIZE_HEIGHT

The browser window size, 1920 × 1080 by default. Before 1.8.0 one launch path defaulted to a swapped 1000 × 1920 (portrait) when neither was set.

A visual suite sets the window size from its device presets. Code driving the library can also call TestsSuite::useBrowserOptions($width, $height, $userAgent), which wins over these variables, then TestsSuite::resetBrowser() so the next browser launches with the new size. See Browser options.

PRESTAFLOW_HEADLESS

When this parameter is set to true, you have the option to see the actions performed via automatic browser opening at each step.

PRESTAFLOW_DEBUG

Allows you to obtain useful information during test execution.

PRESTAFLOW_VERBOSE

When set to false, this reduces the output display when tests run without errors.

PRESTAFLOW_THEME

Which front-office theme the shop under test is running, so the matching selector overrides are applied. There is no auto-detection — a multistore can run a different theme per shop, so this is always something you state. Defaults to classic.

It can also be set for a single run (PRESTAFLOW_THEME=hummingbird php bin/prestaflow run ...) or for a single page ($this->importPage('FrontOffice\Product', ['theme' => 'hummingbird'])).

When a step fails, PrestaFlow saves a screenshot and prints its path. In a terminal that supports OSC 8 hyperlinks, that path is also clickable.

There is no way to ask a terminal whether it supports them, so PrestaFlow uses an allowlist — a terminal that does not understand the sequence would print the raw escape codes, which is worse than no link. Set this to 1 to force links on in a terminal that is not listed, or 0 to force them off.

Either way the absolute path is printed, so a missing link is never a dead end.