Search code examples
google-chrometestingautomated-teststestcafeui-testing

Full screen not working when npx testcafe 'chrome --start-fullscreen' is defined in package.json file - testcafe


I am learning testcafe and I am a newbie here.

According to testcafe docs the command npx testcafe 'chrome --start-fullscreen' should open full screen and run tests, which is doing the job perfectly. But when I defined the same command under scripts tag in package.json file, it's not opening the full screen

  "scripts": {
    "testsOnChrome": "npx testcafe 'chrome --start-fullscreen'"

  }

any help is appreciated


Solution

  • You need to insert the command chrome --start-fullscreen in double quotes " instead of single quote '

    use this

    "testsOnChrome": "npx testcafe \"chrome --start-fullscreen\""