I'm trying to set up a new testing structure for a somehwat-legacy PHP and JavaScript application using Codeception 1.8 and Selenium. In case anyone doesn't know Codeception (http://codeception.com/), it has a few options for running tests which include a built in PHP browser, but basically is an enhanced version of PHPUnit. It has suites for running unit, functional and acceptance tests.
I followed the instructions in the "Quick Start" (http://codeception.com/quickstart), and hurray, the PHP Browser successfully ran a super simple acceptance test. The issue I'm having is when I try to change the YAML file which configured how these tests are run - I want to stop using the PHPBrowser, and switch to Selenium so I can write end to end style tests involving the DOM and JS.
At first, I had issues getting the chromedriver to work - I never did, actually, and I cannot upgrade my Codeception version because the code base I'm working with is hard set in PHP Version: 5.3.29. However, I found out that a separate server here has PhantomJS installed.
This is significant because I don't have access to sudo install on either the machine I run the selenium JAR on (fileserver 1), nor the machine with PhantomJS installed (webserver 1). So I can't install the firefox driver or another webdriver myself.
My question is: Is there a way to run my Selenium tests using the WebDriver while it's hosted on another machine? Is there a way to use a WebDriver on a remote machine to let Selenium run, or do the WebDriver and Selenium JAR have to be on the same machine?
As one more additional note, both of the servers are on the same primary domain -- they are fileserver1.domain.com
and webserver1.domain.com
(both fake URLs, obviously).
Here are my YAML config files for my codeception setup:
codeception main YAML
paths:
tests: tests
log: tests/_log
data: tests/_data
helpers: tests/_helpers
settings:
bootstrap: _bootstrap.php
suite_class: \PHPUnit_Framework_TestSuite
colors: true
memory_limit: 1024M
log: true
modules:
config:
Db:
dsn: ''
user: ''
password: ''
dump: tests/_data/dump.sql
acceptance tests YAML
# Codeception Test Suite Configuration
class_name: WebGuy
modules:
enabled:
# - PhpBrowser
# - Selenium2
- WebDriver
- WebHelper
config:
WebDriver:
url: 'https://.../login_logout.php?superuser'
browser: chrome
window_size: 1024x768
# PhpBrowser:
# url: 'https://.../login_logout.php?superuser'
Any help is greatly appreciated!