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

.maximizeWindow() not working on M1 Mac #6817

Closed
Jgrabenbauer opened this issue Jan 13, 2022 · 7 comments
Closed

.maximizeWindow() not working on M1 Mac #6817

Jgrabenbauer opened this issue Jan 13, 2022 · 7 comments
Labels
FREQUENCY: level 1 TYPE: bug The described behavior is considered as wrong (bug).

Comments

@Jgrabenbauer
Copy link

What is your Scenario?

We have a fixure that maximizes the window before each test run. It was working fine in testcafe 1.17.1 and now it isn't working on 1.18.1.

What is the Current behavior?

Using the chrome browser:

Starting on an extended display: The browser opens up like normal and then once it hits the .maximizeWindow() command the browser moves over to the main display and resizes to the mobile aspect ratio.
Starting on the main display: The browser opens up like normal and then once it hits the .maximizeWindow() command the browser disappears even though the test continues to run.

What is the Expected behavior?

Using the chrome browser:

The active window will maximize properly.

What is your public website URL? (or attach your complete example)

www.google.com

What is your TestCafe test code?

import { Selector, t } from 'testcafe'


fixture `test`
  .page `www.google.com`
  .beforeEach(async t => {
      await t.maximizeWindow()
  })

test
    ('user_is_able_to_search_for_clickfunnels', async t => {
        await t
            .typeText(Selector('input').withAttribute('name', 'q'), 'ClickFunnels')
            .pressKey('enter')
            .expect(Selector('a').withText('ClickFunnels').visible).ok()
    })

Your complete configuration file

let filtered_tests = [
    // Located in editor_page_tests.js
    'user_is_able_to_add_a_section_column_row_and_element_to_editor', 
    'pop_up_element_displays_during_page_preview',
    'clicking_button_shows_hides_elements',
    'user_is_able_to_save_when_adding_a_video',
    'user_is_able_to_save_when_leaving_video_embed_blank',

    // Located in courses_page_tests.js
    'user_can_preview_existing_course',
    'optin_user_can_navigate_through_course',
    'manually_added_user_can_navigate_through_course',
    
    // Located in funnels_page_tests.js
    'user_can_navigate_through_funnel',

    // Located in developer_portal_page_tests.js
    'user_can_navigate_to_developer_portal_page',

    // Located in members_page_tests.js
    'user_can_navigate_to_team_members_page',

    // Located in teams_dashboard_pages_tests.js
    'user_can_navigate_to_team_dashboard_page',

    // Located in workspaces_page_tests.js
    'user_can_navigate_to_team_workspaces_page'
]

let isolated_tests = [
    // Located in sites_overview_page_tests.js
    'user_can_make_site_public',
    'user_can_edit_site_name',
    'user_can_make_site_password_protected',
    'user_can_make_site_private',
    'user_can_edit_site_domain',
    'changing_site_domain_updates_funnel_urls',

    // Located in account_details_page_tests.js
    'user_can_edit_account_name',

    // Located in account_details_page_tests.js
    'user_can_edit_account_password',

    // Located in general_page_tests.js
    'user_can_edit_workspace_details'
]

let full_filter = filtered_tests.concat(isolated_tests)

let build_filter = () => {

    // Purpose: To set the suite that we want to run. (Sanity, Smoke, Regression)

    var filter = {}
        if(process.env.SCOPE) {
            filter = {
                testGrep: `^(?!.*(${filtered_tests.join('|')})).*$`,
                testMeta: {
                    scope: process.env.SCOPE
                }
            }
        } else {
            filter = {
                testGrep: `^(?!.*(${full_filter.join('|')})).*$`
            }
        }

    return filter
}

let determine_concurrency = () => {

    // Purpose: To set concurrency dependant on the scope that is passed
    
    let concurrency = 5
    if (process.env.SCOPE == 'isolated') {
        concurrency = 1
    } 
    return concurrency
}

