Serenity-core: Error with serenity.browser.maximized property

Created on 22 Aug 2017  路  11Comments  路  Source: serenity-bdd/serenity-core

If I set to true the serenity.browser.maximized property the browser doesn't maximize, it gets a really small size.

image

Most helpful comment

serenity.browser.maximized = true

All 11 comments

I'm not seeing that here. What version of Serenity and chromedriver are you using?

I'm using the last version of chrome and firefox (it also happens in firefox), This happens with the screenplay todo app example, last version of serenity.

What version of chromedriver are you using? Can you share your serenity.properties file?

Chrome: Version 60.0.3112.101
Firefox: Version 55.0.2
Serenity Version 1.5.4-rc.2

serenity.properties.txt

What about the chromedriver binary (not the browser)? (the maximise instruction simply sends the driver, as shown here:

class MaximizeRedimensioner implements Redimensioner {

    @Override
    public void redimension(WebDriver driver) {
        driver.manage().window().maximize();
    }
}

so I suspect a driver issue. Place a breakpoint in this code to see what is going on).

Hi, after checking the bug is in serenity,

enum RedimensionStrategy {
    DoNotRedimension,
    RedimensionToSpecifiedSize,
    Maximize;

    public static RedimensionStrategy strategyFor(WebDriver driver, EnvironmentVariables environmentVariables) {

        RedimensionConfiguration redimensionConfiguration = new RedimensionConfiguration(environmentVariables);

        if (!redimensionConfiguration.supportsScreenResizing(driver)) {
            return DoNotRedimension;
        }

        if (redimensionConfiguration.isBrowserDimensionsSpecified()) {
            return RedimensionToSpecifiedSize;
        }

        if (redimensionConfiguration.isBrowserMaximised()) {
            return RedimensionToSpecifiedSize;
        }

        return DoNotRedimension;
    }
}

when is getting the strategy to maximised the code is returning RedimensionToSpecifiedSize instead of Maximize

Well spotted - would you like to submit a PR?

(I can do it of course but it would deprive you of the credit for all your hard work ;-) ).

sure, I can submit the PR

serenity.browser.maximized = true

Was this page helpful?
0 / 5 - 0 ratings