From 2c73cea4b866c09a327077579aa7200f938300c2 Mon Sep 17 00:00:00 2001 From: Piotr Krzeminski Date: Fri, 22 May 2026 10:39:21 +0200 Subject: [PATCH] Add e2e test asserting waveform appears after synthesizing Simple demo song --- .../kotlin/it/krzeminski/fsynth/SmokeTest.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/web-e2e/src/test/kotlin/it/krzeminski/fsynth/SmokeTest.kt b/web-e2e/src/test/kotlin/it/krzeminski/fsynth/SmokeTest.kt index d34f17d..71daf1d 100644 --- a/web-e2e/src/test/kotlin/it/krzeminski/fsynth/SmokeTest.kt +++ b/web-e2e/src/test/kotlin/it/krzeminski/fsynth/SmokeTest.kt @@ -6,6 +6,7 @@ import io.github.bonigarcia.wdm.WebDriverManager import java.io.File import java.net.InetSocketAddress import java.nio.file.Files +import java.time.Duration import org.junit.AfterClass import org.junit.Assert.assertTrue import org.junit.BeforeClass @@ -13,6 +14,8 @@ import org.junit.Test import org.openqa.selenium.By import org.openqa.selenium.chrome.ChromeDriver import org.openqa.selenium.chrome.ChromeOptions +import org.openqa.selenium.support.ui.ExpectedConditions +import org.openqa.selenium.support.ui.WebDriverWait class SmokeTest { companion object { @@ -68,4 +71,21 @@ class SmokeTest { assertTrue("Page should contain at least one song name", bodyText.contains("Simple demo song")) assertTrue("Page should contain playback customization section", bodyText.contains("Playback customization")) } + + @Test + fun waveformIsDisplayedAfterSynthesizingSimpleDemoSong() { + driver.get("http://localhost:$PORT/index.html") + + val playButton = driver.findElement( + By.xpath("//*[contains(text(), 'Simple demo song')]/ancestor::li//button") + ) + playButton.click() + + val wait = WebDriverWait(driver, Duration.ofSeconds(15)) + val waveform = wait.until( + ExpectedConditions.visibilityOfElementLocated(By.id("waveform")) + ) + + assertTrue("Waveform should be visible after synthesis", waveform.isDisplayed) + } }