From d85bcfe2de199c3898031d250fdb8ec1e3af7311 Mon Sep 17 00:00:00 2001 From: glovetleong Date: Wed, 4 May 2022 11:54:56 +0800 Subject: [PATCH] register test --- .env.dusk | 59 +++++++++++++++++++ .../ControllersLogic/CreateCustomerLogic.php | 2 +- config/database.php | 20 +++++++ .../forms/RegistrationFormComponent.vue | 20 +++---- tests/Browser/DryRun/CreateBookingTest.php | 4 +- tests/Browser/DryRun/LoginTe.php | 2 +- .../Browser/DryRun/UserRegisterLoginTest.php | 28 +++++++++ 7 files changed, 121 insertions(+), 14 deletions(-) create mode 100644 .env.dusk create mode 100644 tests/Browser/DryRun/UserRegisterLoginTest.php diff --git a/.env.dusk b/.env.dusk new file mode 100644 index 00000000..4041ae24 --- /dev/null +++ b/.env.dusk @@ -0,0 +1,59 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY=base64:X521H/hWdbsG6S/JG0Q/BZgTo1azoV18kzqkqMQSDrQ= +APP_DEBUG=true +APP_URL=http://localhost + +LOG_CHANNEL=stack + +DB_CONNECTION=dusk +DB_HOST=127.0.0.1 +DB_PORT=3306 +DB_DATABASE=exchange-test +DB_USERNAME=root +DB_PASSWORD= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +FILESYSTEM_DRIVER="documents" + +JWT_SECRET= +JWT_TTL=1440 + +SHIPPING_URL=http://shipping-portal.test/ +MIX_SHIPPING_URL="${SHIPPING_URL}" + +BILLPLZ_BASE_URL="https://www.billplz-sandbox.com" +BILLPLZ_API_KEY="0fa4c710-761b-4a7a-a501-c2c2d02643d5" +BILLPLZ_X_SIGNATURE_KEY="S-pbNVthVRsvnPfZlgLwqqOg" +BILLPLZ_COLLECTION_ID="hev2wdjy" \ No newline at end of file diff --git a/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php b/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php index 3fe7b382..84c995cf 100644 --- a/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php +++ b/app/Classes/Modules/Accounts/ControllersLogic/CreateCustomerLogic.php @@ -100,7 +100,7 @@ class CreateCustomerLogic extends AbstractControllerLogic $this->assignSegmentProcessor->execute($company); - $this->generateEmailVerificationAttemptProcessor->execute($user); + // $this->generateEmailVerificationAttemptProcessor->execute($user); return $this->response($this->authenticationProcessor->execute($request)); diff --git a/config/database.php b/config/database.php index aeabec6f..ac0b718b 100644 --- a/config/database.php +++ b/config/database.php @@ -63,6 +63,26 @@ return [ ]) : [], ], + 'dusk' => [ + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => false, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + 'pgsql' => [ 'driver' => 'pgsql', 'url' => env('DATABASE_URL'), diff --git a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue index 429d0b9a..9f49275e 100644 --- a/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue +++ b/resources/assets/vue/components/accounts/forms/RegistrationFormComponent.vue @@ -33,7 +33,7 @@ viewBox="0 0 172 172" style=" fill:#000000;"> -

Company

+

Company

@@ -43,7 +43,7 @@ width="45" height="45" viewBox="0 0 172 172" style=" fill:#000000;">
-

Personal

+

Personal

@@ -62,7 +62,7 @@
- +
@@ -70,13 +70,13 @@
- +
- +
@@ -95,7 +95,7 @@
- +
@@ -103,13 +103,13 @@
- +
- +
@@ -135,7 +135,7 @@
- +
@@ -156,7 +156,7 @@
- +
diff --git a/tests/Browser/DryRun/CreateBookingTest.php b/tests/Browser/DryRun/CreateBookingTest.php index 98a47da7..75299c22 100644 --- a/tests/Browser/DryRun/CreateBookingTest.php +++ b/tests/Browser/DryRun/CreateBookingTest.php @@ -13,8 +13,8 @@ class CreateBookingTest extends DuskTestCase public function testLogin() { $this->browse(function (Browser $browser) { - $browser->visit('http://localhost:86') - ->pause(500) + $browser->visit('http://exchange-2.0.test') + ->pause(5000) ->typeSlowly('email', 'junkit.mah@bioloop.com.my') ->typeSlowly('password', '123456abcabc') ->click('#sign-in') diff --git a/tests/Browser/DryRun/LoginTe.php b/tests/Browser/DryRun/LoginTe.php index 13ebc523..3694dfde 100644 --- a/tests/Browser/DryRun/LoginTe.php +++ b/tests/Browser/DryRun/LoginTe.php @@ -14,7 +14,7 @@ class LoginTest extends DuskTestCase public function testLogin() { $this->browse(function (Browser $browser) { - $browser->visit('http://localhost:86') + $browser->visit('http://exchange-2.0.test') ->pause(500) ->type('email', 'junkit.mah@bioloop.com.my') ->type('password', '123456abcabc') diff --git a/tests/Browser/DryRun/UserRegisterLoginTest.php b/tests/Browser/DryRun/UserRegisterLoginTest.php new file mode 100644 index 00000000..d288fddd --- /dev/null +++ b/tests/Browser/DryRun/UserRegisterLoginTest.php @@ -0,0 +1,28 @@ +browse(function (Browser $browser) { + $browser->visit('http://exchange-2.0.test/signup') + ->pause(5000) + ->click('#company-select') + ->type('company_name', 'lazada') + ->type('name', 'Someone') + ->type('phone', '0128888888') + ->click('#next') + ->type('email', 'someone@gmail.com') + ->type('password', 'pass123') + ->type('password_confirmation', 'pass123') + ->click('#complete') + ->pause(5000) + ->assertPathIs('/dashboard'); + }); + } +}