Download the PHP package prestaflow/php-library without Composer

On this page you can find all versions of the php package prestaflow/php-library. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-library

Let's Build Together 🚀

PrestaFlow is an open-source set of prebuilt tests components, ready-to-use examples made for the PrestaShop E-commerce software.

As now, it's the first library of its kind that lets you write and manage automated tests on your PrestaShop in PHP.

More info : see the documentation.

Pin a PrestaShop version per suite

By default, PrestaFlow reads the target PrestaShop version from PRESTAFLOW_PS_VERSION in your .env. To pin a version per suite — useful when a single repo tests both a 1.7 shop and a 9.x shop (typical migration workflow):

Resolution priority: fluent onVersion() → $psVersion property → PRESTAFLOW_PS_VERSION env → default 8.1.0.

onVersion() throws InvalidArgumentException on malformed input (expected format: 1.7, 1.7.8, 1.7.8.11, 9, 9.0, 9.0.1, etc.).

Run only some suite folders

prestaflow run <path> runs every suite under <path>. To run only some of its sub-folders, list them, comma-separated, relative to <path>:

Visual regression runs

VisualTestsSuite reads these variables:

Variable Effect
PRESTAFLOW_DEVICE Device preset of the run (desktop, mobile, …); must be declared in the suite's $devices. Default: first declared device.
PRESTAFLOW_LOCALE Locale of the run; must be declared in the suite's $locales. Default: first declared locale.
PRESTAFLOW_VISUAL_ONLY Comma-separated checkpoint names, as declared in $checkpoints (e.g. home,footer). Only those run, in declaration order; the others are not in the results at all. Spaces are trimmed, unknown names are ignored — but if none matches, the run fails with a step listing the unknown and declared names. Unset or empty: every checkpoint runs.
PRESTAFLOW_VISUAL_UPDATE Boolean (1, true, yes, on). Captures exactly as usual (masks, device, scroll, element clip) but writes each capture as the reference instead of comparing it. The result is status: baseline with updated: true when a reference was replaced (false for a first baseline); no diff image.
PRESTAFLOW_CDP_TIMEOUT Timeout in milliseconds of the synchronous Chrome calls (evaluate, querySelector…), for every suite, not only visual ones. Default: 5000, chrome-php's own default. Visual captures are always written with a 30 s timeout.

Back-office suites

A visual suite with protected string $area = 'bo'; captures the back office. Every admin URL carries a token, so a checkpoint names a sidebar entry instead of a path:

Key Default Effect
menu null Sidebar entry selector, or a comma-separated list (first present wins). The suite reads its link, which carries the token, and opens it. null: back-office root.
auth true false: captured logged out (the login page). Logged-out checkpoints run first; the suite then logs in once with PRESTAFLOW_BO_EMAIL / PRESTAFLOW_BO_PASSWD.
hide [] Selectors set to display: none during the capture (popups, modal backdrops). Works in both areas.

The back-office area also uses PRESTAFLOW_BO_URL (admin URL, default admin-dev/), PRESTAFLOW_BO_EMAIL and PRESTAFLOW_BO_PASSWD (login). A relative PRESTAFLOW_BO_URL is completed from PRESTAFLOW_FO_URL with the same rule as $backOfficeUrl below (shop path kept, query and fragment dropped, //host takes the shop scheme); nothing is refused for environment variables.

CSS transitions are frozen during back-office captures (protected ?bool $freezeTransitions; null = on for bo, off for fo). See src/Tests/Suites/Visual/BackOffice.php.

Shop and back-office URLs in the suite file

A visual suite may pin its own URLs (the PrestaFlow app writes them from its editor). A non-empty value replaces PRESTAFLOW_FO_URL / PRESTAFLOW_BO_URL (or the URLs sent by the app) before the first checkpoint:

null or empty: the environment URL. Rules:

Visual picker API

The visual picker of the PrestaFlow app captures a page and lists its elements, so that a user can pick a checkpoint selector. It uses the run's own code, under short ceilings.

Back-office page. Open the checkpoint's page in the shared browser, capture it, log out, then close the browser:

Front-office page. (new PageSnapshot())->take($url, $device) starts a dedicated browser, applies the run's environment (TestsSuite::applyEnvironment(), with $url as the cookies' default domain), opens the URL, captures the page and closes the browser. It starts from empty headers and restores TestsSuite::$extraHttpHeaders on return, so a run in the same process neither leaks into it nor is altered by it. It throws SnapshotException when Chrome cannot start or the page does not load in time. That list is not exhaustive: once the page is loaded, the capture (captureCurrent()) lets chrome-php exceptions through as they are.

