I access my page at http://web.dev/web/app_behat.php and it works when I do it manually in browser.
So I set
base_url: "http://web.dev/web/app_behat.php/"
and I get no route matched for any route but if i set
base_url: "http://web.dev/app_behat.php/"
route seems to be matched but i get missing table error, i have set up SymfonyDoctrineContext to take care of schema creation.
Full behat.yml:
default:
formatter:
name: progress
context:
class: FootballRadar\Features\Context\FeatureContext
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
env: test
debug: true
Behat\MinkExtension\Extension:
base_url: "http://web.dev/app_behat.php/"
default_session: symfony2
show_cmd: 'open -a "Google Chrome" %s'
EDIT:
My config_behat.yml:
imports:
- { resource: "config_dev.yml" }
assetic:
debug: true
use_controller:
enabled: true
profiler: false
framework:
test: ~
session:
storage_id: session.storage.mock_file
profiler:
collect: false
web_profiler:
toolbar: false
intercept_redirects: false
swiftmailer:
disable_delivery: true
doctrine:
dbal:
connections:
default:
driver: pdo_sqlite
user: behat
path: %kernel.root_dir%/behat/default.db.cache
charset: utf8
model:
driver: pdo_sqlite
user: behat
path: %kernel.root_dir%/behat/model.db.cache
charset: utf8
monolog:
handlers:
test:
type: test
Seems that all of You misunderstood my question and/or completely ignored my first sentence.
I have a working application and I access it using
http://web.dev/web/ (http://web.dev/web/app.php/) <-- for prod
http://web.dev/web/app_dev.php/ <-- for dev
http://web.dev/web/app_behat.php/ <-- for behat
all of them work as when i use them manually in chrome or other browser
That is why I am surprised why http://web.dev/web/app_behat.php/
gives me
No route found for "GET /web/app_behat.php/login"
and
http://web.dev/app_behat.php/
gives
SQLSTATE[HY000]: General error: 1 no such table: users_new
With little debugging I confirmed SymfonyDoctrineContext
does read my entities mappings and issues queries to create db schema, both db files have read/write permissions (for sake of test I gave them 777)
Another thing I just realised, all this errors gets written to test.log
file instead of behat.log
. I create kernel with $kernel = new AppKernel('behat', true);
Maybe I just greatly misunderstood how behat is supposed to work?
EDIT2:
I have noticed that there are no entries made to apache access log when running behat feature for either of the paths
versions i'm using from composer.json
"behat/behat": "2.5.*@dev",
"behat/common-contexts": "1.2.*@dev",
"behat/mink-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-selenium2-driver": "*",
"behat/symfony2-extension": "*",