Skip to content

Commit

Permalink
Merge pull request #4 from roquie/circle-ci
Browse files Browse the repository at this point in the history
Circle CI integration
  • Loading branch information
roquie authored Sep 4, 2017
2 parents 9e19f2f + 6fd15ce commit 7a7df1a
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
jobs:
build:
docker:
- image: circleci/php:7.1.8-browsers
working_directory: ~/laravel
steps:
- checkout
- run: composer self-update
- run: composer install -n --ignore-platform-reqs

- run:
name: Start Chrome Driver
command: ./vendor/laravel/dusk/bin/chromedriver-linux
background: true

- run:
name: Run Laravel Server
command: php -S localhost:8888 -t tests/
background: true

- run:
name: Run Laravel Dusk Tests
command: vendor/bin/phpunit
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# laravel-dusk-select2
Select2.js support for the Laravel Dusk testing
<br>
<p align="center">
<img height="80" src="./logo.png"> <br><br>
<a href="https://circleci.com/gh/roquie/laravel-dusk-select2/tree/master">
<img src="https://circleci.com/gh/roquie/laravel-dusk-select2/tree/master.svg?style=svg">
</a>
<a href="https://packagist.org/packages/roquie/laravel-dusk-select2">
<img src="https://poser.pugx.org/roquie/laravel-dusk-select2/v/stable">
</a>
<a href="https://packagist.org/packages/roquie/laravel-dusk-select2">
<img src="https://poser.pugx.org/roquie/laravel-dusk-select2/downloads">
</a>
<a href="https://packagist.org/packages/roquie/laravel-dusk-select2">
<img src="https://poser.pugx.org/roquie/laravel-dusk-select2/license">
</a>
<a href="https://packagist.org/packages/roquie/laravel-dusk-select2">
<img src="https://poser.pugx.org/roquie/laravel-dusk-select2/composerlock">
</a>
</p>

# Introduction

Select2.js support for the Laravel Dusk testing.

## Demo

<p align="center">
<img height="350" src="./demo.gif">
Expand All @@ -24,7 +47,7 @@ For default select2:
$browse->select2('@selector');
```

`@selector` class name of your `<select>` html tag. <br>
`@selector` class name of your `<select>` html tag. <br><br>
If value not passed, it be selected automatically.

Another way, if need concrete value:
Expand All @@ -47,14 +70,14 @@ $browse->select2('@selector', ['foo', 'bar'], 5);
* [x] Add Laravel Dusk tests for Laravel Dusk extend feature ;)
* [x] Add gif demonstration how it works.
* [x] May be use `+ select2` out of the box?.
* [ ] Travis CI.
* [x] Integration with Circle CI.

## Tests

[@taylorotwell](https://github.com/taylorotwell) don't kill the kittens, Laravel Dusk also should be used outside of framework.
[@taylorotwell](https://github.com/taylorotwell) don't kill the kittens, Laravel Dusk also should be used outside of the framework.

* `cd tests`
* `php -S localhost:8081 tests/index.html`
* `php -S localhost:8888 tests/index.html`
* `vendor/bin/phpunit`

If u using MacOS, before running `phpunit`, run `vendor/laravel/dusk/bin/chromedriver-mac`.
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
11 changes: 9 additions & 2 deletions tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ public function setUp()
{
parent::setUp();

Browser::$baseUrl = 'http://localhost:8081';
Browser::$baseUrl = 'http://localhost:8888';
Browser::$storeScreenshotsAt = __DIR__ . '/Browser/screenshots';
Browser::$storeConsoleLogAt = __DIR__ . '/Browser/console';
}

public static function prepare()
{
if (env('DUSK_START_CHROMEDRIVER', true)) {
static::startChromeDriver();
}
}

/**
* Create the RemoteWebDriver instance.
*
Expand All @@ -31,7 +38,7 @@ public function setUp()
protected function driver()
{
return RemoteWebDriver::create(
'http://localhost:9515', DesiredCapabilities::safari()
'http://localhost:9515', DesiredCapabilities::chrome()
);
}
}

0 comments on commit 7a7df1a

Please sign in to comment.