diff --git a/ phpunit.dusk.xml b/ phpunit.dusk.xml new file mode 100644 index 00000000..40848a84 --- /dev/null +++ b/ phpunit.dusk.xml @@ -0,0 +1,4 @@ + + + + diff --git a/composer.json b/composer.json index 32f52d83..32305073 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "require": { "php": "^7.2.5", "ext-fileinfo": "*", - "ext-json": "^1.6", + "ext-json": "*", "ext-zip": "*", "barryvdh/laravel-dompdf": "^0.9.0", "carlos-meneses/laravel-mpdf": "^2.1", @@ -31,6 +31,7 @@ "require-dev": { "facade/ignition": "^2.0", "fzaninotto/faker": "^1.9.1", + "laravel/dusk": "^6.23", "mockery/mockery": "^1.3.1", "nunomaduro/collision": "^4.1", "phpunit/phpunit": "^8.5" diff --git a/resources/assets/vue/components/accounts/forms/LoginFormComponent.vue b/resources/assets/vue/components/accounts/forms/LoginFormComponent.vue index ed097c68..5ddfdadb 100644 --- a/resources/assets/vue/components/accounts/forms/LoginFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/LoginFormComponent.vue @@ -7,13 +7,13 @@
- +
- +
@@ -21,7 +21,7 @@

Forgot password?

-
Sign In
+
Sign In
@@ -55,4 +55,4 @@ mixins: [loginFormValidation] } - \ No newline at end of file + diff --git a/tests/Browser/CreateBooking.php b/tests/Browser/CreateBooking.php new file mode 100644 index 00000000..e7391624 --- /dev/null +++ b/tests/Browser/CreateBooking.php @@ -0,0 +1,23 @@ +browse(function (Browser $browser) { + $browser->visit('/') + ->assertSee('Laravel'); + }); + } +} diff --git a/tests/Browser/ExampleTest.php b/tests/Browser/ExampleTest.php new file mode 100644 index 00000000..37f076bd --- /dev/null +++ b/tests/Browser/ExampleTest.php @@ -0,0 +1,28 @@ +browse(function (Browser $browser) { + $browser->visit('http://localhost:86') + ->pause(500) + ->type('email', 'junkit.mah@bioloop.com.my') + ->type('password', '123456abcabc') + ->click('#sign-in') + ->pause(5000) + ->assertPathIs('/dashboard'); + }); + } +} diff --git a/tests/Browser/Pages/HomePage.php b/tests/Browser/Pages/HomePage.php new file mode 100644 index 00000000..26bf174f --- /dev/null +++ b/tests/Browser/Pages/HomePage.php @@ -0,0 +1,41 @@ + '#selector', + ]; + } +} diff --git a/tests/Browser/Pages/Page.php b/tests/Browser/Pages/Page.php new file mode 100644 index 00000000..f8d76222 --- /dev/null +++ b/tests/Browser/Pages/Page.php @@ -0,0 +1,20 @@ + '#selector', + ]; + } +} diff --git a/tests/Browser/console/.gitignore b/tests/Browser/console/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/tests/Browser/console/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/Browser/screenshots/.gitignore b/tests/Browser/screenshots/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/tests/Browser/screenshots/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/Browser/source/.gitignore b/tests/Browser/source/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/tests/Browser/source/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php new file mode 100644 index 00000000..2aabaad9 --- /dev/null +++ b/tests/DuskTestCase.php @@ -0,0 +1,59 @@ +addArguments([ + '--no-sandbox' + ]); + + + return RemoteWebDriver::create( + //'http://localhost:86', + 'http://localhost:9515', + DesiredCapabilities::chrome()->setCapability( + ChromeOptions::CAPABILITY, $options + ) + ); + } + + /** + * Determine whether the Dusk command has disabled headless mode. + * + * @return bool + */ + protected function hasHeadlessDisabled() + { + return true; + //isset($_SERVER['DUSK_HEADLESS_DISABLED']) || + //isset($_ENV['DUSK_HEADLESS_DISABLED']); + } +}