Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect resizeToFitDevice on mac with portaitOrientation=true #816

Closed
kirovboris opened this issue Sep 19, 2016 · 5 comments
Closed

Incorrect resizeToFitDevice on mac with portaitOrientation=true #816

kirovboris opened this issue Sep 19, 2016 · 5 comments
Assignees
Labels
BROWSER: Chrome BROWSER: Firefox OS: Mac STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@kirovboris
Copy link
Collaborator

fixture('React').page('https://facebook.github.io/react/');

test('Resize to fit device', async t => {
    await t.resizeWindowToFitDevice('Nexus 7 (2013)', { portraitOrientation: true });

    const getWindowHeight = ClientFunction(() => window.innerHeight);
    const getWindowWidth  = ClientFunction(() => window.innerWidth);

    expect(await getWindowHeight()).eql(960);
    expect(await getWindowWidth()).eql(600);
});

AssertionError: expected 896 to deeply equal 960

@kirovboris kirovboris added TYPE: bug The described behavior is considered as wrong (bug). OS: Mac BROWSER: Chrome BROWSER: Firefox labels Sep 19, 2016
@kirovboris kirovboris added this to the Testing day 0.9.0-rc1 milestone Sep 19, 2016
@AndreyBelym
Copy link
Contributor

We cannot resize a window to the size bigger than the desktop size on Mac. Can you specify your Mac desktop size as well?

@inikulin
Copy link
Contributor

@AndreyBelym Maybe we could give warning in that case?

@AndreyBelym
Copy link
Contributor

Sure!

AndreyBelym added a commit to AndreyBelym/testcafe that referenced this issue Sep 21, 2016
@AndreyBelym AndreyBelym removed this from the 0.9.0-rc1 testing milestone Sep 23, 2016
@AlexanderMoskovkin AlexanderMoskovkin added this to the Sprint #1 milestone Oct 18, 2016
@AndreyBelym
Copy link
Contributor

AndreyBelym commented Oct 31, 2016

Browser provider API changes:

canResizeWindowToDimensions(browserId, width, height)

Allows to validate the specified width and height of browser window browserId before the actual resize. The result is true if browser window can be resized to the specified dimensions, false otherwise. In case of false value TestCafe will stop resizing and throw an error.

hasCustomActionForBrowser(browserId)

Enables feature querying for the specified browser window browserId. The function should return an object with the following properties:
hasResizeWindow - the browser window supports resizing,
hasMaximizeWindow - the browser window supports maximizing,
hasTakeScreenshots - the browser window image can be captured to the file,
hasCanResizeWindowToDimensions - the requested window dimensions can be validated before resize.

If a property in the returned object has the true value, the provider should have an implemented function with the name corresponding to the property. (e.g. hasTakeScreenshot => takeScreenshot). The default implementation for hasCustomActionForBrowser checks for the function names by calling hasOwnProperty on provider object.

isLocalBrowser(browserId)

Returns true if the specified browser browserId is a local browser. Default implementation ignores browserId and always returns false.

@lock
Copy link

lock bot commented Mar 29, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 29, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…ress#816, closes DevExpress#812) (DevExpress#837)

* Show error is the requested size is too big on Mac

* Implement t.maximize
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BROWSER: Chrome BROWSER: Firefox OS: Mac STATE: Auto-locked An issue has been automatically locked by the Lock bot. TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

4 participants