Skip to content

Commit

Permalink
Configuration mink/selenium.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngodfraind committed Jan 2, 2014
1 parent 7149aa1 commit 234ce02
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ClarolineCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public function suggestConfigurationFor(Bundle $bundle, $environment)
} elseif ($bundle instanceof \Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle) {
return $config;
}

if ($environment === 'test' && $bundle instanceof \Behat\MinkBundle\MinkBundle) {
return $config->addContainerResource($this->buildPath('mink'));
}
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/app/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ imports:
- { resource: config.yml }

parameters:
test.client.class: Claroline\CoreBundle\Library\Testing\TransactionalTestClient
test.client.class: Claroline\CoreBundle\Library\Testing\TransactionalTestClient
5 changes: 5 additions & 0 deletions Resources/config/suggested/mink.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mink:
base_url: http://localhost/vostro/Claroline/web/app_dev.php
browser_name: firefox
default_session: selenium2
selenium2: ~
23 changes: 23 additions & 0 deletions Tests/Integration/LoginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Claroline\CoreBundle\Tests\Integration;

use Behat\MinkBundle\Test\MinkTestCase;

class LoginTest extends MinkTestCase
{
protected $base;

protected function setUp()
{
$this->base = $this->getKernel()->getContainer()->getParameter('mink.base_url');
}

public function testDisplayLoginPage()
{
$session = $this->getMink()->getSession('selenium2');
$session->visit($this->base.'/login');
var_dump($session->getPage()->getContent());
$this->assertTrue($session->getPage()->hasContent('username'));
}
}

0 comments on commit 234ce02

Please sign in to comment.