Skip to content

Commit

Permalink
[FIX] Ensure defined urlParameters order
Browse files Browse the repository at this point in the history
Some testsuites may define url parameters for a test and expect the
order of parameters to be unchanged.

It is not fully clear for which cases the sorting has been implemented
initially but it has been decided to rather check for those issues
instead of always sort to have the same order in every browser.

BCP: 2370044253
  • Loading branch information
matz3 committed Apr 27, 2023
1 parent 0303b63 commit e1f3f7a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/client/browser.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ function getTestPageName(qunitHtmlFile) {
config.urlParameters.forEach(function(urlParameter) {
url.searchParams.append(urlParameter.key, urlParameter.value);
});
// Sort params for consistency between browsers (probably caused by polyfill)
url.searchParams.sort();

return url.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ sap.ui.getCore().attachInit(function() {
"use strict";

QUnit.test("URL Parameters", function(assert) {
assert.strictEqual(document.location.search, encodeURI("?0=0️⃣&0=&hidepassed=true"),
assert.strictEqual(document.location.search,
encodeURI("?paramFromTestSuite=should-be-first&hidepassed=true&0=0️⃣&0="),
"Configured URL parameters got applied");
assert.ok(QUnit.config.hidepassed, "URL parameter configured QUnit");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ window.suite = function() {
// eslint-disable-next-line new-cap
const oSuite = new parent.jsUnitTestSuite();
const sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1);
oSuite.addTestPage(sContextPath + "test.qunit.html");
oSuite.addTestPage(sContextPath + "test.qunit.html?paramFromTestSuite=should-be-first");

return oSuite;
};
1 change: 0 additions & 1 deletion test/integration/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ test.after(() => {
});

const configPaths = glob.sync(["./*/karma*.conf.js"], {cwd: __dirname});
// const configPaths = ["application-ui5-tooling/karma-ui5-config-not-found.conf.js"];
for (const configPath of configPaths) {
registerIntegrationTest(configPath);
}

0 comments on commit e1f3f7a

Please sign in to comment.