diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bec386e57..95a036bd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,9 +16,7 @@ jobs: image: mysql:5.7 env: MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: bagisto_testing - MYSQL_USER: bagisto - MYSQL_PASSWORD: secret + MYSQL_DATABASE: bagisto ports: - 3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 @@ -42,11 +40,12 @@ jobs: run: | cp .env.example .env.testing set -e + sed -i "s|^\(APP_ENV=\s*\).*$|\1testing|" .env.testing sed -i "s|^\(DB_HOST=\s*\).*$|\1127.0.0.1|" .env.testing sed -i "s|^\(DB_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing - sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto_testing|" .env.testing - sed -i "s|^\(DB_USERNAME=\s*\).*$|\1bagisto|" .env.testing - sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1secret|" .env.testing + sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto|" .env.testing + sed -i "s|^\(DB_USERNAME=\s*\).*$|\1root|" .env.testing + sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1root|" .env.testing - name: Key Generate run: set -e && php artisan key:generate --env=testing diff --git a/composer.json b/composer.json index 5e979daa5..b7bd7aaaf 100644 --- a/composer.json +++ b/composer.json @@ -139,14 +139,16 @@ "@php artisan migrate:fresh --env=testing", "vendor/bin/codecept run unit", "vendor/bin/codecept run functional", - "vendor/bin/codecept run trigger" + "vendor/bin/codecept run trigger", + "vendor/bin/codecept run api" ], "test-win": [ "@set -e", "@php artisan migrate:fresh --env=testing", "vendor\\bin\\codecept.bat run unit", "vendor\\bin\\codecept.bat run functional", - "vendor\\bin\\codecept.bat run trigger" + "vendor\\bin\\codecept.bat run trigger", + "vendor\\bin\\codecept.bat run api" ] }, "config": { diff --git a/tests/api/V1/Shop/Customer/AuthCest.php b/tests/api/V1/Shop/Customer/AuthCest.php index 5ec9a635f..3c62dd902 100644 --- a/tests/api/V1/Shop/Customer/AuthCest.php +++ b/tests/api/V1/Shop/Customer/AuthCest.php @@ -29,7 +29,7 @@ class AuthCest extends CustomerCest $I->haveAllNecessaryHeaders(); - $I->sendPost($this->getVersionRoute('customer/login'), [ + $I->sendPost($this->getVersionRoute('customer/login?accept_token=true'), [ 'email' => $customer->email, 'password' => json_decode($customer->notes)->plain_password, 'device_name' => $I->fake()->company, diff --git a/tests/api/V1/Shop/Customer/CheckoutCest.php b/tests/api/V1/Shop/Customer/CheckoutCest.php index 0a1bf357a..acbc4493e 100644 --- a/tests/api/V1/Shop/Customer/CheckoutCest.php +++ b/tests/api/V1/Shop/Customer/CheckoutCest.php @@ -65,8 +65,6 @@ class CheckoutCest extends CustomerCest private function saveShippingMethod(ApiTester $I) { - $I->haveHttpHeader('X-CSRF-TOKEN', csrf_token()); - $I->sendPost($this->getVersionRoute('customer/checkout/save-shipping'), [ 'shipping_method' => 'flatrate_flatrate', ]); @@ -76,8 +74,6 @@ class CheckoutCest extends CustomerCest private function savePaymentMethod(ApiTester $I) { - $I->haveHttpHeader('X-CSRF-TOKEN', csrf_token()); - $I->sendPost($this->getVersionRoute('customer/checkout/save-payment'), [ 'payment' => [ 'method' => 'cashondelivery', @@ -89,8 +85,6 @@ class CheckoutCest extends CustomerCest private function saveOrder(ApiTester $I) { - $I->haveHttpHeader('X-CSRF-TOKEN', csrf_token()); - $I->sendPost($this->getVersionRoute('customer/checkout/save-order')); $I->seeAllNecessarySuccessResponse();