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

Start browser in a clean/empty profile when running locally #1623

Closed
jvanoostveen opened this issue Jul 18, 2017 · 4 comments · Fixed by #1792
Closed

Start browser in a clean/empty profile when running locally #1623

jvanoostveen opened this issue Jul 18, 2017 · 4 comments · Fixed by #1792
Assignees
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: browser natives TYPE: enhancement The accepted proposal for future implementation.
Milestone

Comments

@jvanoostveen
Copy link

Are you requesting a feature or reporting a bug?

It depends, although this one is more of a feature request I think...

What is the current behavior?

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.

What is the expected behavior?

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

Specify your

  • operating system: Windows 10
  • testcafe version: 0.15
  • node.js version: 8.1.4
@AlexanderMoskovkin
Copy link
Contributor

AlexanderMoskovkin commented Sep 14, 2017

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.

@AndreyBelym
Copy link
Contributor

AndreyBelym commented Sep 14, 2017

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

@AlexanderMoskovkin
Copy link
Contributor

Closed in #1792

@lock
Copy link

lock bot commented Mar 28, 2019

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.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: browser natives TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@jvanoostveen @miherlosev @AndreyBelym @AlexanderMoskovkin and others