-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
maibaba
committed
Nov 30, 2022
1 parent
71c81d3
commit aa604c7
Showing
14 changed files
with
405 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Laravel | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
DB_USERNAME: sail | ||
DB_PASSWORD: password | ||
MAIL_FROM_ADDRESS: [email protected] | ||
|
||
jobs: | ||
phpunit: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql.test: | ||
image: 'mysql/mysql-server:8.0' | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_DATABASE: 'example_app' | ||
MYSQL_USER: ${{ env.DB_USERNAME }} | ||
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }} | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 1 | ||
options: >- | ||
--health-cmd "mysqladmin ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
tools: composer:v2 | ||
- name: Copy .env | ||
run: cp .env.example .env.testing | ||
- name: Install Dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Generate key | ||
run: php artisan key:generate --env testing | ||
- name: Set hostname | ||
run: sudo echo "127.0.0.1 mysql.test" | sudo tee -a /etc/hosts | ||
- name: Execute tests (Unit and Feature tests) via PHPUnit | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,5 +128,6 @@ | |
</div> | ||
</div> | ||
</div> | ||
Hello! | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Laravel\Dusk\Browser; | ||
use Tests\DuskTestCase; | ||
|
||
class ExampleTest extends DuskTestCase | ||
{ | ||
/** | ||
* A basic browser test example. | ||
* | ||
* @return void | ||
*/ | ||
public function testBasicExample() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->visit('/') | ||
->assertSee('Laravel') | ||
->assertSee('Hello!'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Pages; | ||
|
||
use Laravel\Dusk\Browser; | ||
|
||
class HomePage extends Page | ||
{ | ||
/** | ||
* Get the URL for the page. | ||
* | ||
* @return string | ||
*/ | ||
public function url() | ||
{ | ||
return '/'; | ||
} | ||
|
||
/** | ||
* Assert that the browser is on the page. | ||
* | ||
* @param \Laravel\Dusk\Browser $browser | ||
* @return void | ||
*/ | ||
public function assert(Browser $browser) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the element shortcuts for the page. | ||
* | ||
* @return array | ||
*/ | ||
public function elements() | ||
{ | ||
return [ | ||
'@element' => '#selector', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Tests\Browser\Pages; | ||
|
||
use Laravel\Dusk\Page as BasePage; | ||
|
||
abstract class Page extends BasePage | ||
{ | ||
/** | ||
* Get the global element shortcuts for the site. | ||
* | ||
* @return array | ||
*/ | ||
public static function siteElements() | ||
{ | ||
return [ | ||
'@element' => '#selector', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
Oops, something went wrong.