Download the PHP package aklump/check-pages without Composer

On this page you can find all versions of the php package aklump/check-pages. 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 check-pages

Check Pages

Very Simple QA for HTTP

Heavy Development

Use at your own risk. This project is under heavy development and is undergoing changes pretty regularly.

Summary

This project intends to provide a process of QA testing of a website, which is very fast to implement and simple to maintain. You write your tests using YAML and they can be as simple as checking for a 200 HTTP response on the homepage.

Or ensuring the admin section is protected.

In a third test we can assert there is one logo image on the homepage, like so:

- visit: /
  find:
    - dom: '#logo img'
      count: 1

Lastly, make sure there are no unprocessed tokens on the page (a.k.a. a substring does not appear):

- visit: /
  find:
    - not contains: '[site:name]'

For more code examples explore the /examples directory.

Visit https://aklump.github.io/check_pages for full documentation.

Clarity of Purpose and Limitation

The mission of this tool is to provide testing for URLS and webpages in the most simple and concise syntax possible. For testing scenarios that require element interaction, such as clicks, hovers, scrolling, etc, there are amazing projects out there such as Cypress. This project will never try to compete with that crowd, and shall always restrict it's testing of the DOM to assertions against a single snapshot of the loaded URL.

Terms Used

Requirements

Install

Example Tests Demo

If you are new to this project and would like to see a demonstration, it would be a good idea to start with the examples. Run the example tests with the following commands. Then open up the files in the example/tests directory and study them to see how they work.1

  1. Open a new shell window which will run the PHP server for our example test pages.

    $ ./bin/start_test_server.sh
  2. Open a second shell window to execute the tests.

    $ ./bin/run_tests.sh

1 If you see no tests directory then create one and copy the contents of examples into tests. The example tests directory will only be created if you use create-project as the installation method.

Writing Your First Test Suite

  1. checkpages init to create tests directory and runner in the current directory.

Multiple Configuration Files

The project is designed to be able to run the same tests using different configurations. You can create multiple configuration files so that you are able to run the same test on live and then on dev, which have different base URLs.

.
└── tests
    ├── config/dev.yml
    ├── config/live.yml
    ├── suite.yml
    └── runner.php

In runner.php use the following line to specify the default config file:

load_config('config/dev');

When you're ready to run this using the live config add the config filename to the CLI command, e.g.,

$ ./check_pages runner.php --config=config/live

Test functions

The test functions for your PHP test files are found in _includes/runnerfunctions.inc.

Is JS Supported?

Yes, not by default, but you are able to indicate that given tests requires Javascript be run. Read on...

Javascript Testing Requirements

Enable Javascript per Test

Unless you enable it, or in the case the selector type (i.e., style , javascript) requires it, javascript is not run during testing. If you need to assert that an element exists, which was created from Javascript (or otherwise need javascript to run on the page), you will need to indicate the following in your test, namely js: true.

Asserting Javascript Evaluations

Let's say you want to assert the value of the URL fragment. You can do that with the javascript selector. The value of javascript should be the expression to evaluate, once the page loads. Notice that you may omit the js: true as it will be set automatically.

Javascript Testing Related Links

Filter

Use --filter to limit which suites are run.

The value passed to the filter will be matched against the $group/$id of the suite. Behind the scenes it is treated as a regex pattern, if you do not include delimiters, they will be added and case will not matter.

Given the following test suites...

CLI Matches
--filter=ui/ ui/footer.yml, ui/login.yml, menus.yml
--filter=/menus api/menus.yml, ui/menus.yml
--filter=ui/menus suites/ui/menus.yml

Notice the usage of the / separator to control how the group influences the result.

Complex Filter

It's possible to provide a complex filter that uses or logic like this:

./check_pages runner.php -f reports -f menus

Troubleshooting

Try using the --response to see the response source code as well.

./check_pages runner.php --response

Usage

In this case, since the project will be buried in your vendor directory, you will need to provide the directory path to your test files, when you run the test script, like this:

./vendor/bin/check_pages runner.php --dir=./tests_check_pages

This example assumes a file structure like this:

.
├── tests_check_pages
│   └── runner.php
└── vendor
    └── bin
        └── check_pages  

Contributing

If you find this project useful... please consider making a donation.


All versions of check-pages with dependencies

PHP Build Version
Package Version
Requires aklump/local-timezone Version ^0.0.1
aklump/loft-lib Version ^2
behat/mink Version ^1.8
chrome-php/chrome Version ^1.8
dmore/chrome-mink-driver Version ^2.7
ext-curl Version *
ext-dom Version *
ext-json Version *
guzzlehttp/guzzle Version ^6.3|^7.0
justinrainbow/json-schema Version ^5.2
laminas/laminas-xml2json Version ^3.2
php Version ^7.4
ralouphie/mimey Version ^2.1
shanethehat/pretty-xml Version ^1.0
spatie/browsershot Version ^3.57
symfony/config Version ^4.4|^5.4
symfony/console Version ^4.4|^5.4
symfony/css-selector Version ^3.4|^4.0|^5.0
symfony/dependency-injection Version ^4.4|^5.4
symfony/dom-crawler Version ^5.0
symfony/event-dispatcher Version ^4.4|^5.4
symfony/expression-language Version ^4.4|^5.4
symfony/yaml Version ^3.4|^4.0|^5.0
wikimedia/composer-merge-plugin Version ^2.1
ramsey/collection 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 aklump/check-pages contains the following files

Loading the files please wait ....