From 99bc1505e06a7d896034550a502ef2da07f3ac9d Mon Sep 17 00:00:00 2001 From: Prashant Singh Date: Sat, 12 Jan 2019 13:56:38 +0530 Subject: [PATCH] Wrote some minor tests for functional testing --- tests/Feature/ExampleTest.php | 21 ----------- tests/Feature/LoginTest.php | 67 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 21 deletions(-) delete mode 100755 tests/Feature/ExampleTest.php create mode 100644 tests/Feature/LoginTest.php diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php deleted file mode 100755 index f31e495ca..000000000 --- a/tests/Feature/ExampleTest.php +++ /dev/null @@ -1,21 +0,0 @@ -get('/'); - - $response->assertStatus(200); - } -} diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php new file mode 100644 index 000000000..5adf1a910 --- /dev/null +++ b/tests/Feature/LoginTest.php @@ -0,0 +1,67 @@ + 'http://127.0.0.1:8000']); + + $response = $this->get('/'); + + $response->assertStatus(200); + } + + public function testCustomerLoginPage() + { + config(['app.url' => 'http://127.0.0.1:8000']); + + $response = $this->get('/customer/login'); + + $response->assertStatus(200); + } + + public function testCategoriesPage() + { + $categoryUrlSlug = 'marvel-figurines'; + + config(['app.url' => 'http://127.0.0.1:8000']); + + $response = $this->get("/categories/{$categoryUrlSlug}"); + + $response->assertStatus(200); + } + + public function testCustomerRegistrationPage() + { + config(['app.url' => 'http://127.0.0.1:8000']); + + $response = $this->get("/customer/register"); + + $response->assertStatus(200); + } + + public function testCartPage() + { + config(['app.url' => 'http://127.0.0.1:8000']); + + $response = $this->get("/checkout/cart"); + + $response->assertStatus(200); + } +}