Download the PHP package pstephan1187/laravel-jtest without Composer

On this page you can find all versions of the php package pstephan1187/laravel-jtest. 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 laravel-jtest

Laravel JTest is a package for running automated browser tests again a Laravel based application. It was specifically designed to be able to test Javascript enabled code.

Installation

Then in your PHPUnit tests, extend the JTest\JTestCase class and set the baseUrl property to your application url:

You can also set the browser to test with as well (defaults to Chrome):

You will also need to make sure that you have Selenium Stand-Alone Server installed and running. You can download Selenium here. You can run selenium by executing this command in the directory that you have the selenium server binary:

Make sure you use the actual version numbers for your download.

Usage

JTest uses a chainable method structure. This allows to to continually run each method in sequence. Here is a Basic example of how to use JTest:

Methods

setWindowSize($width, $height)

This allows you to force the size of the browser window to certain dimensions. Both width and height are required and must be pixel values. The browser will be resized the next time a window is opened. It is recommended that you run this command before you run the visit command so that the window is immediately sized as you need.

visit($uri)

Will navigate the browser to the given path. The baseUrl is prepended to the $uri. If you have the baseUrl set to 'http://localhost:8000' and then run $this->visit('/my-page'), the browser will navigate to 'http://localhost:8000/my-page'.

seePageIs($url)

This will assert that the current url is the baseUrl plus the given url. Given that the current URL is 'http://localhost:8000/my-page' and the baseUrl is 'http://localhost:8000', then seePageIs('/my-page') will pass.

type($text, $selector)

This will type the given text into the first element found matching the given CSS selector.

press($selector)

This will execute a click event on the first element found matching the given CSS selector.

click($text)

This will execute a click event on the first hyperlink ("a" tag) with the matching text.

select($values, $selector)

This will select any options whose text or value match any of the given values for the first element found matching the given CSS selector. $values can be an array or a single item.

file($file_path, $selector)

This will select the file located at $file_path in the first file input found matching the given CSS selector.

submit($selector)

This will submit the first form found matching the given CSS selector.

see($text)

This will assert that the given text is visible on the page.

notSee($text)

This will assert that the given text is not visible on the page.

seeOneOf($text_options)

This will assert that at least one of the given text options is visible on the page.

seeNumberOfElements($number, $selector)

This will assert that the given CSS selector returns the given number of elements

seeValueOfInput($value, $selector)

This will assert that the first input found matching the given CSS selector has a value attribute that matches the given value.

seeOptionsAreSelected($options, $selector)

This will assert that each of the given options are selected in the first element found matching the given CSS selector. $options will be matched base on the text of the option element or its value. $options can accept an array of items or a singular item.

seeOptionIsSelected($option, $selector)

This aliases to seeOptionsAreSelected

seeInElement($text, $selector)

This asserts that the first element found matching the given CSS selector contains the given text. If $text is an array, this will assert that all given items are found within the matching element.

getCurrentUrl()

This will return the URL that the browser is currently at. This method does not allow further chaining.

dump($var)

This will dump the given variable to the console.

wait($seconds)

This will pause the execution of the test for the given number of seconds

waitUntilElementExists($selector, $timeout = 5, $interval = 200)

This will pause the execution of the test until an element matching the given selector exists. The element will be checked for every $interval milliseconds until $timeout seconds has passed.

waitUntilElementVisible($selector, $timeout = 5, $interval = 200)

This will pause the execution of the test until an element matching the given selector is visible. The element will be checked for every $interval milliseconds until $timeout seconds has passed.

waitUntilText($text, $timeout = 5, $interval = 200)

This will pause the execution of the test until the given text exists anywhere on the page. The text will be checked for every $interval milliseconds until $timeout seconds has passed.

element($selector, $callback)

This will find the first element found matching the given CSS selector, pass it to the callback, execute the callback, then continue with the test. The following example finds the first h1 tag, then searches it for a button, then clicks the button.

The $element that is passed to the callback is of type Facebook\WebDriver\WebDriverElement. Read more here.

elements($selector, $callback)

Acts the same as element but passes all matching elements to the callback instead of just the first one.


All versions of laravel-jtest with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.1
phpunit/phpunit Version ^5.0
facebook/webdriver Version ~1.2.0
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 pstephan1187/laravel-jtest contains the following files

Loading the files please wait ....