Skip to content

Commit

Permalink
Improved navigation between execution and script page (small fix).
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Mar 30, 2024
1 parent aa918d7 commit eb2c75e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions source/src/main/webapp/js/pages/TestCaseExecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -2260,9 +2260,9 @@ Step.prototype.show = function (a) {
url.hash = '#stepId=' + object.step + "-" + object.index;
stepFocus = object.step + "-" + object.index;
window.history.pushState({}, '', url);
$("#editTcStepInfo").parent().attr("href", "./TestCaseScript.jsp?test=" + encodeURI(object.test) + "&testcase=" + encodeURI(object.testcase) + '#stepId=' + object.step);
$("#editTcStepInfo").parent().attr("href", "./TestCaseScript.jsp?test=" + encodeURI(object.test) + "&testcase=" + encodeURI(object.testcase) + '&stepId=' + object.step);
} else if (stepFocus != 99999) {
$("#editTcStepInfo").parent().attr("href", "./TestCaseScript.jsp?test=" + encodeURI(object.test) + "&testcase=" + encodeURI(object.testcase) + '#stepId=' + object.step);
$("#editTcStepInfo").parent().attr("href", "./TestCaseScript.jsp?test=" + encodeURI(object.test) + "&testcase=" + encodeURI(object.testcase) + '&stepId=' + object.step);
}

for (var i = 0; i < object.steps.length; i++) {
Expand Down
9 changes: 6 additions & 3 deletions source/src/main/webapp/js/pages/TestCaseScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $.when($.getScript("js/global/global.js")
var oneclickcreation = GetURLParameter("oneclickcreation");

var tabactive = GetURLParameter("tabactive");
var step = GetURLAnchorValue("stepId");
var step = GetURLParameter("stepId");

displayHeaderLabel(doc);
displayGlobalLabel(doc);
Expand Down Expand Up @@ -681,8 +681,11 @@ function saveScript(property) {
if (tutorielId !== null && startStep !== null) {
tutorialParameters = "&tutorielId=" + tutorielId + "&startStep=" + startStep;
}

var new_uri = parser.pathname + "?test=" + encodeURI(GetURLParameter("test")) + "&testcase=" + encodeURI(GetURLParameter("testcase")) + tutorialParameters + "&tabactive=" + tabActive + window.location.hash;
var url_step = "";
if (!(isEmpty(stepData))) {
url_step = "&stepId=" + encodeURI(stepData.stepId);
}
var new_uri = parser.pathname + "?test=" + encodeURI(GetURLParameter("test")) + "&testcase=" + encodeURI(GetURLParameter("testcase")) + tutorialParameters + url_step + "&tabactive=" + tabActive;
// If the 1st 2 characters are // we remove 1 of them.
if ((new_uri[0] === '/') && (new_uri[1] === '/')) {
new_uri = new_uri[0] + new_uri.slice(2);
Expand Down

0 comments on commit eb2c75e

Please sign in to comment.