Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
build:
docker:
# Specify the version you desire here
- image: circleci/php:7.4-node-browsers

steps:
- checkout

- run:
name: "Prepare Environment"
command: |
sudo apt update
sudo docker-php-ext-install zip

- run:
name: "Create Environment file"
command: |
mv .env.testing .env

# Download and cache dependencies
- restore_cache:
keys:
# "composer.lock" can be used if it is committed to the repo
- v1-dependencies-{{ checksum "composer.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: "Install Dependencies"
command: composer install -n --prefer-dist

- save_cache:
key: v1-dependencies-{{ checksum "composer.json" }}
paths:
- ./vendor

- run:
name: "Generate App key"
command: php artisan key:generate

# run tests with phpunit
- run:
name: "Run Unit Tests"
command: ./vendor/bin/phpunit tests/Unit
23 changes: 23 additions & 0 deletions tests/Browser/BuyProductTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Tests\Browser;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

class BuyProductTest extends DuskTestCase
{
/**
* A Dusk test example.
*
* @return void
*/
public function testExample()
{
$this->browse(function (Browser $browser) {
$browser->visit('http://127.0.0.1:8000')
->assertSee('Vue');
});
}
}
4 changes: 2 additions & 2 deletions tests/Browser/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ExampleTest extends DuskTestCase
public function testBasicExample()
{
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Laravel');
$browser->visit('http://127.0.0.1:8000')
->assertSee('Vue');
});
}
}
2 changes: 1 addition & 1 deletion tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function driver()
{
$options = (new ChromeOptions)->addArguments([
'--disable-gpu',
'--headless',
// '--headless',
'--window-size=1920,1080',
]);

Expand Down