Exceptions of openBackOfficeCheckpoint().

Exception When
BackOfficeTimeoutException The back office did not answer within the budget. It extends \RuntimeException: catch it first.
\RuntimeException Run error with a readable message (credentials refused, unexpected page, menu entry not found, session already open for an auth => false checkpoint).
\LogicException The suite's $area is not bo.
\InvalidArgumentException An auth => false checkpoint with a menu.

Messages never carry a token (token, _token, plain, encoded or double-encoded) nor URL credentials. getPrevious() keeps the original cause, which may hold the raw URL: never show or log it.

Environment. TestsSuite::applyEnvironment($browser, $page, ?string $defaultUrl = null) applies what before() applies to a run, in the same order: Basic Auth (PRESTAFLOW_BASIC_USER / PRESTAFLOW_BASIC_PASS), then the PRESTAFLOW_EXTRA_HEADERS headers on the connection and the page, then the PRESTAFLOW_COOKIES cookies. A cookie without domain takes the host of its own url, otherwise the host of $defaultUrl (the page is still on about:blank). Values are read from the environment only. Without these variables, nothing is set. The headers stay in TestsSuite::$extraHttpHeaders for the pages created afterwards: call TestsSuite::clearEnvironment() when releasing the browser, so that a persistent worker does not keep them for the next job. It only empties that array: headers already set on a browser's connection stay there, so close or reset that browser too (TestsSuite::resetBrowser()).

Run a suite against a throwaway shop

docker-compose.yml boots a disposable PrestaShop from the official Flashlight images — one service per version, each with its own database and its own port:

Service PrestaShop Shop 1 Shop 2 Shop 1 theme Shop 2 theme
ps17 1.7.8.11 8017 8018 classic classic
ps82 8.2.8 8082 8083 classic classic
ps92 9.2.0 8092 8093 hummingbird classic

The 9.2 container therefore gives you both themes from a single boot — hummingbird on 8092, classic on 8093 — which is what you want for checking that a theme-aware selector resolves per theme.

Wait for /admin-dev/ to answer 302 before running a suite, not for / to answer 200: the front office is served well before the post-scripts that provision the second shop have finished. A failing post-script does not stop the container, so a healthy container is not proof of a provisioned shop — the smoke suite is.

Full walkthrough, including tear-down and the two traps worth knowing: Testing against a throwaway shop.

The Live smoke workflow runs that same suite against all three versions on every push to main and every pull request.

The 1.7 and 8.2 rows of the live-smoke matrix are expected to fail today. Their page objects are nine-line stubs inheriting the v9 selectors, so the matrix is reporting an absence of support rather than a regression. Each failure names the page that differs, which is the inventory the v7/v8 work needs. The rows are deliberately not skipped and not marked continue-on-error; fail-fast: false keeps them from cancelling the 9.2 row.


All versions of php-library with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
chrome-php/chrome Version ^1.10
sapientpro/image-comparator Version ^1.0
inceddy/image-compare Version ^1.0
symfony/console Version ^6.0 || ^7.0
vlucas/phpdotenv Version ^5.6
symfony/event-dispatcher Version ^6.0 || ^7.0
smalot/pdfparser Version ^2.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package prestaflow/php-library contains the following files

Loading the files please wait ...