Skip to content

Run test automation on cloud with Laravel and LambdaTest. This is a sample repo to help you execute Laravel framework based test scripts in parallel with LambdaTest automation testing cloud

Notifications You must be signed in to change notification settings

LambdaTest/php-laravel-dusk-todo

Repository files navigation

LambdaTest Logo

php-laravel-dusk-todo

A Sample PHP-Laravel app to run selenium automation tests on lambdatest grid.

Prerequisites

  • Install php and composer on your system. Setup Instrcutions for the can be found here

Installation

# setup project dependencies composer install composer dump-autoload

Configuration steps

  • Create .env from example file
     cp .env.example .env
  • Replace LT_USERNAME with your lambdatest username. It can be obtained from lamabdtest dashbaord
  • Replace LT_ACCESS_KEY with your access key. It can be genrated from lamabdtest lamabdtest dashbaord](https://automation.lambdatest.com/)
  • Update platform configuration in driver method of tests/DuskTestCase.php, to specify the target where tests should run. (List of supported OS platfrom, Browser, resolutions can be found at LambdaTest capability generator) Sample configuration
    return RemoteWebDriver::create($url, DesiredCapabilities::chrome() ->setCapability("platform", "win10") ->setCapability("browserName", "chrome") ->setCapability("version", "71.0") ->setCapability("resolution", "1024x768") ->setCapability("build", "LaravelDusk Build") ->setCapability("name", "LaravelDusk Test") ->setCapability("network", true) ->setCapability("video", true) ->setCapability("visual", true) ->setCapability("console", true) ->setCapability("tunnel", false) );

Routing traffic through your local machine

  • Set tunnel value to true in test capabilities (found in driver method of tests/DuskTestCase.php).

    e.g:

    return RemoteWebDriver::create($url, DesiredCapabilities::chrome() ->setCapability("platform", "win10") ->setCapability("browserName", "chrome") ->setCapability("version", "71.0") ->setCapability("resolution", "1024x768") ->setCapability("build", "LaravelDusk Build") ->setCapability("name", "LaravelDusk Test") ->setCapability("network", true) ->setCapability("video", true) ->setCapability("visual", true) ->setCapability("console", true) ->setCapability("tunnel", true) );

OS specific instructions to download and setup tunnel binary can be found at the following links.

- [Windows](https://www.lambdatest.com/support/docs/display/TD/Local+Testing+For+Windows) - [Mac](https://www.lambdatest.com/support/docs/display/TD/Local+Testing+For+MacOS) - [Linux](https://www.lambdatest.com/support/docs/display/TD/Local+Testing+For+Linux) 

Run tests

php artisan dusk

Generate test cases

  • Change directory to project root cd /your/project
  • Execute php artisan dusk:make {test case name} e.g:
    php artisan dusk:make TodoTest

Note

Our sample test case can be found in tests/Browser/TodoTest.php file. It navigates to our sample app check some checkboxes add some to do.

About

Run test automation on cloud with Laravel and LambdaTest. This is a sample repo to help you execute Laravel framework based test scripts in parallel with LambdaTest automation testing cloud

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages