Modelizer / Laravel-Selenium

Selenium Testing for Laravel 5
MIT License
108 stars 33 forks source link

issue with creating cookies on chrome driver #38

Closed InteNs closed 7 years ago

InteNs commented 7 years ago

hey, i've created an empty laravel project with laravel-selenium and when i try to run my tests

php vendor/bin/phpunit --coverage-clover build/logs/clover.xml

I get this:

PHPUnit 5.7.11 by Sebastian Bergmann and contributors.

..01:00:50.763 INFO - Executing: [new session: Capabilities [{browserName=chrome}]])
01:00:50.764 INFO - Creating a new session for Capabilities [{browserName=chrome}]
Starting ChromeDriver 2.24.417412 (ac882d3ce7c0d99292439bf3405780058fcca0a6) on port 47295
Only local connections are allowed.
01:00:52.230 INFO - Done: [new session: Capabilities [{browserName=chrome}]]
01:00:52.243 INFO - Executing: [get current url])
01:00:52.249 INFO - Done: [get current url]
01:00:52.252 INFO - Executing: [add cookie: PHPUNIT_SELENIUM_TEST_ID=SeleniumExampleTest__testExample; path=/])
01:00:52.264 WARN - Exception thrown
org.openqa.selenium.WebDriverException: <unknown>: Failed to set the 'cookie' property on 'Document': Cookies are disabled inside 'data:' URLs.
  (Session info: chrome=56.0.2924.87)
  (Driver info: chromedriver=2.24.417412 (ac882d3ce7c0d99292439bf3405780058fcca0a6),platform=Mac OS X 10.12.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 7 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'INTENS-MBP.thuis.net', ip: '192.168.178.103', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.3', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417412 (ac882d3ce7c0d99292439bf3405780058fcca0a6), userDataDir=/var/folders/4t/dz5rc8md2wvc73w5gnq8xwt80000gn/T/.org.chromium.Chromium.aMt5UL}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=56.0.2924.87, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 87959f3ace1ea64d3c754b182f13bf03

any idea about whats happening? seems like it's setting a cookie before doing anything

here's my test:

<?php

use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Modelizer\Selenium\SeleniumTestCase;

class SeleniumExampleTest extends SeleniumTestCase
{
    /**
     * A basic test example.
     *
     * @return void
     */
    public function testExample()
    {
        $this->visit('www.google.com/');
    }
}
Modelizer commented 7 years ago

the issue occurs when we put COVERAGE LOGS as one of our reports logs. If we uncomment the COVERAGE code lines our test run smoothly on Chrome Browser.

For more details you can check out https://bugs.chromium.org/p/chromedriver/issues/detail?id=728