From 9051e6a6dbcbf5503c92bc009ec3f7c2a0c2850f Mon Sep 17 00:00:00 2001 From: Athou Date: Wed, 5 Mar 2025 17:22:53 +0100 Subject: [PATCH] add test to make sure documentation is available --- .../com/commafeed/e2e/DocumentationIT.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 commafeed-server/src/test/java/com/commafeed/e2e/DocumentationIT.java diff --git a/commafeed-server/src/test/java/com/commafeed/e2e/DocumentationIT.java b/commafeed-server/src/test/java/com/commafeed/e2e/DocumentationIT.java new file mode 100644 index 00000000..f8040ac3 --- /dev/null +++ b/commafeed-server/src/test/java/com/commafeed/e2e/DocumentationIT.java @@ -0,0 +1,38 @@ +package com.commafeed.e2e; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.microsoft.playwright.Browser; +import com.microsoft.playwright.Page; +import com.microsoft.playwright.Playwright; +import com.microsoft.playwright.assertions.PlaywrightAssertions; + +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +class DocumentationIT { + + private final Playwright playwright = Playwright.create(); + private final Browser browser = playwright.chromium().launch(); + + private Page page; + + @BeforeEach + void init() { + page = browser.newContext().newPage(); + } + + @AfterEach + void cleanup() { + playwright.close(); + } + + @Test + void documentationAvailable() { + page.navigate("http://localhost:8085/#/api"); + PlaywrightAssertions.assertThat(page.getByText("Download OpenAPI specification:")).isVisible(); + } + +}