All Projects → unglud → dusker

unglud / dusker

Licence: MIT license
Stand alone Laravel Dusk test suit, which do not require Laravel framework itself

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to dusker

scribd-dl
Command-line program to download Scribd documents in pdf format
Stars: ✭ 23 (-17.86%)
Mutual labels:  selenium, chromedriver
jest-selenium
This project shows how to drive your selenium tests with Jest.
Stars: ✭ 22 (-21.43%)
Mutual labels:  selenium, chromedriver
Headless
Create a virtual X screen from Ruby, record videos and take screenshots.
Stars: ✭ 951 (+3296.43%)
Mutual labels:  integration-testing, selenium
demo-webdriverio-cucumber
E2E Tests with WebdriverIO and Cucumber
Stars: ✭ 28 (+0%)
Mutual labels:  integration-testing, selenium
docker-selenium-lambda
The simplest demo of chrome automation by python and selenium in AWS Lambda
Stars: ✭ 172 (+514.29%)
Mutual labels:  selenium, chromedriver
w3c-webdriver
W3C WebDriver JavaScript Client
Stars: ✭ 28 (+0%)
Mutual labels:  integration-testing, selenium
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+47235.71%)
Mutual labels:  integration-testing, selenium
Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+8757.14%)
Mutual labels:  selenium, chromedriver
codeigniter-tettei-apps
『CodeIgniter徹底入門』のサンプルアプリケーション(CodeIgniter v3.1版)
Stars: ✭ 26 (-7.14%)
Mutual labels:  phpunit, selenium
chameleon-crawler
Browser automation for Chameleon.
Stars: ✭ 17 (-39.29%)
Mutual labels:  selenium, chromedriver
Insta-Bot
Python bot using Selenium increasing Instagram Followers.
Stars: ✭ 62 (+121.43%)
Mutual labels:  selenium, chromedriver
devtools-proxy
Multiplexing proxy for Chrome DevTools. Fully compatible with Selenium and ChromeDriver
Stars: ✭ 64 (+128.57%)
Mutual labels:  selenium, chromedriver
Steward
PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust
Stars: ✭ 215 (+667.86%)
Mutual labels:  phpunit, selenium
Codeception
Full-stack testing PHP framework
Stars: ✭ 4,401 (+15617.86%)
Mutual labels:  integration-testing, phpunit
Laravel Dusk Ci
Docker Test suite for Laravel Dusk in gitlab CI
Stars: ✭ 129 (+360.71%)
Mutual labels:  phpunit, chromedriver
Hsac Fitnesse Fixtures
An environment to define and run integration tests. It contains Fitnesse fixture (base) classes and a baseline FitNesse installation.
Stars: ✭ 99 (+253.57%)
Mutual labels:  integration-testing, selenium
Zillow
Zillow Scraper for Python using Selenium
Stars: ✭ 141 (+403.57%)
Mutual labels:  selenium, chromedriver
Whatsapp Assistant Bot
A personal WhatsApp assistant bot that will help you search anything on the web (Google, Images, Google Maps)
Stars: ✭ 198 (+607.14%)
Mutual labels:  selenium, chromedriver
Fifa21-Autobidder
Selenium-based bot that autobids and autobuys players on FIFA 23 Ultimate Team's transfer market
Stars: ✭ 106 (+278.57%)
Mutual labels:  selenium, chromedriver
TikTok
Download public videos on TikTok using Python with Selenium
Stars: ✭ 37 (+32.14%)
Mutual labels:  selenium, chromedriver

dusker

Stand-alone Laravel Dusk test suit, which does not require Laravel framework itself.

Build Status Total Downloads Latest Stable Version License

Laravel Dusk provides an expressive, easy-to-use browser automation and testing API. By default, Dusk does not require you to install JDK or Selenium on your machine. Instead, Dusk uses a standalone Chrome driver. However, you are free to utilize any other Selenium driver you wish.

Installation

To get started, you should add the unglud/dusker Composer dependency to your project:

composer require --dev unglud/dusker

Next, you need to copy all necessary files to your working directory. The command below will do it for you. It creates (or use existing) tests directory and put files there. Also, it copies artisan console utility to your project root directory. If you already have this file, it will be overwritten!

The file .env.dusk will be in your project root as well, which you will need rename to .env or copy it content to your existing one.

composer run-script post-install-cmd -d ./vendor/unglud/dusker

If you would like these files to update automatically each time you update this package, you can add this to your composer.json file:

"scripts": {
  "post-install-cmd": [
    "Dusker\\CopyFile::copy"
  ],
  "post-update-cmd": [
    "Dusker\\CopyFile::copy"
  ]
},
"extra": {
  "copy-file": {
    "vendor/unglud/dusker/src/example/": "tests/",
    "vendor/unglud/dusker/artisan": "artisan"
  }
}

As you notice file .env.dusk not included there to simplify things.

After installing the package, Artisan commands will be available from your root project. Run the dusk:install Artisan command:

php artisan dusk:install

Now try to run test to make sure everything works

php artisan dusk

How to use

After this part you can use official documentation for Dusk on the Laravel website, `cuz it will work exactly as it was designed by Taylor Otwell.

Authentication

Often, you will be testing pages that require authentication. You can use Dusk's loginAs method in order to avoid interacting with the login screen during every test. The loginAs method accepts a user login and password:

$this->browse(function (Browser $browser) {
    $browser->loginAs('username', 'password')
          ->visit('/home');
});

After using the loginAs method, the user session will be maintained for all tests within the file.

Authentication Setup

Since we do not have access to native Auth and Router from Laravel, because we use it without Laravel we need to setup login functionality. In .env you should specify LOGIN_ENDPOINT -- path to your public directory where Dusker will copy the file which will be accessible from a browser. By default its http://example.com/_dusker/login.php. Second LOGIN_IMPLEMENTATION -- path to your class, which utilize logic of your project allowing Authentication. You can use /tests/LoginManagerExample.php as an example of how it should look.

License

Dusker is released under the MIT Licence. See the bundled LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].