package com.sudicode.tunejar.menu;

import com.sudicode.tunejar.player.Gui;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static com.jayway.awaitility.Awaitility.await;
import static com.jayway.awaitility.Duration.FIVE_SECONDS;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;

public class ThemeMenuTest {

    private static final Logger logger = LoggerFactory.getLogger(ThemeMenuTest.class);

    private Gui gui = Gui.getInstance();

    @Test
    public void testDarkTheme() throws Exception {
        gui.getRobot().clickOn("#themeSelector");
        await().atMost(FIVE_SECONDS).until(() -> gui.getRobot().clickOn("Dark Theme"));
        logger.info("Clicked on Dark Theme");
        await().atMost(FIVE_SECONDS).until(() -> gui.getPlayer().getScene().getStylesheets().get(0), endsWith("Dark%20Theme.css"));
        assertThat(gui.getPlayer().getOptions().getTheme(), is(equalTo(("Dark Theme"))));
    }

    @Test
    public void testModena() throws Exception {
        gui.getRobot().clickOn("#themeSelector");
        await().atMost(FIVE_SECONDS).until(() -> gui.getRobot().clickOn("Modena"));
        logger.info("Clicked on Modena");
        await().atMost(FIVE_SECONDS).until(() -> gui.getPlayer().getScene().getStylesheets().get(0), endsWith("Modena.css"));
        assertThat(gui.getPlayer().getOptions().getTheme(), is(equalTo("Modena")));
    }

}

@@ -757,24 +757,26 @@
 rk Theme%22);%0A
+//
         awai
@@ -1222,24 +1222,26 @@
 n Modena%22);%0A
+//
         awai

Update ThemeMenuTest.java