Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2394] feat(IT): Add metalake page to web e2e test (#2395)

CHEYNEddfc4cfd5fc0
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/MetalakePageTest.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/MetalakePageTest.java
index 4aed824277..1b3c525632 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/MetalakePageTest.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/MetalakePageTest.java
@@ -4,14 +4,109 @@
*/
package com.datastrato.gravitino.integration.test.web.ui;
+import com.datastrato.gravitino.integration.test.web.ui.Pages.MetalakePage;
import com.datastrato.gravitino.integration.test.web.ui.utils.AbstractWebIT;
import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class MetalakePageTest extends AbstractWebIT {
+ MetalakePage metalakePage = new MetalakePage();
+
+ // Create a metalake by name, set the default comment and properties.
+ public void createMetalakeAction(String name) {
+ metalakePage.createMetalakeBtn.click();
+ metalakePage.setMetalakeNameField(name);
+ metalakePage.setMetalakeCommentField("metalake comment");
+ metalakePage.addMetalakePropsBtn.click();
+ metalakePage.setMetalakeProps(0, "key1", "value1");
+ metalakePage.addMetalakePropsBtn.click();
+ metalakePage.setMetalakeProps(1, "key2", "value2");
+ metalakePage.submitHandleMetalakeBtn.click();
+ }
+
@Test
+ @Order(0)
public void homePage() {
String title = driver.getTitle();
Assertions.assertEquals("Gravitino", title);
}
+
+ @Test
+ @Order(1)
+ public void testCreateMetalake() {
+ String name = "metalake_name";
+ createMetalakeAction(name);
+ Assertions.assertTrue(metalakePage.verifyCreateMetalake(name));
+ }
+
+ @Test
+ @Order(2)
+ public void testViewMetalakeDetails() {
+ String name = "metalake_name";
+ metalakePage.clickViewMetalakeBtn(name);
+ Assertions.assertTrue(metalakePage.verifyShowMetalakeDetails(name));
+ }
+
+ @Test
+ @Order(3)
+ public void testEditMetalake() {
+ metalakePage.clickEditMetalakeBtn("metalake_name");
+ metalakePage.setMetalakeNameField("metalake_name_edited");
+ metalakePage.submitHandleMetalakeBtn.click();
+ Assertions.assertTrue(metalakePage.verifyEditedMetalake("metalake_name_edited"));
+ }
+
+ @Test
+ @Order(4)
+ public void testDeleteMetalake() {
+ metalakePage.clickDeleteMetalakeBtn("metalake_name_edited");
+ metalakePage.confirmDeleteBtn.click();
+ Assertions.assertTrue(metalakePage.verifyEmptyMetalake());
+ }
+
+ @Test
+ @Order(5)
+ public void testCreateMultipleMetalakes() {
+ int twoPagesCount = 11;
+
+ for (int i = 0; i < twoPagesCount; i++) {
+ String name = "metalake_" + (i + 1);
+ createMetalakeAction(name);
+ }
+
+ Assertions.assertTrue(metalakePage.verifyChangePagination());
+ }
+
+ @Test
+ @Order(6)
+ public void testQueryMetalake() {
+ String name = "query";
+ createMetalakeAction(name);
+ Assertions.assertTrue(metalakePage.verifyQueryMetalake(name));
+ }
+
+ @Test
+ @Order(7)
+ public void testCreateInvalidMetalake() {
+ String name = "1!@#$";
+ metalakePage.createMetalakeBtn.click();
+ metalakePage.setMetalakeNameField(name);
+ metalakePage.submitHandleMetalakeBtn.click();
+ Assertions.assertTrue(metalakePage.checkIsErrorName());
+ }
+
+ // https://github.com/datastrato/gravitino/issues/2512
+ // @Test
+ // @Order(7)
+ // public void testLinkToCatalogsPage() {
+ // String name = "a_link";
+ // createMetalakeAction(true, name);
+ // metalakePage.clickMetalakeLink(name);
+ // metalakePage.waitLinkElementDisplayed(name);
+ // Assertions.assertTrue(metalakePage.verifyLinkToCatalogsPage(name));
+ // }
}
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/Pages/MetalakePage.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/Pages/MetalakePage.java
new file mode 100644
index 0000000000..eba70953b0
--- /dev/null
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/Pages/MetalakePage.java
@@ -0,0 +1,298 @@
+/*
+ * Copyright 2024 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+package com.datastrato.gravitino.integration.test.web.ui.Pages;
+
+import com.datastrato.gravitino.integration.test.web.ui.utils.AbstractWebIT;
+import java.util.List;
+import java.util.Objects;
+import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.ui.ExpectedConditions;
+import org.openqa.selenium.support.ui.WebDriverWait;
+
+public class MetalakePage extends AbstractWebIT {
+
+ @FindBy(
+ xpath =
+ "//div[contains(@class, 'MuiDataGrid-main')]//div[contains(@class, 'MuiDataGrid-virtualScroller')]//div[@role='rowgroup']")
+ public WebElement dataViewer;
+
+ @FindBy(xpath = "//*[@id='createMetalakeBtn']")
+ public WebElement createMetalakeBtn;
+
+ @FindBy(xpath = "//*[@id='metalakeNameField']")
+ public WebElement metalakeNameField;
+
+ @FindBy(xpath = "//*[@id='metalakeCommentField']")
+ public WebElement metalakeCommentField;
+
+ @FindBy(xpath = "//*[@id='query-metalake']")
+ public WebElement queryMetalakeInput;
+
+ @FindBy(xpath = "//*[@id='submitHandleMetalake']")
+ public WebElement submitHandleMetalakeBtn;
+
+ @FindBy(xpath = "//button[@data-refer='confirm-delete']")
+ public WebElement confirmDeleteBtn;
+
+ @FindBy(xpath = "//div[@data-refer='details-drawer']")
+ public WebElement detailsDrawer;
+
+ @FindBy(xpath = "//h6[@data-refer='details-title']")
+ public WebElement detailsTitle;
+
+ @FindBy(xpath = "//button[@data-refer='close-details-btn']")
+ public WebElement closeDetailsBtn;
+
+ @FindBy(xpath = "//button[@data-refer='add-metalake-props']")
+ public WebElement addMetalakePropsBtn;
+
+ @FindBy(xpath = "//button[@aria-label='Go to next page']")
+ public WebElement nextPageBtn;
+
+ @FindBy(xpath = "//button[@aria-label='Go to previous page']")
+ public WebElement prevPageBtn;
+
+ public MetalakePage() {
+ PageFactory.initElements(driver, this);
+ }
+
+ public WebElement findElementByXPath(String xpath) {
+ return driver.findElement(By.xpath(xpath));
+ }
+
+ // ** comment for MetalakePageTest.java testLinkToCatalogsPage()
+ // public WebElement findElementByLink(String name) {
+ // String xpath = "//div[@data-field='name']//a[@href='/ui/metalakes?metalake=" + name + "']";
+ //
+ // return driver.findElement(By.xpath(xpath));
+ // }
+
+ public void setMetalakeNameField(String nameField) {
+ metalakeNameField.sendKeys(
+ Keys.chord(Keys.HOME, Keys.chord(Keys.SHIFT, Keys.END), Keys.DELETE));
+ metalakeNameField.clear();
+ metalakeNameField.sendKeys(nameField);
+ }
+
+ public void setMetalakeCommentField(String commentField) {
+ metalakeCommentField.sendKeys(
+ Keys.chord(Keys.HOME, Keys.chord(Keys.SHIFT, Keys.END), Keys.DELETE));
+ metalakeCommentField.clear();
+ metalakeCommentField.sendKeys(commentField);
+ }
+
+ public void setQueryInput(String queryInput) {
+ clearQueryInput();
+ queryMetalakeInput.sendKeys(queryInput);
+ }
+
+ public void clearQueryInput() {
+ queryMetalakeInput.sendKeys(
+ Keys.chord(Keys.HOME, Keys.chord(Keys.SHIFT, Keys.END), Keys.DELETE));
+ queryMetalakeInput.clear();
+ }
+
+ public void clickDeleteMetalakeBtn(String name) {
+ String xpath = "//button[@data-refer='delete-metalake-" + name + "']";
+ WebElement deleteMetalakeBtn = driver.findElement(By.xpath(xpath));
+ deleteMetalakeBtn.click();
+ }
+
+ public void clickViewMetalakeBtn(String name) {
+ String xpath = "//button[@data-refer='view-metalake-" + name + "']";
+ WebElement viewMetalakeBtn = driver.findElement(By.xpath(xpath));
+ viewMetalakeBtn.click();
+ }
+
+ public void clickEditMetalakeBtn(String name) {
+ String xpath = "//button[@data-refer='edit-metalake-" + name + "']";
+ WebElement editMetalakeBtn = driver.findElement(By.xpath(xpath));
+ editMetalakeBtn.click();
+ }
+
+ public void clickMetalakeLink(String name) {
+ String xpath = "//a[@href='/ui/metalakes?metalake=" + name + "']";
+ WebElement metalakeLink = driver.findElement(By.xpath(xpath));
+ WebDriverWait wait = new WebDriverWait(driver, 10);
+ wait.until(ExpectedConditions.elementToBeClickable(By.xpath(xpath)));
+ metalakeLink.click();
+ }
+
+ public void setMetalakeProps(int index, String key, String value) {
+ // Set the indexed props key
+ String keyPath = "//div[@data-refer='add-props-key-" + index + "']//input[@name='key']";
+ WebElement keyInput = driver.findElement(By.xpath(keyPath));
+ keyInput.sendKeys(key);
+
+ // Set the indexed props value
+ String valuePath = "//div[@data-refer='add-props-value-" + index + "']//input[@name='value']";
+ WebElement valueInput = driver.findElement(By.xpath(valuePath));
+ valueInput.sendKeys(value);
+ }
+
+ public boolean checkIsErrorName() {
+ String xpath = "//div[@data-refer='metalake-name-field']";
+ WebElement nameField = findElementByXPath(xpath);
+ List<WebElement> errorText =
+ nameField.findElements(By.xpath("//div[contains(@class, 'Mui-error')]"));
+
+ return !errorText.isEmpty();
+ }
+
+ // ** comment for MetalakePageTest.java testLinkToCatalogsPage()
+ // public void waitLinkElementDisplayed(String name) {
+ // int retry = 0;
+ // int sleepTimeMillis = 1_000;
+ //
+ // while (retry++ < 5) {
+ // try {
+ // WebElement ele = findElementByLink(name);
+ // Wait<WebDriver> wait =
+ // new FluentWait<>(driver)
+ // .withTimeout(Duration.ofSeconds(10))
+ // .pollingEvery(Duration.ofMillis(300))
+ // .ignoring(ElementNotInteractableException.class);
+ // wait.until(d -> ele.isDisplayed());
+ // Thread.sleep(sleepTimeMillis);
+ // } catch (Exception e) {
+ // LOG.error(e.getMessage(), e);
+ // }
+ // }
+ // }
+
+ public boolean verifyCreateMetalake(String name) {
+ try {
+ // Get the created metalake row element from DataGrid by name.
+ String rowPath = "//div[@data-id='" + name + "']";
+ WebElement createdMetalakeRow = driver.findElement(By.xpath(rowPath));
+ boolean isRow = createdMetalakeRow.isDisplayed();
+
+ // Get and verify the created metalake link from DataGrid row item by name.
+ String linkPath = "//div[@data-field='name']//a[@href='/ui/metalakes?metalake=" + name + "']";
+ WebElement createdMetalakeLink = driver.findElement(By.xpath(linkPath));
+ boolean isLink = createdMetalakeLink.isDisplayed();
+ boolean isText = Objects.equals(createdMetalakeLink.getText(), name);
+
+ return isRow && isLink && isText;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public boolean verifyEditedMetalake(String name) {
+ try {
+ String xpath = "//div[@data-field='name']//a[@href='/ui/metalakes?metalake=" + name + "']";
+ WebElement editedMetalakeLink = driver.findElement(By.xpath(xpath));
+
+ // Check if the link text is match with name
+ return Objects.equals(editedMetalakeLink.getText(), name);
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public boolean verifyShowMetalakeDetails(String name) {
+ try {
+ // Check the drawer css property value
+ detailsDrawer.isDisplayed();
+ String drawerVisible = detailsDrawer.getCssValue("visibility");
+ boolean isVisible = Objects.equals(drawerVisible, "visible");
+
+ // Check the created metalake name
+ String drawerTitle = detailsTitle.getText();
+ boolean isText = Objects.equals(drawerTitle, name);
+
+ return isVisible && isText;
+ } catch (Exception e) {
+ return false;
+ } finally {
+ closeDetailsBtn.click();
+ }
+ }
+
+ public boolean verifyEmptyMetalake() {
+ String xpath = "//div[contains(@class, 'MuiDataGrid-overlay')]";
+ WebElement noMetalakeRows = driver.findElement(By.xpath(xpath));
+
+ return Objects.equals(noMetalakeRows.getText(), "No rows");
+ }
+
+ public boolean verifyChangePagination() {
+ try {
+ if (!nextPageBtn.isEnabled()) {
+ return false;
+ }
+ nextPageBtn.click();
+
+ // Check if the previous page button is available
+ return prevPageBtn.isEnabled() && performPrevPageAction();
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ private boolean performPrevPageAction() {
+ try {
+ prevPageBtn.click();
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public boolean verifyQueryMetalake(String name) {
+ try {
+ setQueryInput(name);
+ List<WebElement> dataList = dataViewer.findElements(By.xpath(".//div[@data-field='name']"));
+
+ // Check if the text in the first row matches the search input
+ boolean isQueried = Objects.equals(dataList.get(0).getText(), name);
+
+ if (isQueried) {
+ clearQueryInput();
+
+ return true;
+ } else {
+ return false;
+ }
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ // ** comment for MetalakePageTest.java testLinkToCatalogsPage()
+ // public boolean verifyLinkToCatalogsPage(String name) {
+ // int sleepTimeMillis = 1_000;
+ // try {
+ // Thread.sleep(sleepTimeMillis);
+ // String xpath = "//a[@data-refer='metalake-name-link']";
+ // WebElement nameLink = driver.findElement(By.xpath(xpath));
+ //
+ // Wait<WebDriver> wait =
+ // new FluentWait<>(driver)
+ // .withTimeout(Duration.ofSeconds(10))
+ // .pollingEvery(Duration.ofMillis(300))
+ // .ignoring(ElementNotInteractableException.class);
+ // wait.until(d -> nameLink.isDisplayed());
+ //
+ // String url = driver.getCurrentUrl();
+ // boolean isUrl = url.contains("/ui/metalakes?metalake=" + name);
+ //
+ // return nameLink.isDisplayed() && isUrl;
+ // } catch (Exception e) {
+ // return false;
+ // } finally {
+ // // Back to homepage
+ // String xpath = "//*[@data-refer='back-home-btn']";
+ // WebElement backHomeBtn = driver.findElement(By.xpath(xpath));
+ // backHomeBtn.click();
+ // }
+ // }
+}
diff --git a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/AbstractWebIT.java b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/AbstractWebIT.java
index 2afe4be155..5571d6045b 100644
--- a/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/AbstractWebIT.java
+++ b/integration-test/src/test/java/com/datastrato/gravitino/integration/test/web/ui/utils/AbstractWebIT.java
@@ -15,7 +15,9 @@ import org.slf4j.LoggerFactory;
public class AbstractWebIT extends AbstractIT {
protected static final Logger LOG = LoggerFactory.getLogger(AbstractWebIT.class);
protected static WebDriver driver;
- protected static final long MAX_IMPLICIT_WAIT = 60;
+
+ // https://www.selenium.dev/documentation/webdriver/waits/#implicit-waits
+ protected static final long MAX_IMPLICIT_WAIT = 10;
@BeforeAll
public static void startUp() {
diff --git a/web/app/ui/CreateMetalakeDialog.js b/web/app/ui/CreateMetalakeDialog.js
index 4e95353f30..84add4fe8b 100644
--- a/web/app/ui/CreateMetalakeDialog.js
+++ b/web/app/ui/CreateMetalakeDialog.js
@@ -208,7 +208,7 @@ const CreateMetalakeDialog = props => {
<Icon icon='bx:x' />
</IconButton>
<Box className={'twc-mb-8 twc-text-center'}>
- <Typography className={'twc-mb-3'} variant='h5'>
+ <Typography className={'twc-mb-3'} variant='h5' data-refer='handle-metalake-title'>
{typeText} Metalake
</Typography>
</Box>
@@ -223,6 +223,8 @@ const CreateMetalakeDialog = props => {
render={({ field: { value, onChange } }) => (
<TextField
value={value}
+ id='metalakeNameField'
+ data-refer='metalake-name-field'
label='Name'
onChange={onChange}
placeholder=''
@@ -231,7 +233,9 @@ const CreateMetalakeDialog = props => {
)}
/>
{errors.name && (
- <FormHelperText className={'twc-text-error-main'}>{errors.name.message}</FormHelperText>
+ <FormHelperText className={'twc-text-error-main'} data-refer='metalake-name-field-error-text'>
+ {errors.name.message}
+ </FormHelperText>
)}
</FormControl>
</Grid>
@@ -245,6 +249,7 @@ const CreateMetalakeDialog = props => {
render={({ field: { value, onChange } }) => (
<TextField
value={value}
+ id='metalakeCommentField'
label='Comment'
multiline
rows={2}
@@ -257,7 +262,7 @@ const CreateMetalakeDialog = props => {
</FormControl>
</Grid>
- <Grid item xs={12}>
+ <Grid item xs={12} id='properties' data-refer='metalake-props-layout'>
<Typography className={'twc-mb-2'} variant='body2'>
Properties
</Typography>
@@ -265,7 +270,10 @@ const CreateMetalakeDialog = props => {
return (
<Grid item xs={12} key={index} className={'[&+&]:twc-mt-2'}>
<FormControl fullWidth>
- <Box className={'twc-flex twc-items-center twc-justify-between'}>
+ <Box
+ className={'twc-flex twc-items-center twc-justify-between'}
+ data-refer='metalake-props-wrapper'
+ >
<TextField
size='small'
name='key'
@@ -273,6 +281,7 @@ const CreateMetalakeDialog = props => {
value={item.key}
onChange={event => handleFormChange(index, event)}
error={item.hasDuplicateKey}
+ data-refer={`add-props-key-${index}`}
/>
<TextField
size='small'
@@ -280,6 +289,7 @@ const CreateMetalakeDialog = props => {
label='Value'
value={item.value}
onChange={event => handleFormChange(index, event)}
+ data-refer={`add-props-value-${index}`}
/>
<Box className={'twc-min-w-[40px]'}>
<IconButton onClick={() => removeFields(index)}>
@@ -307,6 +317,7 @@ const CreateMetalakeDialog = props => {
size='small'
onClick={addFields}
variant='outlined'
+ data-refer='add-metalake-props'
startIcon={<Icon icon='mdi:plus-circle-outline' />}
>
Add Property
@@ -315,7 +326,7 @@ const CreateMetalakeDialog = props => {
</Grid>
</DialogContent>
<DialogActions className={' twc-px-5 md:twc-px-15 twc-pb-5 md:twc-pb-[12.5 0.25 rem]'}>
- <Button variant='contained' type='submit'>
+ <Button variant='contained' type='submit' id='submitHandleMetalake'>
{typeText === 'Edit' ? 'Update' : typeText}
</Button>
<Button variant='outlined' className={'twc-ml-1'} onClick={handleClose} type='reset'>
diff --git a/web/app/ui/MetalakeList.js b/web/app/ui/MetalakeList.js
index 3c3adb7770..5fa7c083d4 100644
--- a/web/app/ui/MetalakeList.js
+++ b/web/app/ui/MetalakeList.js
@@ -107,6 +107,7 @@ const MetalakeList = () => {
dispatch(setFilteredMetalakes(filteredData))
}, [dispatch, store.metalakes, value])
+ /** @type {import('@mui/x-data-grid').GridColDef[]} */
const columns = [
{
flex: 0.2,
@@ -182,11 +183,12 @@ const MetalakeList = () => {
type: 'actions',
headerName: 'Actions',
field: 'actions',
- getActions: ({ row }) => [
+ getActions: ({ id, row }) => [
<GridActionsCellItem
key='details'
label='Details'
title='Details'
+ data-refer={`view-metalake-${row.name}`}
icon={<ViewIcon viewBox='0 0 24 22' />}
onClick={handleShowDetails(row)}
sx={{
@@ -199,6 +201,7 @@ const MetalakeList = () => {
key='edit'
label='Edit'
title='Edit'
+ data-refer={`edit-metalake-${row.name}`}
icon={<EditIcon />}
onClick={handleShowEditDialog(row)}
sx={{
@@ -212,6 +215,7 @@ const MetalakeList = () => {
icon={<DeleteIcon />}
label='Delete'
title='Delete'
+ data-refer={`delete-metalake-${row.name}`}
onClick={handleDeleteMetalake(row.name)}
sx={{
'& svg': {
@@ -238,7 +242,6 @@ const MetalakeList = () => {
<DataGrid
disableColumnSelector
disableDensitySelector
- slots={{ toolbar: TableToolbar }}
slotProps={{
toolbar: {
printOptions: { disableToolbarButton: true },
diff --git a/web/app/ui/TableHeader.js b/web/app/ui/TableHeader.js
index 3e73a90c58..e2d9c8edcb 100644
--- a/web/app/ui/TableHeader.js
+++ b/web/app/ui/TableHeader.js
@@ -19,8 +19,15 @@ const TableHeader = props => {
return (
<Box className={'twc-pr-5 twc-pb-4 twc-pt-4 twc-flex twc-flex-wrap twc-items-center twc-justify-end'}>
<Box className={'twc-flex twc-items-center twc-flex-1 twc-h-full'} id='filter-panel' />
- <TextField size='small' value={value} placeholder='Query Name' onChange={e => handleFilter(e.target.value)} />
+ <TextField
+ id='query-metalake'
+ size='small'
+ value={value}
+ placeholder='Query Name'
+ onChange={e => handleFilter(e.target.value)}
+ />
<Button
+ id='createMetalakeBtn'
className={'twc-ml-2'}
variant='contained'
color='primary'
diff --git a/web/app/ui/metalakes/MetalakePath.js b/web/app/ui/metalakes/MetalakePath.js
index 7e9cde6eb7..d01129734d 100644
--- a/web/app/ui/metalakes/MetalakePath.js
+++ b/web/app/ui/metalakes/MetalakePath.js
@@ -52,6 +52,7 @@ const MetalakePath = props => {
href={metalakeUrl}
onClick={event => handleClick(event, metalakeUrl)}
underline='hover'
+ data-refer='metalake-name-link'
>
<Text>{metalake}</Text>
</MUILink>
diff --git a/web/app/ui/metalakes/RightContent.js b/web/app/ui/metalakes/RightContent.js
index c1b1b4f0c7..8d9919b0dd 100644
--- a/web/app/ui/metalakes/RightContent.js
+++ b/web/app/ui/metalakes/RightContent.js
@@ -41,7 +41,7 @@ const RightContent = props => {
<Box className={`twc-flex twc-items-center`}>
<Box className={`twc-flex twc-items-center twc-justify-between`}>
<Box className={`twc-flex twc-items-center`}>
- <IconButton color='primary' component={Link} href='/' sx={{ mr: 2 }}>
+ <IconButton color='primary' component={Link} href='/' sx={{ mr: 2 }} data-refer='back-home-btn'>
<Icon icon='mdi:arrow-left' />
</IconButton>
<MetalakePath routeParams={routeParams} />
@@ -51,7 +51,12 @@ const RightContent = props => {
{page === 'metalakes' && (
<Box className={`twc-flex twc-items-center`}>
- <Button variant='contained' startIcon={<Icon icon='mdi:plus-box' />} onClick={handleCreateCatalog}>
+ <Button
+ variant='contained'
+ startIcon={<Icon icon='mdi:plus-box' />}
+ onClick={handleCreateCatalog}
+ data-refer='create-catalog-btn'
+ >
Create Catalog
</Button>
<CreateCatalogDialog open={open} setOpen={setOpen} routeParams={routeParams} />
diff --git a/web/components/ConfirmDeleteDialog.js b/web/components/ConfirmDeleteDialog.js
index 964e6f7547..68d9e54fc6 100644
--- a/web/components/ConfirmDeleteDialog.js
+++ b/web/components/ConfirmDeleteDialog.js
@@ -27,7 +27,12 @@ const ConfirmDeleteDialog = props => {
</Box>
</DialogContent>
<DialogActions className={'twc-justify-center twc-px-5 twc-pb-8'}>
- <Button variant='contained' className={'twc-mr-2'} onClick={() => handleConfirmDeleteSubmit()}>
+ <Button
+ variant='contained'
+ data-refer='confirm-delete'
+ className={'twc-mr-2'}
+ onClick={() => handleConfirmDeleteSubmit()}
+ >
Delete
</Button>
<Button variant='outlined' color='secondary' onClick={() => handleClose()}>
diff --git a/web/components/DetailsDrawer.js b/web/components/DetailsDrawer.js
index 343ceabd21..d267497af9 100644
--- a/web/components/DetailsDrawer.js
+++ b/web/components/DetailsDrawer.js
@@ -68,6 +68,7 @@ const DetailsDrawer = props => {
return (
<Drawer
+ data-refer='details-drawer'
open={openDrawer}
anchor='right'
variant='temporary'
@@ -91,7 +92,7 @@ const DetailsDrawer = props => {
}}
>
<Typography variant='h6'>Details</Typography>
- <IconButton size='small' onClick={handleClose} sx={{ color: 'text.primary' }}>
+ <IconButton size='small' data-refer='close-details-btn' onClick={handleClose} sx={{ color: 'text.primary' }}>
<Icon icon='bx:x' fontSize={20} />
</IconButton>
</Box>
@@ -106,6 +107,7 @@ const DetailsDrawer = props => {
sx={{
borderBottom: theme => `1px solid ${theme.palette.divider}`
}}
+ data-refer='details-title'
>
{drawerData.name}
</Typography>