From 3fe81527586e34eb33f6f3bc3122653b3412f2f2 Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Fri, 12 Apr 2019 18:20:33 +0530 Subject: [PATCH] added php tooltip.js dependency and laravel dusk for browser tests profiling --- composer.json | 1 + packages/Webkul/Ui/package.json | 1 + tests/Browser/ExampleTest.php | 23 +++++++++++++ tests/Browser/Pages/HomePage.php | 41 ++++++++++++++++++++++++ tests/Browser/Pages/Page.php | 20 ++++++++++++ tests/Browser/console/.gitignore | 2 ++ tests/Browser/screenshots/.gitignore | 2 ++ tests/DuskTestCase.php | 48 ++++++++++++++++++++++++++++ 8 files changed, 138 insertions(+) create mode 100644 tests/Browser/ExampleTest.php create mode 100644 tests/Browser/Pages/HomePage.php create mode 100644 tests/Browser/Pages/Page.php create mode 100644 tests/Browser/console/.gitignore create mode 100644 tests/Browser/screenshots/.gitignore create mode 100644 tests/DuskTestCase.php diff --git a/composer.json b/composer.json index aace66d41..684fd4891 100755 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "barryvdh/laravel-debugbar": "^3.1", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", + "laravel/dusk": "^4.0", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" diff --git a/packages/Webkul/Ui/package.json b/packages/Webkul/Ui/package.json index c95dc4ae9..8641ce6db 100755 --- a/packages/Webkul/Ui/package.json +++ b/packages/Webkul/Ui/package.json @@ -19,6 +19,7 @@ "flatpickr": "^4.4.6" }, "dependencies": { + "tooltip.js": "^1.3.1", "vue-swatches": "^1.0.3" } } diff --git a/tests/Browser/ExampleTest.php b/tests/Browser/ExampleTest.php new file mode 100644 index 000000000..2c80ac76c --- /dev/null +++ b/tests/Browser/ExampleTest.php @@ -0,0 +1,23 @@ +browse(function (Browser $browser) { + $browser->visit('/customer/login') + ->assertSee('login'); + }); + } +} diff --git a/tests/Browser/Pages/HomePage.php b/tests/Browser/Pages/HomePage.php new file mode 100644 index 000000000..4f5a87f4c --- /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 000000000..f8d76222c --- /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 000000000..d6b7ef32c --- /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 000000000..d6b7ef32c --- /dev/null +++ b/tests/Browser/screenshots/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php new file mode 100644 index 000000000..321941f5d --- /dev/null +++ b/tests/DuskTestCase.php @@ -0,0 +1,48 @@ +addArguments([ + '--disable-gpu', + '--headless', + '--no-sandbox' + ]); + + return RemoteWebDriver::create( + 'http://localhost:9515/', DesiredCapabilities::chrome() + ); + + // return RemoteWebDriver::create( + // 'http://localhost:9515', DesiredCapabilities::chrome()->setCapability( + // ChromeOptions::CAPABILITY, $options + // ) + // ); + } +}