-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2394] feat(IT): Add metalake page to web e2e test #2395
Conversation
9f28ef2
to
def3500
Compare
@ch3yne Please fix Github Action failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LauraXia123 Please help review this PR, Thanks!
8aef514
to
72e1f14
Compare
boolean status = metalakePage.verifyIsCreatedMetalake(); | ||
|
||
if (status) { | ||
LOG.info("create metalake successful"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean status = metalakePage.verifyQueryMetalake(); | ||
|
||
if (status) { | ||
LOG.info("query metalake successful"); | ||
} else { | ||
Assertions.fail("query metalake failed"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change these code to
Assertions.assertTrue(metalakePage.verifyQueryMetalake());
and other place codes.
|
||
public void queryMetalakeAction() { | ||
LOG.info("test query metalake action started"); | ||
enterQueryInput("tes"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what mean is tes
?
} | ||
|
||
public void createManyMetalakesAction() { | ||
LOG.info("test create many metalakes action started"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all LOG.info() and other place codes.
public void clickAddPropertyBtn() { | ||
LOG.info("click add metalake property button"); | ||
this.addMetalakePropertyBtn.click(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function only have one line code, call clickAddPropertyBtn()
or this.addMetalakePropertyBtn.click()
is same.
and clickNextPageBtn()
, clickPrevPageBtn()
try { | ||
List<WebElement> dataList = dataViewer.findElements(By.xpath(".//div[@data-field='name']")); | ||
|
||
if (dataList.size() == 9) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is 9?
805c43e
to
428d7ae
Compare
String rowPath = "//div[@data-id='" + name + "']"; | ||
WebElement createdMetalakeRow = driver.findElement(By.xpath(rowPath)); | ||
boolean isRow = createdMetalakeRow.isDisplayed(); | ||
|
||
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comments to describe these codes.
int retry = 0; | ||
int sleepTimeMillis = 1_000; | ||
|
||
while (retry++ < 3) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3 second too short, Please change to 5
.
metalakeDetailsDrawer.isDisplayed(); | ||
String drawerVisible = metalakeDetailsDrawer.getCssValue("visibility"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's too sketchy to just check if it's visible or not.
Don't we need check value on each element?
no comments for me |
@@ -74,7 +84,7 @@ public void testCreateMultipleMetalakes() { | |||
|
|||
for (int i = 0; i < towPagesCount; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What mean is towPagesCount
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default counts of one page is 10, I need create over 11 counts of metalakes to make the Go to next page
available.
} finally { | ||
// Back to homepage | ||
String xpath = "//button[@data-refer='back-home-btn']"; | ||
WebElement backHomeBtn = driver.findElement(By.xpath(xpath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether need define backHomeBtn
to be a MetalakePage Class vaiable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the backHomeBtn Class in CatalogsPage.java, I will modify when the PR is submited.
@@ -15,7 +15,7 @@ | |||
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; | |||
protected static final long MAX_IMPLICIT_WAIT = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need reduce wait time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When searching for elements, this implicit wait time is too long, which will increase the time it takes for testing.
List<WebElement> errorText = | ||
nameField.findElements(By.xpath("//div[contains(@class, 'Mui-error')]")); | ||
|
||
return !errorText.isEmpty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use Strings.isEmpty()
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the element function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What changes were proposed in this pull request?
Add web e2e test to homepage.
Why are the changes needed?
Fix: #2394
Does this PR introduce any user-facing change?
N/A
How was this patch tested?
N/A