diff --git a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx index b388bf96876..c301ef805df 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/app-bar/Appbar.tsx @@ -287,7 +287,8 @@ const Appbar: React.FC = (): JSX.Element => { /> } isDropDownIconVisible={false} - // label="Need Help" + isLableVisible={false} + label="Need Help" type="link" /> diff --git a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDown.tsx b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDown.tsx index b2e17efe4d3..af0c3989790 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDown.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/DropDown.tsx @@ -27,6 +27,7 @@ const DropDown: React.FC = ({ onSelect, selectedItems, isDropDownIconVisible = true, + isLableVisible = true, }: DropDownProp) => { const [isOpen, setIsOpen] = useState(false); @@ -100,7 +101,7 @@ const DropDown: React.FC = ({ ) : ( <> {Icon && Icon} - {label && ( + {label && isLableVisible && (

diff --git a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/types.ts b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/types.ts index 334edcfdc93..b27de4e7b4c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/dropdown/types.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/dropdown/types.ts @@ -58,5 +58,6 @@ export type DropDownProp = { label?: string | React.ReactElement; type: string; icon?: React.ReactElement | string; + isLableVisible?: boolean; isDropDownIconVisible?: boolean; } & DropDownListProp; diff --git a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/common/PaginationAndFilterTest.java b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/common/PaginationAndFilterTest.java index 38694c6e297..11a82ea454c 100644 --- a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/common/PaginationAndFilterTest.java +++ b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/common/PaginationAndFilterTest.java @@ -53,7 +53,7 @@ public class PaginationAndFilterTest { ChromeOptions options = new ChromeOptions(); options.addArguments("--headless"); options.addArguments("--window-size=1280,800"); - webDriver = new ChromeDriver(); + webDriver = new ChromeDriver(options); actions = new Actions(webDriver); wait = new WebDriverWait(webDriver, Duration.ofSeconds(30)); webDriver.manage().window().maximize(); @@ -63,7 +63,6 @@ public class PaginationAndFilterTest { @RepeatedIfExceptionsTest(repeats = 2) @Order(1) public void checkFlikerInFilter() throws Exception { - Thread.sleep(waitTime); Events.click(webDriver, By.cssSelector("[data-testid='closeWhatsNew']")); // Close What's new Thread.sleep(waitTime); Events.click(webDriver, By.cssSelector("[data-testid='tables']")); // Tables @@ -82,6 +81,43 @@ public class PaginationAndFilterTest { } } + @RepeatedIfExceptionsTest(repeats = 2) + @Order(2) + public void noDataPresentWithFilter() throws Exception { + Events.click(webDriver, By.cssSelector("[data-testid='closeWhatsNew']")); // Close What's new + Thread.sleep(waitTime); + Events.click(webDriver, By.cssSelector("[data-testid='tables']")); // Tables + Events.click(webDriver, By.cssSelector("[data-testid='checkbox'][id='BigQuery']")); // Select Filter + try { + WebElement noDataFound = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath( + "//*[contains(text(), 'No matching data assets found')]"))); + if (noDataFound.isDisplayed()) { + throw new Exception("Data not found with filter count more than 0"); + } + } catch (TimeoutException exception) { + LOG.info("Success"); + } + } + + @RepeatedIfExceptionsTest(repeats = 2) + @Order(3) + public void dataPresentWithFilter() throws Exception { + Events.click(webDriver, By.cssSelector("[data-testid='closeWhatsNew']")); // Close What's new + Thread.sleep(waitTime); + Events.click(webDriver, By.cssSelector("[data-testid='tables']")); // Tables + Events.click(webDriver, By.cssSelector("[data-testid='checkbox'][id='Tier.Tier3']")); // Select Filter + try { + + WebElement dataFound = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector( + "[data-testid='search-results']"))); + if (dataFound.isDisplayed()) { + throw new Exception("Data found with filter count 0"); + } + } catch(TimeoutException exception) { + LOG.info("Success"); + } + } + @AfterEach public void closeTabs() { ArrayList tabs = new ArrayList<>(webDriver.getWindowHandles()); diff --git a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/dashboardService/DashboardServiceTestPage.java b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/dashboardService/DashboardServiceTestPage.java index f6217f2200c..efaa411a5c5 100644 --- a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/dashboardService/DashboardServiceTestPage.java +++ b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/dashboardService/DashboardServiceTestPage.java @@ -130,7 +130,7 @@ public class DashboardServiceTestPage { public void searchDashboardService() throws InterruptedException { openDashboardServicePage(); Thread.sleep(2000); - Events.click(webDriver, By.cssSelector("[data-testid='service-name-'"+ serviceName + "]")); + Events.click(webDriver, By.cssSelector("[data-testid='service-name-"+ serviceName + "']")); } @RepeatedIfExceptionsTest(repeats = 2) diff --git a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/myData/MyDataPageTest.java b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/myData/MyDataPageTest.java index 7789f701b97..c7c16622012 100644 --- a/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/myData/MyDataPageTest.java +++ b/openmetadata-ui/src/test/java/org/openmetadata/catalog/selenium/pages/myData/MyDataPageTest.java @@ -168,6 +168,7 @@ public class MyDataPageTest { @Order(8) public void checkLogout() { checkWhatsNew(); + Events.click(webDriver, By.cssSelector("[data-testid='dropdown-profile']")); Events.click(webDriver, By.cssSelector("[data-testid='greeting-text']")); Events.click(webDriver, By.cssSelector("[data-testid='menu-item-Logout']")); }