From 61b6fd76de2ebb93b46512b2915c9af2b24c5d18 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Wed, 26 Jun 2024 15:57:48 +0200 Subject: [PATCH] test(e2e): home shows events --- .../frontend/src/components/ResourceListV2.js | 7 ++++- src/main/frontend/src/components/Table.js | 6 ++-- src/main/frontend/src/events/List.js | 7 ++++- .../com/marcnuri/yakd/selenium/HomeIT.java | 31 +++++++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/src/components/ResourceListV2.js b/src/main/frontend/src/components/ResourceListV2.js index 2ce1c29..af25d68 100644 --- a/src/main/frontend/src/components/ResourceListV2.js +++ b/src/main/frontend/src/components/ResourceListV2.js @@ -43,7 +43,12 @@ export const ResourceListV2 = ({ return null; } return ( - +
diff --git a/src/main/frontend/src/components/Table.js b/src/main/frontend/src/components/Table.js index b3860c7..136874b 100644 --- a/src/main/frontend/src/components/Table.js +++ b/src/main/frontend/src/components/Table.js @@ -45,8 +45,10 @@ Table.Body = ({children}) => ( ); // For stripes to work need to add 'even' variant to specific property in tailwind.config.js -Table.Row = ({children, className = ''}) => ( - {children} +Table.Row = ({children, className = '', ...properties}) => ( + + {children} + ); Table.ResourceRow = ({resource, children, ...properties}) => ( { .map(event => { const lastTimestamp = new Date(timestamp(event)); return ( - + { const resources = Object.values(filterEvents(filteredResources, properties)); return ( wait = new WebDriverWait(driver, Duration.ofSeconds(1)); wait.until(d -> d.findElement(By.cssSelector(".dashboard-page")).isDisplayed()); @@ -58,4 +80,13 @@ void hasFooter() { assertThat(driver.findElement(By.cssSelector(".dashboard-page footer")).getText()) .matches("Copyright © \\d{4} - Marc Nuri - Licensed under the Apache License 2.0"); } + + @Test + void hasEventList() { + final By selector = By.cssSelector("[data-testid=list__events] [data-testid=list__events-row]"); + final Wait wait = new WebDriverWait(driver, Duration.ofSeconds(5)); + wait.until(d -> d.findElement(selector).isDisplayed()); + assertThat(driver.findElement(selector).getText()) + .matches("^Pod\\na-pod-1\\nStarted Started container\\n.+"); + } }