2017-11-21 01:53:21 -06:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
2018-03-15 17:26:35 -05:00
|
|
|
qunit_junit: {
|
|
|
|
options: {}
|
|
|
|
},
|
2017-11-21 01:53:21 -06:00
|
|
|
qunit: {
|
tests: webui: Allow file access from files in tests
https://peter.sh/experiments/chromium-command-line-switches/#allow-file-access-from-files
> By default, file:// URIs cannot read other file:// URIs. This is an
override for developers who need the old behavior for testing.
Fixes webui tests on CI:
```
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
```
Related: https://pagure.io/freeipa/issue/9329
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2022-06-28 09:26:43 -05:00
|
|
|
options: {
|
|
|
|
puppeteer: {
|
2023-03-20 09:13:05 -05:00
|
|
|
executablePath: '/usr/bin/chromium-browser',
|
tests: webui: Allow file access from files in tests
https://peter.sh/experiments/chromium-command-line-switches/#allow-file-access-from-files
> By default, file:// URIs cannot read other file:// URIs. This is an
override for developers who need the old behavior for testing.
Fixes webui tests on CI:
```
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
```
Related: https://pagure.io/freeipa/issue/9329
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
2022-06-28 09:26:43 -05:00
|
|
|
args: [
|
|
|
|
"--allow-file-access-from-files"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
},
|
2017-11-21 01:53:21 -06:00
|
|
|
all: [
|
|
|
|
'test/all_tests.html'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-03-15 17:26:35 -05:00
|
|
|
grunt.loadNpmTasks('grunt-qunit-junit');
|
2017-11-21 01:53:21 -06:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-qunit');
|
2018-03-15 17:26:35 -05:00
|
|
|
grunt.registerTask('test', ['qunit_junit', 'qunit']);
|
2017-11-21 01:53:21 -06:00
|
|
|
};
|