From 16b7a13de8aec8786fc4a80913e32d317d19400e Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Fri, 28 Feb 2025 20:56:15 +0100 Subject: [PATCH] chore: add test case for multiple users solving lessons (#2043) --- .../playwright/webgoat/HttpBasicsLessonUITest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/it/java/org/owasp/webgoat/playwright/webgoat/HttpBasicsLessonUITest.java b/src/it/java/org/owasp/webgoat/playwright/webgoat/HttpBasicsLessonUITest.java index 61b66d8a4..b0146ee9b 100644 --- a/src/it/java/org/owasp/webgoat/playwright/webgoat/HttpBasicsLessonUITest.java +++ b/src/it/java/org/owasp/webgoat/playwright/webgoat/HttpBasicsLessonUITest.java @@ -66,4 +66,18 @@ public class HttpBasicsLessonUITest extends PlaywrightTest { assertThat(lessonPage.getAssignmentOutput()).containsText("Try again, name cannot be empty."); } + + @Test + @Order(4) + @DisplayName( + "Given Sylvester solves the first assignment when Tweety logs in then the first assignment should NOT be solved") + void shouldNotSolvePage1(Browser browser) { + lessonPage.navigateTo(2); + lessonPage.getEnterYourName().fill("John Doe"); + lessonPage.getGoButton().click(); + + var tweetyLessonPage = new HttpBasicsLessonPage(Authentication.tweety(browser)); + tweetyLessonPage.open(new LessonName("HttpBasics")); + Assertions.assertThat(tweetyLessonPage.noAssignmentsCompleted()).isTrue(); + } }