Download the PHP package genesis/behat-fail-aid without Composer

On this page you can find all versions of the php package genesis/behat-fail-aid. 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 behat-fail-aid

Behat Fail Aid Master branch Latest Stable Version Total Downloads License Monthly Downloads Quality Gate Status Maintainability Rating Security Rating

Introduction

Time and time again we've all seen how difficult and stressful it can become to fix behat tests. This package is their to help gather all possible information around failures and print them as you see a failure taking out the need to do basic investigations with minimal setup.

Usual failure Before

With fail-aid context After

With config options enabled More info

The links are ready to be clicked on and opened in the browser. No faff!

You also get the following step definitions for free upon activation:

These will output relevant information on the screen. (Your formatting must be pretty for this to work --format=pretty).

Whats new:

Major: Refactor, Controlled output, scenario debug cli, clear screenshots cli, host machine screenshot url.

Minor:

Patch: NA.

Installation:

CLI

Clear screenshots:

The --clear-screenshots flag, if supplied will remove existing screenshots from the directory specified.

Scenario debug:

The --scenario-debug flag, if supplied will take attempt to screenshots after each step and display in the console to aid debugging. Best used when working on a single scenario along with the autoclean feature.

Wait on failure:

the --wait-on-failure={seconds} option can be used to investigate/inspect failures in the browser.

Feedback on failure:

the --feedback-on-failure flag can be used to print failures as soon as they occur. This is useful when using the progress formatter for example in long running test packs such as CI.

Config/Usage:

This is the basic setup and will give you a lot of information on failures. For more options read through the rest of the README. Any of the options below can be used in conjunction with each other.

Output options:

You can control the verbosity of the aid text from the config file. By default, all options are enabled.

These params can be overridden for each FailureContext declaration in behat.yml

screenshot options:

directory (string):

Override default screenshot path. Default folder is provided by sys_get_temp_dir() function. Can be a relative path.

mode (string):

default: Drivers will produce a png where supported, html otherwise.

html: All drivers will produce html screenshots, useful for interrogating runtime code.

png: All drivers will produce png screenshots, or die trying.

autoClean (bool):

Clean up the directory before the test suite runs.

Size (string):

The size of the screenshot to be taken on failure. At present, does not reset the size of the window. May conflict with the maximiseWindow API.

hostDirectory (string):

If running against a VM or container, you can set this path to the screenshots directory on the host machine. The screenshots will be produced the same, the output will be for your host machine instead. Resolves environment variables.

HostUrl (string):

If running on a remote environment it may be that the failures are available on a url. Resolves environment variables.

siteFilters option:

Applied on the content of a html screenshot. Useful when working with relative urls for assets.

Tracking js errors/logs:

You can easily track JavaScript activity on the page whenever a fail occurs. Place the following snippet in the head section of your application (make sure its global):

Your original debugging messages will still appear in your console.

When errors is enabled, any intended console.error calls and js exceptions will be recorded and displayed as part of the failure. Trim is applied on messages to shorten to the specified length.

debugBarSelectors option:

The above will go through each of the selector and find the element. If the element is found, it will display the text contained in the failure output. The debug bar details are gather after taking a screenshot of the page, so its safe to navigate out to another page if needs be. If you have to do this, have a look at the 'Advanced Integration' section for more information.

defaultSession option:

When you're using multiple sessions you can configure to use a particular session only with the fail aid extension.

Recording states:

You can record the state of your test for a failure. A state resets before each scenario.

When the above step definition is used in any scenario, it will record the test user email within the current state of the scenario. If the scenario fails, you will get any information stored in the state within the failure message.

Common debugging issues:

Its very common for a debug bar to interfere with your tests i.e 'your click will be received by another element' when performing JS enabled behaviour tests. In those cases, I would advise not to turn the debug bar off, but to execute code to hide it instead. In terms of debugging, gathering as much information as possible is paramount to a speedy fix. I would suggest placing your hideDebugBar() code after a visit call. This could be as simple as clicking a hide button on the bar.

Advanced integration:

Sometimes your logic will be more complicated and passing in options may not work for you. In those cases, it is advisable to have a look at the FailureContext of what it allows you to override. You can extend the FailureContext with your own context class, and override parts that you deem necessary. You will have to register your own class with the behat.yml contexts section.

To register with all suites without separate configuration, or just doing it in code:


All versions of behat-fail-aid with dependencies

PHP Build Version
Package Version
Requires behat/mink Version *@stable
behat/mink-extension Version ~2.0
behat/mink-selenium2-driver Version ~1.3
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 genesis/behat-fail-aid contains the following files

Loading the files please wait ....