diff --git a/app/Controller/Web/Session.php b/app/Controller/Web/Session.php index 342a99f1..dea2b606 100644 --- a/app/Controller/Web/Session.php +++ b/app/Controller/Web/Session.php @@ -32,7 +32,7 @@ public function post() setcookie('userId', $response->getUserId(), time() + (86400 * 30), "/"); setcookie('authToken', $response->getAuthToken(), time() + (86400 * 30), "/"); $app = \Slim\Slim::getInstance('developer'); - $app->redirect("/notes"); + $app->redirect("./notes"); } } catch (\InvalidArgumentException $error) { $response = $error->getMessage(); diff --git a/app/Controller/Web/User.php b/app/Controller/Web/User.php index cfe52dcd..8ccca6ed 100644 --- a/app/Controller/Web/User.php +++ b/app/Controller/Web/User.php @@ -28,7 +28,7 @@ public function post() $response = $userService->create($input); if ($response instanceof UserModel) { $app = \Slim\Slim::getInstance('developer'); - $app->redirect("/login"); + $app->redirect("./login"); } } catch (\InvalidArgumentException $error) { $response = $error->getMessage(); diff --git a/build.xml b/build.xml index c8e1d0e2..4cd89537 100755 --- a/build.xml +++ b/build.xml @@ -1,7 +1,11 @@ - - + + + + ${env.JOB_NAME} + + @@ -16,24 +20,30 @@ - + - + + - + - + + + + + + @@ -57,13 +67,25 @@ - + + + + + + + + + + + + + @@ -178,8 +200,12 @@ - + + + + + - diff --git a/build/phpunit.xml b/build/phpunit.xml index 91f887d8..8ebbf4c9 100755 --- a/build/phpunit.xml +++ b/build/phpunit.xml @@ -4,7 +4,8 @@ bootstrap="../vendor/autoload.php" strict="true" verbose="true" - timeoutForSmallTests="10"> + timeoutForSmallTests="10" + timeoutForLargeTests="50"> ../tests @@ -24,5 +25,9 @@ ../app + + + + diff --git a/build/tools/3EE67F3D0FF405B2.gpg b/build/tools/3EE67F3D0FF405B2.gpg new file mode 100644 index 00000000..a812412f Binary files /dev/null and b/build/tools/3EE67F3D0FF405B2.gpg differ diff --git a/build/tools/selenium-server-standalone-2.45.0.jar b/build/tools/selenium-server-standalone-2.45.0.jar new file mode 100644 index 00000000..020191b7 Binary files /dev/null and b/build/tools/selenium-server-standalone-2.45.0.jar differ diff --git a/tests/AcceptanceTest/LoginTest.php b/tests/AcceptanceTest/LoginTest.php new file mode 100644 index 00000000..6fe1d4bd --- /dev/null +++ b/tests/AcceptanceTest/LoginTest.php @@ -0,0 +1,29 @@ +setHost('localhost'); + $this->setBrowser('firefox'); + $this->setBrowserUrl('http://localhost/'); + } + + /** + * @large + **/ + public function testTitle() + { + $name=getenv("JobName"); + $this->url("$name/public/index.php/login"); + $this->assertEquals('Login', $this->title()); + + $this->byName('email')->value("gau@bhapkar.com"); + $this->byName('password')->value("Gauri@12"); + $this->byCssSelector('form')->submit(); + $welcom=$this->byCssSelector('div'); + $this->assertEquals('Login', $this->title()); + //$this->assertEquals('Html', $welcom); + + } +} diff --git a/tests/AcceptanceTest/googleChromeTest.php b/tests/AcceptanceTest/googleChromeTest.php new file mode 100644 index 00000000..e153b89d --- /dev/null +++ b/tests/AcceptanceTest/googleChromeTest.php @@ -0,0 +1,50 @@ +setHost('localhost'); + $this->setBrowser('google-chrome'); + $this->setBrowserUrl('http://localhost/'); + } + /** + * @large + **/ + public function testHomeTitle() + { + $name=getenv("JobName"); + $this->url("$name/public/index.php/register"); + $this->byName('firstName')->value("jonh"); + $this->byName('lastName')->value("Mock"); + $this->byName('email')->value("jonh@mock.com"); + $this->byName('password')->value("Mock@1234"); + $this->byCssSelector('form')->submit(); + $this->assertEquals('Login', $this->title()); + $this->byName('email')->value("jonh@mock.com"); + $this->byName('password')->value("Mock@1234"); + $this->byCssSelector('form')->submit(); + $this->assertEquals('Notes | Home', $this->title()); + + + + } + /** + * @large + **/ + + public function testLoginTitle() + { + $name=getenv("JobName"); + $this->url("$name/public/index.php/login"); + $this->assertEquals('Login', $this->title()); + + $this->byName('email')->value("gau@bhapkar.com"); + $this->byName('password')->value("Gauri@12"); + $this->byCssSelector('form')->submit(); + $this->assertEquals('Login', $this->title()); + + + } + +} diff --git a/tests/Routes/RoutesTest.php b/tests/Routes/RoutesTest.php index d5fcad4e..fc91ea1d 100644 --- a/tests/Routes/RoutesTest.php +++ b/tests/Routes/RoutesTest.php @@ -58,7 +58,7 @@ public function loginpage_should_be_loaded_after_user_registration() $client->post('/register' ,$parameters); $this->assertEquals(302, $client->response->status()); - $this->assertEquals('/login', $client->response->getIterator()["Location"]); + $this->assertEquals('./login', $client->response->getIterator()["Location"]); } @@ -105,7 +105,7 @@ public function loginpage_should_be_loaded_after_user_logged_in() $client->post('/login', $parameters); $this->assertEquals(302, $client->response->status()); - $this->assertEquals('/notes', $client->response->getIterator()["Location"]); + $this->assertEquals('./notes', $client->response->getIterator()["Location"]); } /**