question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`.maximizeWindow()` not working on M1 Mac

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreyBelymcommented, May 18, 2022

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.

1reaction
AlexanderMoiseevcommented, Jan 17, 2022

Hi,

We have reproduced the issue. Please stay tuned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

macOS: Is there a way to maximize a window but does not go ...
What you are looking for is called the "Zoom" command. It resides in the "Window" menu in an app like Chrome. You can...
Read more >
Maximizing windows does not work properly…
When I am maximizing it does not always work properly when the menu bar is hidden. ... MacBook Pro with Retina display, macOS...
Read more >
Maximize Window Right/Left not working w/ Ventura
Maximize Window Right/Left not working w/ Ventura · Type of Mac: Macbook Air M1 · macOS version: Version 13.0 Beta (22A5321d) · BetterTouchTool ......
Read more >
How to Maximize a Window WITHOUT Going into Full Screen ...
How to make a Mac window take up the screen without going full screen, meaning you can still see the app icons on...
Read more >
DOWNLOAD Lychee Slicer Resin & Filament - Mango 3D
Download the latest version of Lychee Slicer, for your favorite SLA 3D printer. Avaialble for Windows, Mac and Linux.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found