Dusk: How to make fullscreen browser

Created on 19 Jun 2017  路  3Comments  路  Source: laravel/dusk

Hai, i have a question : How to make browser in fullscreen mode when run a testing ?
i am using $browser->keys('#gs_group', ['{F11}']). But not working
Thank u..

Most helpful comment

@Nguonchhay Update DuskTestCase and set the window size, this should be ok?
I've tried "--start-maximized" but doesn't seem to do what I had hoped.
At least I don't need to do $browser->resize(1920,1080) everywhere which is the main thing.

    /**
     * Create the RemoteWebDriver instance.
     *
     * @return \Facebook\WebDriver\Remote\RemoteWebDriver
     */
    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu',
            '--headless',
            '--window-size=1920,1080'
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )
        );
    }

All 3 comments

i try this
$browser->maximize()

i want make it fullscreen not only maximize

Hi @muswanto ,

I want to set the maximize as default. If follow your above code, I need to set every tests.

@Nguonchhay Update DuskTestCase and set the window size, this should be ok?
I've tried "--start-maximized" but doesn't seem to do what I had hoped.
At least I don't need to do $browser->resize(1920,1080) everywhere which is the main thing.

    /**
     * Create the RemoteWebDriver instance.
     *
     * @return \Facebook\WebDriver\Remote\RemoteWebDriver
     */
    protected function driver()
    {
        $options = (new ChromeOptions)->addArguments([
            '--disable-gpu',
            '--headless',
            '--window-size=1920,1080'
        ]);

        return RemoteWebDriver::create(
            'http://localhost:9515',
            DesiredCapabilities::chrome()->setCapability(
                ChromeOptions::CAPABILITY,
                $options
            )
        );
    }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

antonioribeiro picture antonioribeiro  路  5Comments

dmitryuk picture dmitryuk  路  4Comments

guirociozanini picture guirociozanini  路  6Comments

jaonoctus picture jaonoctus  路  6Comments

ahtinurme picture ahtinurme  路  6Comments