Skip to content

Commit

Permalink
add url assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
ch3yne committed Mar 20, 2024
1 parent 192778a commit d3cf71b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ public void testLinkToCatalogsPage() {
String name = "a_test_link";
createMetalakeAction(name);
metalakePage.clickMetalakeLink(name);
Assertions.assertTrue(metalakePage.verifyLinkToCatalogsPage());
Assertions.assertTrue(metalakePage.verifyLinkToCatalogsPage(name));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,19 @@ public boolean verifyQueryMetalake(String name) {
}
}

public boolean verifyLinkToCatalogsPage() {
public boolean verifyLinkToCatalogsPage(String name) {
try {
Thread.sleep(ACTION_SLEEP_MILLIS);
String xpath = "//*[@data-refer='metalake-name-link']";
WebElement nameLink = driver.findElement(By.xpath(xpath));
WebDriverWait wait = new WebDriverWait(driver, MAX_TIMEOUT);
wait.until(ExpectedConditions.elementToBeClickable(nameLink));
wait.until(ExpectedConditions.urlToBe(nameLink.getAttribute("href")));
Thread.sleep(ACTION_SLEEP_MILLIS);

if (!nameLink.getText().equals(name)) {
LOG.error("name link is not match");
return false;
}

return true;
} catch (Exception e) {
Expand Down

0 comments on commit d3cf71b

Please sign in to comment.