phantomjslaravel-5.1codeception

WebDriver: Current url is blank, no page was opened


We are trying to add testing as part of update deployment on our live site. The tests ran fine the last time we worked on them which was a week back but now all of them throw that error. We have tried to figure it out but haven't found anything worthwhile.

Update 1: We have found that the functionality breaks due to a package getting updated. Here is the list of updated packages;

barryvdh/laravel-debugbar             2.0.6 -> 2.1.1
barryvdh/laravel-ide-helper           2.1.0 -> 2.1.2
codeception/codeception               2.1.4 -> 2.1.5
doctrine/cache                        1.5.2 -> 1.6.0
laravel/framework                     5.1.26 -> 5.1.28
league/flysystem                      1.0.15 -> 1.0.16
maximebf/debugbar                     1.10.5 -> 1.11.0
phpspec/phpspec                       2.4.0 -> 2.4.1
phpunit/phpunit                       4.8.20 -> 4.8.21
symfony/browser-kit                   2.8.0 -> 2.8.1
symfony/class-loader                  2.8.0 -> 2.8.1
symfony/console                       2.7.7 -> 2.7.8 
symfony/css-selector                  2.7.7 -> 2.7.8 
symfony/debug                         2.7.7 -> 2.7.8 
symfony/dom-crawler                   2.7.7 -> 2.7.8 
symfony/event-dispatcher              2.8.0 -> 2.8.1
symfony/finder                        2.7.7 -> 2.7.8 
symfony/http-foundation               2.7.7 -> 2.7.8 
symfony/http-kernel                   2.7.7 -> 2.7.8 
symfony/polyfill-php56                1.0.0 -> 1.0.1
symfony/polyfill-util                 1.0.0 -> 1.0.1
symfony/process                       2.7.7 -> 2.7.8 
symfony/routing                       2.7.7 -> 2.7.8 
symfony/translation                   2.7.7 -> 2.7.8 
symfony/var-dumper                    2.7.7 -> 2.7.8 
symfony/yaml                          2.8.0 -> 3.0.1

Update 2: We have tried downgrading laravel and codeception but to no avail. It is strange as the machines which have been updated once will always throw that error even if they are downgraded till codeception 2.1.0. While the machine which passed all tests was on codeception 2.1.4 and webdriver 1.1.0.

Update 3: Installed selenium just to check and it works so maybe its phantomJS / ghost-driver which has conflict.

Example Test

public function test(AcceptanceTester $I) 
{
    $I->amOnUrl('http://swaggable.com');
    $I->canSeeCurrentUrlEquals('/');
}

Example Output

Failed to check correct credentials in _001PlatformSignupCest::checkCorrectCredentials (tests\acceptance\_001PlatformSIgnupCest.php)


  [ModuleException] WebDriver: Current url is blank, no page was opened


Scenario Steps:

 3. $I->canSeeCurrentUrlEquals("/signup")
 2. $I->amOnUrl("http://platform.work.com/signup")
 1. $I->resizeWindow(1280,720)

Acceptance Configuration:

modules:
    enabled:
        - Asserts
        - WebDriver:
            url: http://platform.work.com
            browser: firefox
            http_proxy: direct
        - \Helper\Acceptance

Setup:

Composer

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "barryvdh/laravel-ide-helper": "^2.0",
    "sboo/multiauth": "4.0.*",
    "dingo/api": "0.10.*",
    "doctrine/dbal": "2.3.*",
    "rtconner/laravel-kint": "~2.0",
    "factual/factual-php-driver": "dev-master",
    "weblee/mandrill": "dev-master",
    "barryvdh/laravel-debugbar": "^2.0",
    "laravel/envoy": "~1.0",
    "jeremeamia/superclosure": "~2.0",
    "illuminate/html": "~5.0",
    "predis/predis": "^1.0",
    "guzzlehttp/guzzle": "~5.3|~6.0",
    "laravelcollective/html": "5.1.*",
    "exeu/apai-io": "dev-master",
    "codeception/codeception": "*"
},
"require-dev": {
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1",
    "fzaninotto/faker": "~1.0"
},

Solution

  • Hello I have the same issue.

    I have downgraded the phantomjs to the 1.9.7 version

       ...
        "jonnyw/php-phantomjs": "3.*",
        "site5/phantoman": "^1.0"
      },
      "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
      },
      "autoload": {
        "classmap": [
          "database"
        ],
        "psr-4": {
          "App\\": "app/"
        }
      },
      "autoload-dev": {
        "classmap": [
          "tests/TestCase.php"
        ]
      },
      "scripts": {
        "post-install-cmd": [
          "php artisan clear-compiled",
          "PhantomInstaller\\Installer::installPhantomJS",
          "php artisan optimize"
        ],
        "post-update-cmd": [
          "php artisan clear-compiled",
          "PhantomInstaller\\Installer::installPhantomJS",
          "php artisan optimize"
        ],
        "post-create-project-cmd": [
          "php -r \"copy('.env.example', '.env');\"",
          "php artisan key:generate"
        ]
      },
      "config": {
        "preferred-install": "dist",
        "bin-dir": "bin"
      }
    }
    

    And it working now, but I know is a workaround