- Added more testcases since now we have static IDs for the lessons.
- Changed the RestartLessonService because returning the text/html triggered the browser to show a popup which made the Selenium tests fail.
This commit is contained in:
@ -26,11 +26,13 @@
|
||||
*/
|
||||
package org.owasp.webgoat.service;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import org.owasp.webgoat.session.WebSession;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
/**
|
||||
* <p>RestartLessonService class.</p>
|
||||
@ -47,14 +49,13 @@ public class RestartLessonService extends BaseService {
|
||||
* @param session a {@link javax.servlet.http.HttpSession} object.
|
||||
* @return a {@link java.lang.String} object.
|
||||
*/
|
||||
@RequestMapping(value = "/restartlesson.mvc", produces = "text/text")
|
||||
public @ResponseBody
|
||||
String restartLesson(HttpSession session) {
|
||||
@RequestMapping(value = "/restartlesson.mvc")
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
public void restartLesson(HttpSession session) {
|
||||
WebSession ws = getWebSession(session);
|
||||
int currentScreen = ws.getCurrentScreen();
|
||||
if(currentScreen > 0){
|
||||
ws.restartLesson(currentScreen);
|
||||
}
|
||||
return ws.getCurrentLesson().getLink();
|
||||
}
|
||||
}
|
||||
|
@ -188,8 +188,9 @@ define(['jquery',
|
||||
$.ajax({
|
||||
url:'service/restartlesson.mvc',
|
||||
method:'GET'
|
||||
}).done(function(text) {
|
||||
console.log("Received a response from the restart servlet: '" + text + "'");
|
||||
}).done(function() {
|
||||
//Log shows warning, see https://bugzilla.mozilla.org/show_bug.cgi?id=884693
|
||||
|
||||
// Explicitly loading the lesson instead of triggering an
|
||||
// event in goatRouter.navigate().
|
||||
self.loadLesson(self.scr,self.menu);
|
||||
|
Reference in New Issue
Block a user