It depends, although this one is more of a feature request I think...
When running tests locally, it will start browsers using the current user profile. It might also have some localStorage present and leave some history/other things behind. To make sure the browser is as clean as possible, we now start (for example) Chrome with a lot of flags: chrome --enable-automation --start-maximized --disable-default-apps --disable-translate --disable-extensions --disable-background-networking --safebrowser-disable-auto-update --disable-sync --no-first-run --no-default-browser-check. This doesn't look real nice, and for some reason, setting --user-data-dir doesn't seem to work when running from TestCafe.
I would expect the browser to be run from a clean profile, for example what happens when working with SeleniumWebdriver. It will start Chrome with an empty profile (no extensions, bookmarks etc), shows the automation message etc.
The request also applies to other browsers such as Firefox.
For chrome there is alo a launcher util setting lots of these flags, might be interesting to use instead of directly calling chrome? https://github.com/GoogleChrome/lighthouse
While we have troubles with the --private-window mode in Firefox (see #1675) you can try to run the tests with the clean Firefox user profile.
For example, here is a way how I did it on Windows:
"C:\Program Files\Mozilla Firefox\firefox.exe" -CreateProfile TestCafeUser
testcafe "firefox -P TestCafeUser" test.js
or the same for Mac OS:
/Applications/Firefox.app/Contents/MacOS/firefox -P TestCafeUser
testcafe "firefox -P TestCafeUser" test.js
More about Firefox Profiles here.
Actually, you can just create an empty directory, and use it in -profile argument. Also, probably you will use some arguments to start a new instance (-no-remote -new-instance). So the result is:
mkdir /tmp/firefox-tmp-profile
firefox -no-profile -new-instance -profile /tmp/firefox-tmp-profile
Closed in #1792
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.
Most helpful comment
Actually, you can just create an empty directory, and use it in
-profileargument. Also, probably you will use some arguments to start a new instance (-no-remote -new-instance). So the result is: