From d1c8b98feaac93b0df3c807bad3cfef64ff0049d Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Tue, 28 Jun 2022 17:26:43 +0300 Subject: [PATCH] gha: webui: Disable web security in tests Fixes webui tests on gha: ``` Testing test/all_tests.html Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. Access to XMLHttpRequest at 'file:///__w/freeipa/freeipa/install/ui/test/qunit.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-untrusted, https. Failed to load resource: net::ERR_FAILED Access to XMLHttpRequest at 'file:///__w/freeipa/freeipa/install/ui/test/data/i18n_messages.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-untrusted, https. Failed to load resource: net::ERR_FAILED >> Error: Error: Couldn't receive translations ``` See https://github.com/gruntjs/grunt-contrib-qunit/issues/158 for details. --- install/ui/Gruntfile.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install/ui/Gruntfile.js b/install/ui/Gruntfile.js index ba464112776..6282a748e36 100644 --- a/install/ui/Gruntfile.js +++ b/install/ui/Gruntfile.js @@ -4,6 +4,15 @@ module.exports = function(grunt) { options: {} }, qunit: { + options: { + puppeteer: { + ignoreDefaultArgs: true, + args: [ + "--headless", + "--disable-web-security" + ] + }, + }, all: [ 'test/all_tests.html' ]