module.exports = {
    assertionTimeout: 5000,
    browsers: [
        "chrome:headless --window-size=1920,1159"
    ],
    concurrency: determine_concurrency(),
    cache: true,
    clientScripts: "scripts/hide_notifications.js",
    pageLoadTimeout: 30000,
    filter: build_filter(),
    quarantineMode: {
        successThreshold: 1,
        attemptLimit: 3
    },
    reporter: [
        {
            name: "spec",
            output: "artifacts/reports/spec_results"
        },
        {
            name: "xunit",
            output: "artifacts/reports/xunit_results.xml"
        }
    ],
    screenshots: {
        path: "artifacts/screenshots",
        pathPattern: "${TEST}_${DATE}_${TIME}.png",
        takeOnFails: true,
        thumbnails: false
    },
    selectorTimeout: 5000,
    skipJsErrors: true,
    skipUncaughtErrors: true,
    src: "tests/**",
    videoEncodingOptions: {
        aspect: "16:9",
        framerate: 30
    },
    videoOptions: {
        failedOnly: true,
        pathPattern: "${TEST}_${DATE}_${TIME}.mp4",
        singleFile: false
    },
    videoPath: "artifacts/recordings"
}

Your complete test report

 Running tests in:
 - Chrome 97.0.4692.71 / macOS 10.15.7

 editor
 ✓ user_is_able_search_for_clickfunnels


 1 passed (8s)

 Warnings (3):
 --
  The "browsers", "concurrency", and "filter" options from the configuration
  file will be ignored.
 --
  Video recording is not supported by the "chrome --window-size=1920,1159"
  browser.
 --
  The browser window was resized during the
  "user_is_able_search_for_clickfunnels" test while TestCafe recorded a
  video. TestCafe cannot adjust the video resolution during recording. As a
  result, the video content may appear broken. Do not resize the browser
  window when TestCafe records a video.

Screenshots

Starting on an extended display: https://d.pr/v/7C0BDT
Starting on the main display: https://d.pr/v/Z0PrJG

Steps to Reproduce

  1. Use a Mac with M1
  2. Run the test code

TestCafe version

1.18.1

Node.js version

17.2.0

Command-line arguments

testcafe chrome -t 'user_is_able_to_search_for_clickfunnels' -c1

Browser name(s) and version(s)

Chrome 97.0.4692.71

Platform(s) and version(s)

macOS 12.0.1

Other

No response

@Jgrabenbauer Jgrabenbauer added the TYPE: bug The described behavior is considered as wrong (bug). label Jan 13, 2022
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jan 13, 2022
@AlexanderMoiseev
Copy link
Contributor

Hi,

We have reproduced the issue. Please stay tuned.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jan 17, 2022
@sheenm
Copy link

sheenm commented Feb 20, 2022

Also there is a problem in firefox - when starting on the main display instead of maximize it makes a small window

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Feb 20, 2022
@AlexanderMoiseev AlexanderMoiseev removed the STATE: Need response An issue that requires a response or attention from the team. label Feb 21, 2022
@jackfrate
Copy link

Hi, just wanted to check in and see if any workarounds to this issue have been found. Everything reproduces for me just as @Jgrabenbauer and @sheenm described.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Apr 1, 2022
@helen-dikareva
Copy link
Collaborator

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Apr 4, 2022
@AndreyBelym
Copy link
Contributor

This issue should be fixed in testcafe@v1.18.6. If you still can reproduce it with the latest TestCafe version, please let me know and I will reopen the issue.

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 12, 2023
@aaditya25
Copy link

I am still experiencing this issue with M2 chip Macs

@Aleksey28
Copy link
Collaborator

Hi @aaditya25,

Can you specify which TestCafe version you use? We had an issue with resizing the browser on MacOS and already fixed it in version 2.6.1.

@need-response-app need-response-app bot removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FREQUENCY: level 1 TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

8 participants