Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions web-e2e/src/test/kotlin/it/krzeminski/fsynth/SmokeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ 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
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 {
Expand Down Expand Up @@ -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)
}
}
Loading