Project

General

Profile

Actions

action #111545

closed

openQA-in-openQA test fails in search due to new Firefox pop-ups. Can Firefox be asked to not create any pop-ups? auto_review:"(?s)openQA/login.pm:6 called testapi::assert_and_click.*match=openqa-login timed out" size:M

Added by okurz almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Urgent
Assignee:
Category:
Feature requests
Target version:
Start date:
2022-05-24
Due date:
% Done:

0%

Estimated time:

Description

Observation

openQA test in scenario openqa-Tumbleweed-dev-x86_64-openqa_install+publish@64bit-2G fails in
search
due to a new Firefox popup. Can we ask Firefox to start without any pop-ups?

Test suite description

Maintainer: okurz@suse.de Test for installation of openQA itself. To be used with "openqa" distri. Publishes an qcow2 image including the openQA installation ready to run as an appliance.

Reproducible

Fails since (at least) Build :TW.11437

Expected result

Last good: :TW.11436 (or more recent)

Further details

Always latest result in this scenario: latest


Related issues 1 (0 open1 closed)

Related to openQA Tests - action #111416: [tools] Firefox: new screen for total cookie protectionResolvedjbaier_cz2022-05-22

Actions
Actions #1

Updated by okurz almost 2 years ago

  • Project changed from openQA Tests to openQA Project
  • Category changed from Bugs in existing tests to Feature requests
Actions #2

Updated by okurz almost 2 years ago

  • Subject changed from openQA-in-openQA test fails in search due to new Firefox pop-ups. Can Firefox be asked to not create any pop-ups? to openQA-in-openQA test fails in search due to new Firefox pop-ups. Can Firefox be asked to not create any pop-ups? auto_review:"(?s)openQA/login.pm:6 called testapi::assert_and_click.*match=openqa-login timed out":retry
Actions #3

Updated by okurz almost 2 years ago

We found out that most likely we can prevent the dialog by writing a custom preference file which even does not interfer with normal settings. So I suggest within os-autoinst-distri-openQA to add a line

assert_script_run(q{echo 'user_pref("browser.startup.upgradeDialog.enabled", false);' > user.js});

before the first call to firefox.

If this works I am sure os-autoinst-distri-opensuse users would be happy to receive that patch as well :)

Actions #4

Updated by mkittler almost 2 years ago

  • Subject changed from openQA-in-openQA test fails in search due to new Firefox pop-ups. Can Firefox be asked to not create any pop-ups? auto_review:"(?s)openQA/login.pm:6 called testapi::assert_and_click.*match=openqa-login timed out":retry to openQA-in-openQA test fails in search due to new Firefox pop-ups. Can Firefox be asked to not create any pop-ups? auto_review:"(?s)openQA/login.pm:6 called testapi::assert_and_click.*match=openqa-login timed out" size:M
  • Status changed from New to Workable
Actions #5

Updated by AdamWill almost 2 years ago

oh boy, have I had fun with this kinda thing:

https://bugzilla.mozilla.org/show_bug.cgi?id=1703903

this is what I'm doing to try and deal with idiotic popups at present:

sub disable_firefox_studies {
    # create a config file that disables Firefox's dumb 'shield
    # studies' so they don't break tests:
    # https://bugzilla.mozilla.org/show_bug.cgi?id=1529626
    # and also disables the password manager stuff so that doesn't
    # break password entry:
    # https://bugzilla.mozilla.org/show_bug.cgi?id=1635833
    # and *also* tries to disable "first run pages", though this
    # doesn't seem to be working yet:
    # https://bugzilla.mozilla.org/show_bug.cgi?id=1703903
    assert_script_run 'mkdir -p $(rpm --eval %_libdir)/firefox/distribution';
    assert_script_run 'printf \'{"policies": {"DisableFirefoxStudies": true, "OfferToSaveLogins": false, "OverrideFirstRunPage": "", "OverridePostUpdatePage": ""}}\' > $(rpm --eval %_libdir)/firefox/distribution/policies.json';
    # Now create a preferences override file that disables the
    # quicksuggest and total cookie protection onboarding screens
    # see https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
    # for why this wacky pair of files with required values is needed
    # and https://bugzilla.mozilla.org/show_bug.cgi?id=1703903 again
    # for the actual values
    assert_script_run 'mkdir -p $(rpm --eval %_libdir)/firefox/browser/defaults/preferences';
    assert_script_run 'printf "// required comment\npref(\'general.config.filename\', \'openqa-overrides.cfg\');\npref(\'general.config.obscure_value\', 0);\n" > $(rpm --eval %_libdir)/firefox/browser/defaults/preferences/openqa-overrides.js';
    assert_script_run 'printf "// required comment\npref(\'browser.urlbar.quicksuggest.shouldShowOnboardingDialog\', false);\npref(\'privacy.restrict3rdpartystorage.rollout.enabledByDefault\', false);\n" > $(rpm --eval %_libdir)/firefox/openqa-overrides.cfg';
}

The problem I see with trying to use a user.js is, it's supposed to go in the Firefox profile directory...which doesn't exist until you've run Firefox. So you'd have to run it, quit, write the file (using wildcards or something to find the right path as it gets random elements in its name), then run it again.

My approach is using a mechanism Firefox calls "autoconfig" to set prefs: https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig

It's weirdly baroque (I have no idea why they thought this "you have to make one file that points to another file and has a weird magic setting in it" mechanism was a good idea), but it does work if you do it right.

Setting privacy.restrict3rdpartystorage.rollout.enabledByDefault false gets rid of that Total Cookie Protection thing (per Ed Lee on the upstream bug), setting browser.urlbar.quicksuggest.shouldShowOnboardingDialog false deals with a 'quicksuggest' one I was seeing a few weeks ago. Upstream (Mike Kaply) suggested just browser.aboutwelcome.enabled might deal with both, but I haven't tried that yet.

There is also the Policies mechanism - https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson - which is easier to use, but only has a limited range of policies. Upstream thought that setting the OverrideFirstRunPage policy to "" should get rid of both the total cookie protection and quicksuggest popups, but in my testing it does not seem to, I don't know why not.

Actions #6

Updated by tinita almost 2 years ago

Thanks @AdamWill !

Actions #7

Updated by jbaier_cz almost 2 years ago

  • Status changed from Workable to In Progress
  • Assignee set to jbaier_cz
Actions #8

Updated by jbaier_cz almost 2 years ago

  • Status changed from In Progress to Feedback

Based on suggestions in this ticket, I created a PR with a fix.

Actions #9

Updated by okurz almost 2 years ago

  • Related to action #111416: [tools] Firefox: new screen for total cookie protection added
Actions #11

Updated by jbaier_cz almost 2 years ago

  • Status changed from Feedback to Resolved

I saw no more pop-ups since the merge, so let's assume it is fixed.

Actions

Also available in: Atom PDF