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

How to specify screen resolution? #178

Closed
avilano opened this issue Oct 19, 2021 · 4 comments
Closed

How to specify screen resolution? #178

avilano opened this issue Oct 19, 2021 · 4 comments
Assignees

Comments

@avilano
Copy link

avilano commented Oct 19, 2021

I can't find a way to change the screen resolution for the ubuntu image in order to run browser tests.

@FelicianoTech
Copy link
Contributor

This depends on the tools you are using. Different tools have different ways to go about things. Since this is a server image, there's no real screen or monitor but you can change the virtualized window size. For example, if you were using Selenium (pre-installed) and Firefox, this Doc shows the setting you'd want to change: https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/firefox_exports_Options.html#windowSize

@avilano
Copy link
Author

avilano commented Oct 21, 2021

Thank you, I'm using Testcafe which uses this method (https://testcafe.io/documentation/402696/reference/test-api/testcontroller/maximizewindow#header) in combination with the cimg-node, google chorme and browser-tools. I am getting this warning when tests finish.

Warnings (1):
 --
  Was unable to maximize the window due to an error.

  The
  /home/circleci/bold/qa/node_modules/testcafe-browser-tools/bin/linux/glibc-64/maximize
  process failed with the null exit code.

Here is the job config:

<job-name>:
    working_directory: <some-path>
    docker:
      - image: cimg/node:lts-browsers
    resource_class: medium+
    steps:
      - checkout:
          path: <some-path>
      - browser-tools/install-chrome
      - browser-tools/install-chromedriver
      - node/install-packages
      - run:

@BytesGuy
Copy link
Contributor

@avilano I can only presume that this is an issue with testcafe at this point. I don't have any experience with it, but with selenium running driver.manage().window().setRect({width: 3840, height: 2160, x: 0, y: 0}); for example works perfectly fine.

Here is a screenshot from the test running in CircleCI using cimg/node:lts-browsers:

image

@BytesGuy BytesGuy self-assigned this Dec 13, 2021
@BytesGuy
Copy link
Contributor

I'm going to close this issue as it doesn't appear to be directly tied to the image as I was able to set the window size as above. Please feel free to reopen this if required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants