diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-06-08 02:46:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-08 02:46:56 +0300 |
commit | d0aaab95f1ef6d8b748b0e8d54f811a366864249 (patch) | |
tree | 86820438b4b56c764912316ebe8152362aa3e2dd /tests/lib | |
parent | d10c4e89dc5d1081a3755497c45d366b470eeec7 (diff) |
Switch from bower to npm and update JS libraries (#14082)
* Starting to replace bower with npm: use updated jquery-ui from npm.
* Use jquery from npm./
* Use angular from npm.
* Add more angular libraries.
* Use chroma-js from npm.
* Remove html5shiv, does not appear to be used.
* Use iframe resizer library from npm.
* Add jquery-mousewheel
* Add jquery.dotdotdot from npm.
* Get jquery.scrollto from npm.
* Get jscrollpane from npm.
* Get materialize-css from npm.
* Get mousetrap from npm.
* Remove ngDialog, as it is no longer used.
* Install qrcode.js from npm.
* Get sprintf-js from npm.
* Get visibillityjs from npm.
* Remove bower.json.
* Getting parts of matomo to work w/ new versions of libraries installed by npm.
* Ignore node_modules subfolders in node_modules since we only use npm for frontend dependencies + fix a test.
* Fix button padding.
* Fix series picker checkboxes.
* Fix karma conf.
* Fix CSS in right place.
* Fixing more css/less issues.
* More test fixes.
* Limit selection style fix.
* Fix more tests + materializecss issues.
* Fix a couple more tests.
* Fix annotation styling.
* remove error
* add ng-dialog files
* try to fix some tests
* Fix several UI tests.
* fixing more build issues
* Fix several more tests and issues.
* fixing more tests
* split ui tests into 3 groups
* fix several more issues and tests
* Fix some console warnings on chrome.
* Updating more test files.
* fix some tests
* yet more fixes
* couple more fixes
* another form fix
* Fix some tests.
* update screenshot
* update more expected files
* Fix two more form issues.
* test commit (travis is not fetching submodules for some reason...)
* remove scripts removed in merge
* three travis builds
* split UIIntegrationTest into multiple suites
* lets try this again
* updae several expected screenshots
* fix some more tests
* fix plugin details material select and tabs initiaialization
* update screenshots + css fix
* re-initialize materialize tabs since we load jquery-ui afterwards for datepicker which unsets materialize tabs
* update more screenshots and fix couple more issues
* update more screenshots + tweak to test
* more fixes and screenshot updates
* fix some issues and update more screenshots
* update submodules
* more fixes + more updated screenshots
* more css fixes and test fixes
* couple fixes & updated screenshots
* update screenshots
* fix random failure
* Map old bower_component files to new ones in AssetManager.
* Remove node_modules from PR and ignore node_modules in .gitignore and remove libs/jquery (adding new required libs).
* Update .travis.yml.
* update screenshots
* fixing some more issues
* fix copy pasta
* update screenshots
* fix more modal issues
* Update css & screenshots.
* correct close modal calls
* fixing more issues
* data-target instead of data-activates
* fix more tests
* trigger build that works?
* fix more tests
* update submodule
* debugging travis
* more debugging
* try to fix test
* fix modal no button click in test
* update more screenshots
* couple more test fixes
* some more fixes and updated screenshots
* update screenshots
* apply some review feedback
* Fix modal centering and initial top position.
* apply some more pr feedback
* another pr fix
* update submodule
* remove style
* fix color of checkbox mark
* Fix centering the popover
Note: centering the popover relative to body doesn't work poperly anymore, maybe because of the fixed position of the widget overlay. Using the ui-widget-overlay to position the dialog centered seems to work
* ignore line endings check for node modules
* updates expected UI files
* submodule updates
* use minified file of jquery.browser.js
* updates expected test files
* ensure to hide parent tooltips when row action tooltips are shown
* tweak less for datatable navigation
* style is only useful for dashboard
* update some screenshots
* update submodules
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/screenshot-testing/support/app.js | 23 | ||||
-rw-r--r-- | tests/lib/screenshot-testing/support/test-environment.js | 25 |
2 files changed, 22 insertions, 26 deletions
diff --git a/tests/lib/screenshot-testing/support/app.js b/tests/lib/screenshot-testing/support/app.js index 93139569e6..0c3d57fa4e 100644 --- a/tests/lib/screenshot-testing/support/app.js +++ b/tests/lib/screenshot-testing/support/app.js @@ -75,10 +75,8 @@ Application.prototype.printHelpAndExit = function () { console.log(" --screenshot-repo: Specifies the GitHub repository that contains the expected screenshots"); console.log(" to link to in the diffviewer. For use with travis build."); console.log(" --core: Only execute UI tests that are for Piwik core or Piwik core plugins."); - console.log(" --first-half: Only execute first half of all the test suites. Will be only applied if no") - console.log(" specific plugin or test-files requested"); - console.log(" --second-half: Only execute second half of all the test suites. Will be only applied if no") - console.log(" specific plugin or test-files requested"); + console.log(" --num-test-groups: Divide all test execution into this many overall groups. Use --test-group to pick which group to run in this execution."); + console.log(" --test-group: The test group to run."); process.exit(0); }; @@ -167,19 +165,16 @@ Application.prototype.loadTestModules = function () { var specificTestsRequested = options.plugin || options.tests.length; - if ((options['run-first-half-only'] || options['run-second-half-only']) && !specificTestsRequested) { - // run only first 50% of the test suites or only run last 50% of the test suites. + if (options['num-test-groups'] && options['test-group'] && !specificTestsRequested) { + // run only N% of the test suites. // we apply this option only if not a specific plugin or test suite was requested. Only there for travis to // split tests into multiple jobs. - var numTestsFirstHalf = Math.round(mocha.suite.suites.length / 2); - numTestsFirstHalf -= 4; + + var numberOfGroupsToSplitTestsInto = parseInt(options['num-test-groups']); + var testGroupToRun = parseInt(options['test-group']); + mocha.suite.suites = mocha.suite.suites.filter(function (suite, index) { - if (options['run-first-half-only'] && index < numTestsFirstHalf) { - return true; - } else if (options['run-second-half-only'] && index >= numTestsFirstHalf) { - return true; - } - return false; + return index % numberOfGroupsToSplitTestsInto === testGroupToRun; }); } diff --git a/tests/lib/screenshot-testing/support/test-environment.js b/tests/lib/screenshot-testing/support/test-environment.js index d64bb4a56d..eb32f885b1 100644 --- a/tests/lib/screenshot-testing/support/test-environment.js +++ b/tests/lib/screenshot-testing/support/test-environment.js @@ -95,18 +95,19 @@ TestingEnvironment.prototype.callController = function (method, params) { }; TestingEnvironment.prototype._call = async function (params) { + let queryString = Object.keys(params).reduce(function (obj, name) { + if (params[name] instanceof Array) { + params[name].forEach(function(value, index) { + obj[name+'['+index+']'] = value; + }); + return obj; + } + obj[name] = params[name]; + return obj; + }, {}); let response = await request({ uri: resolveUrl(config.piwikUrl, '/tests/PHPUnit/proxy/index.php'), - qs: Object.keys(params).reduce(function (obj, name) { - if (params[name] instanceof Array) { - params[name].forEach(function(value, index) { - obj[name+'['+index+']'] = value; - }); - return obj; - } - obj[name] = params[name]; - return obj; - }, {}), + qs: queryString, }); if (response === '') { @@ -118,11 +119,11 @@ TestingEnvironment.prototype._call = async function (params) { try { response = JSON.parse(response); } catch (e) { - throw new Error("Unable to parse JSON response: " + response); + throw new Error("Unable to parse JSON response: " + response + " for query " + JSON.stringify(queryString)); } if (response.result === "error") { - throw new Error("API returned error: " + response.message); + throw new Error("API returned error: " + response.message + " for query " + JSON.stringify(queryString)); } return response; |