Skip to content

Commit 95c4264

Browse files
authored
Merge pull request #11 from w3bdesign/dev
Setup CircleCI
2 parents ab06994 + 6dc92df commit 95c4264

File tree

4 files changed

+76
-3
lines changed

4 files changed

+76
-3
lines changed

.circleci/config.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# PHP CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-php/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# Specify the version you desire here
10+
- image: circleci/php:7.4-node-browsers
11+
12+
steps:
13+
- checkout
14+
15+
- run:
16+
name: "Prepare Environment"
17+
command: |
18+
sudo apt update
19+
sudo docker-php-ext-install zip
20+
21+
- run:
22+
name: "Create Environment file"
23+
command: |
24+
mv .env.testing .env
25+
26+
# Download and cache dependencies
27+
- restore_cache:
28+
keys:
29+
# "composer.lock" can be used if it is committed to the repo
30+
- v1-dependencies-{{ checksum "composer.json" }}
31+
# fallback to using the latest cache if no exact match is found
32+
- v1-dependencies-
33+
34+
- run:
35+
name: "Install Dependencies"
36+
command: composer install -n --prefer-dist
37+
38+
- save_cache:
39+
key: v1-dependencies-{{ checksum "composer.json" }}
40+
paths:
41+
- ./vendor
42+
43+
- run:
44+
name: "Generate App key"
45+
command: php artisan key:generate
46+
47+
# run tests with phpunit
48+
- run:
49+
name: "Run Unit Tests"
50+
command: ./vendor/bin/phpunit tests/Unit

tests/Browser/BuyProductTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Tests\Browser;
4+
5+
use Illuminate\Foundation\Testing\DatabaseMigrations;
6+
use Laravel\Dusk\Browser;
7+
use Tests\DuskTestCase;
8+
9+
class BuyProductTest extends DuskTestCase
10+
{
11+
/**
12+
* A Dusk test example.
13+
*
14+
* @return void
15+
*/
16+
public function testExample()
17+
{
18+
$this->browse(function (Browser $browser) {
19+
$browser->visit('http://127.0.0.1:8000')
20+
->assertSee('Vue');
21+
});
22+
}
23+
}

tests/Browser/ExampleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class ExampleTest extends DuskTestCase
1616
public function testBasicExample()
1717
{
1818
$this->browse(function (Browser $browser) {
19-
$browser->visit('/')
20-
->assertSee('Laravel');
19+
$browser->visit('http://127.0.0.1:8000')
20+
->assertSee('Vue');
2121
});
2222
}
2323
}

tests/DuskTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function driver()
3333
{
3434
$options = (new ChromeOptions)->addArguments([
3535
'--disable-gpu',
36-
'--headless',
36+
// '--headless',
3737
'--window-size=1920,1080',
3838
]);
3939

0 commit comments

Comments
 (0)