Test Case Updated
This commit is contained in:
parent
de46709ee4
commit
ae9582db98
|
|
@ -16,9 +16,7 @@ jobs:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
env:
|
env:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
MYSQL_DATABASE: bagisto_testing
|
MYSQL_DATABASE: bagisto
|
||||||
MYSQL_USER: bagisto
|
|
||||||
MYSQL_PASSWORD: secret
|
|
||||||
ports:
|
ports:
|
||||||
- 3306
|
- 3306
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
||||||
|
|
@ -42,11 +40,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cp .env.example .env.testing
|
cp .env.example .env.testing
|
||||||
set -e
|
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_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_PORT=\s*\).*$|\1${{ job.services.mysql.ports['3306'] }}|" .env.testing
|
||||||
sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto_testing|" .env.testing
|
sed -i "s|^\(DB_DATABASE=\s*\).*$|\1bagisto|" .env.testing
|
||||||
sed -i "s|^\(DB_USERNAME=\s*\).*$|\1bagisto|" .env.testing
|
sed -i "s|^\(DB_USERNAME=\s*\).*$|\1root|" .env.testing
|
||||||
sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1secret|" .env.testing
|
sed -i "s|^\(DB_PASSWORD=\s*\).*$|\1root|" .env.testing
|
||||||
|
|
||||||
- name: Key Generate
|
- name: Key Generate
|
||||||
run: set -e && php artisan key:generate --env=testing
|
run: set -e && php artisan key:generate --env=testing
|
||||||
|
|
|
||||||
|
|
@ -139,14 +139,16 @@
|
||||||
"@php artisan migrate:fresh --env=testing",
|
"@php artisan migrate:fresh --env=testing",
|
||||||
"vendor/bin/codecept run unit",
|
"vendor/bin/codecept run unit",
|
||||||
"vendor/bin/codecept run functional",
|
"vendor/bin/codecept run functional",
|
||||||
"vendor/bin/codecept run trigger"
|
"vendor/bin/codecept run trigger",
|
||||||
|
"vendor/bin/codecept run api"
|
||||||
],
|
],
|
||||||
"test-win": [
|
"test-win": [
|
||||||
"@set -e",
|
"@set -e",
|
||||||
"@php artisan migrate:fresh --env=testing",
|
"@php artisan migrate:fresh --env=testing",
|
||||||
"vendor\\bin\\codecept.bat run unit",
|
"vendor\\bin\\codecept.bat run unit",
|
||||||
"vendor\\bin\\codecept.bat run functional",
|
"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": {
|
"config": {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ class AuthCest extends CustomerCest
|
||||||
|
|
||||||
$I->haveAllNecessaryHeaders();
|
$I->haveAllNecessaryHeaders();
|
||||||
|
|
||||||
$I->sendPost($this->getVersionRoute('customer/login'), [
|
$I->sendPost($this->getVersionRoute('customer/login?accept_token=true'), [
|
||||||
'email' => $customer->email,
|
'email' => $customer->email,
|
||||||
'password' => json_decode($customer->notes)->plain_password,
|
'password' => json_decode($customer->notes)->plain_password,
|
||||||
'device_name' => $I->fake()->company,
|
'device_name' => $I->fake()->company,
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,6 @@ class CheckoutCest extends CustomerCest
|
||||||
|
|
||||||
private function saveShippingMethod(ApiTester $I)
|
private function saveShippingMethod(ApiTester $I)
|
||||||
{
|
{
|
||||||
$I->haveHttpHeader('X-CSRF-TOKEN', csrf_token());
|
|
||||||
|
|
||||||
$I->sendPost($this->getVersionRoute('customer/checkout/save-shipping'), [
|
$I->sendPost($this->getVersionRoute('customer/checkout/save-shipping'), [
|
||||||
'shipping_method' => 'flatrate_flatrate',
|
'shipping_method' => 'flatrate_flatrate',
|
||||||
]);
|
]);
|
||||||
|
|
@ -76,8 +74,6 @@ class CheckoutCest extends CustomerCest
|
||||||
|
|
||||||
private function savePaymentMethod(ApiTester $I)
|
private function savePaymentMethod(ApiTester $I)
|
||||||
{
|
{
|
||||||
$I->haveHttpHeader('X-CSRF-TOKEN', csrf_token());
|
|
||||||
|
|
||||||
$I->sendPost($this->getVersionRoute('customer/checkout/save-payment'), [
|
$I->sendPost($this->getVersionRoute('customer/checkout/save-payment'), [
|
||||||
'payment' => [
|
'payment' => [
|
||||||
'method' => 'cashondelivery',
|
'method' => 'cashondelivery',
|
||||||
|
|
@ -89,8 +85,6 @@ class CheckoutCest extends CustomerCest
|
||||||
|
|
||||||
private function saveOrder(ApiTester $I)
|
private function saveOrder(ApiTester $I)
|
||||||
{
|
{
|
||||||
$I->haveHttpHeader('X-CSRF-TOKEN', csrf_token());
|
|
||||||
|
|
||||||
$I->sendPost($this->getVersionRoute('customer/checkout/save-order'));
|
$I->sendPost($this->getVersionRoute('customer/checkout/save-order'));
|
||||||
|
|
||||||
$I->seeAllNecessarySuccessResponse();
|
$I->seeAllNecessarySuccessResponse();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue