mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-09 15:56:33 +00:00
Error handling and locator changes (#3806)
* Error handling and locator changes
This commit is contained in:
parent
3b50eb9e52
commit
db0a52875b
@ -90,6 +90,8 @@ public class Common {
|
||||
By reviewCount = By.cssSelector("[data-testid='user-card-container']");
|
||||
By tagsCount = By.xpath("(//div[@data-testid='tags']/div)");
|
||||
By addGlossaryReviewer = By.cssSelector("[data-testid='add-new-reviewer']");
|
||||
By connectionConfig = By.cssSelector("[data-testid='Connection Config']");
|
||||
By ingestion = By.cssSelector("[data-testid='Ingestions']");
|
||||
|
||||
public List<WebElement> versionRadioButton() {
|
||||
return webDriver.findElements(versionRadioButton);
|
||||
|
@ -39,13 +39,11 @@ public class ExplorePage {
|
||||
By updatedDescription = By.xpath("(//div[@data-testid=\"description-text\"])[1]");
|
||||
By shopifyCheckbox = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"shopify\"]");
|
||||
By tagSpecialCategoryCheckbox = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"PersonalData.SpecialCategory\"]");
|
||||
By tierTier3Checkbox = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"Tier.Tier3\"]");
|
||||
By selectedCheckbox =
|
||||
By.xpath(
|
||||
"//span[@class=\"tw-py-px tw-px-1 tw-ml-1 tw-border tw-rounded tw-text-xs tw-min-w-badgeCount tw-text-center tw-bg-primary tw-text-white tw-border-none tw-py-0 tw-px-0\"]");
|
||||
By kafka = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"Kafka\"]");
|
||||
By superset = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"Superset\"]");
|
||||
By airflow = By.xpath("//input[@data-testid=\"checkbox\"][@id=\"Airflow\"]");
|
||||
By tierTier3Checkbox = By.xpath("//input[@data-testid='checkbox'][@id='Tier:Tier3']");
|
||||
By selectedCheckbox = By.xpath("//label[@data-testid='filter-container-Superset']/span");
|
||||
By kafka = By.cssSelector("[data-testid='checkbox'][id='Kafka']");
|
||||
By superset = By.cssSelector("[data-testid='checkbox'][id='Superset']");
|
||||
By airflow = By.xpath("//input[@data-testid='checkbox'][@id='Airflow']");
|
||||
|
||||
public List<WebElement> serviceName() {
|
||||
return webDriver.findElements(serviceName);
|
||||
|
@ -19,6 +19,8 @@ public class GlossaryPage {
|
||||
By saveGlossaryTerm = By.cssSelector("[data-testid='save-glossary-term']");
|
||||
By saveTermReviewer = By.cssSelector("[data-testid='saveButton']");
|
||||
By saveAssociatedTag = By.xpath("//button[@data-testid='saveAssociatedTag']");
|
||||
By addGlossary = By.cssSelector("[data-testid='add-category']");
|
||||
By reviewers = By.cssSelector("[data-testid='Reviewers']");
|
||||
|
||||
public By checkboxAddUser(int index) {
|
||||
return By.xpath(
|
||||
|
@ -17,7 +17,7 @@ public class PipelineDetails {
|
||||
By selectedTag = By.xpath("//span[@class='tw-no-underline hover:tw-no-underline tw-py-0.5 tw-px-2 tw-pl-2 tw-pr-1']");
|
||||
By editTaskDescription = By.xpath("//div[@data-testid='description']/span/span");
|
||||
By descriptionBox = By.xpath("(//div[@data-testid='description'])[2]");
|
||||
By lineage = By.xpath("//button[@data-testid='tab'][@id='lineage']");;
|
||||
By lineage = By.cssSelector("[data-testid='Lineage']");
|
||||
By lineageComponents = By.xpath("//div[@class=\"tw-relative nowheel \"]");
|
||||
By sideDrawerLineage = By.xpath("//header[@class=\"tw-flex tw-justify-between\"]");
|
||||
|
||||
|
@ -13,24 +13,24 @@ import org.openqa.selenium.WebElement;
|
||||
public class TableDetails {
|
||||
@Nonnull WebDriver webDriver;
|
||||
|
||||
By manage = By.xpath("//button[@data-testid=\"tab\"][@id=\"manage\"]");
|
||||
By manage = By.cssSelector("[data-testid='Manage']");
|
||||
By owner = By.cssSelector("button[data-testid=\"owner-dropdown\"]");
|
||||
By users = By.xpath("//div[@data-testid='dropdown-list']//div[2]//button[2]");
|
||||
By selectUser = By.xpath("//div[@data-testid=\"list-item\"]");
|
||||
By saveManage = By.cssSelector("[data-testid='saveManageTab']");
|
||||
By follow = By.cssSelector("button[data-testid='follow-button']");
|
||||
By schema = By.xpath("//button[@data-testid=\"tab\"][[@id=\"schema\"]]");;
|
||||
By lineage = By.xpath("//button[@data-testid=\"tab\"][@id=\"lineage\"]");;
|
||||
By schema = By.xpath("[data-testid='Schema']");;
|
||||
By lineage = By.cssSelector("[data-testid='Lineage']");;
|
||||
By lineageComponents = By.xpath("//div[@class=\"tw-relative nowheel \"]");
|
||||
By profiler = By.xpath("//button[@data-testid=\"tab\"][@id=\"profiler\"]");;
|
||||
By sampleData = By.xpath("//button[@data-testid=\"tab\"][@id=\"sampleData\"]");;
|
||||
By profiler = By.cssSelector("[data-testid='Profiler']");
|
||||
By sampleData = By.cssSelector("[data-testid='Sample Data']");;
|
||||
By selectTier1 = By.xpath("(//div[@data-testid='card-list'])[1]");
|
||||
By tier1 = By.xpath("(/h4[@class='tw-text-base tw-mb-0']");
|
||||
By addTagTextBox = By.xpath("//input[@data-testid='associatedTagName']");
|
||||
By selectTag = By.xpath("//div[@data-testid=\"list-item\"][2]");
|
||||
By saveTag = By.xpath("//button[@data-testid=\"saveAssociatedTag\"]");
|
||||
By tagName = By.xpath("(//div[@data-testid=\"tag-container\"])[1]");
|
||||
By removeTag = By.xpath("//span[@data-testid=\"remove\"]");
|
||||
By removeTag = By.xpath("//span[@data-testid='remove']");
|
||||
By editDescriptionButton = By.xpath("//button[@data-testid= 'edit-description']");
|
||||
By editDescriptionBox = By.xpath("//div[@data-testid='enterDescription']/div/div[2]/div/div/div/div/div/div");
|
||||
By saveTableDescription = By.xpath("//button[@data-testid=\"save\"]");
|
||||
@ -53,13 +53,46 @@ public class TableDetails {
|
||||
By columnDescription = By.xpath("(//div[@id='column-description-3'])[1]");
|
||||
By joinedTables = By.xpath("(//div[@data-testid='frequently-joined-columns']/span/a)");
|
||||
By joinedColumns = By.xpath("(//div[@data-testid='frequently-joined-columns']/span/a)");
|
||||
By sampleDataTable = By.xpath("//table[@data-testid=\"sample-data-table\"]");
|
||||
By sampleDataTable = By.xpath("//table[@data-testid='sample-data-table']");
|
||||
By columnTags = By.xpath("(//div[@data-testid='tag-conatiner'])[1]");
|
||||
By queries = By.cssSelector("[data-testid='Queries']");
|
||||
By openSidePanel = By.xpath("//p[@class='link-text tw-flex-none tw-ml-2']");
|
||||
By conversationBox = By.xpath("//div[@class='ql-editor ql-blank']");
|
||||
By sendButton = By.cssSelector("[data-testid='send-button']");
|
||||
By openConversationThread = By.xpath("//span[@class='tw-flex']");
|
||||
By addConversation = By.cssSelector("[data-testid='add-new-conversation']");
|
||||
By activityFeed = By.cssSelector("[data-testid='tab'][id='activityFeed']");
|
||||
By mainMessageReply = By.cssSelector("[data-testid=\"main-message-reply-button\"]");
|
||||
By quickReply = By.cssSelector("[data-testid=\"quick-reply-button\"]");
|
||||
By threadHeader = By.cssSelector("[data-testid='thread0']");
|
||||
By dataQuality = By.cssSelector("[data-testid='Data Quality']");
|
||||
By addTest = By.cssSelector("[data-testid=\"add-new-test-button\"]");
|
||||
By tableTest = By.xpath("//div[@data-testid=\"list-item\"][@id=\"menu-item-0\"]");
|
||||
By columnTest = By.xpath("//div[@data-testid=\"list-item\"][@id=\"menu-item-1\"]");
|
||||
By value = By.cssSelector("[data-testid=\"value\"]");
|
||||
By saveTest = By.xpath("//button[@data-testid='save-test']");
|
||||
By selectTableTest = By.cssSelector("[data-testid='tableTestType']");
|
||||
By selectColumn = By.cssSelector("[data-testid=\"columnName\"]");
|
||||
By selectColumnTest = By.cssSelector("[data-testid=\"columTestType\"]");
|
||||
By regex = By.cssSelector("[data-testid='regex']");
|
||||
By deleteTests = By.cssSelector("[data-testid='delete']");
|
||||
By deleteSave = By.cssSelector("[data-testid='save-button']");
|
||||
By dismissToast = By.cssSelector("[data-testid='dismiss']");
|
||||
By lineageNode = By.cssSelector("[data-testid='lineage-entity']");
|
||||
By checkTabs = By.cssSelector("[data-testid='tab']");
|
||||
By addTagConversationThread = By.cssSelector("[data-testid='tag-thread']");
|
||||
By addDescriptionConversationThread = By.cssSelector("[data-testid='start-description-thread']");
|
||||
By openTagConversationThread = By.cssSelector("[data-testid='tag-thread']");
|
||||
By startTagConversation = By.cssSelector("[data-testid='start-tag-thread']");
|
||||
|
||||
public List<WebElement> versionDetailsGrid() {
|
||||
return webDriver.findElements(versionDetailsGrid);
|
||||
}
|
||||
|
||||
public List<WebElement> checkTabs() {
|
||||
return webDriver.findElements(checkTabs);
|
||||
}
|
||||
|
||||
public List<WebElement> versionRadioButton() {
|
||||
return webDriver.findElements(versionRadioButton);
|
||||
}
|
||||
@ -79,4 +112,8 @@ public class TableDetails {
|
||||
public boolean schemaTableIsDisplayed() {
|
||||
return webDriver.findElement(schemaTable).isDisplayed();
|
||||
}
|
||||
|
||||
public By select(String user) {
|
||||
return By.xpath("//li[@data-value='" + user + "']");
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ public class TopicDetails {
|
||||
By.xpath("//span[@class=\"tw-no-underline hover:tw-no-underline tw-py-0.5 tw-px-2 tw-pl-2 tw-pr-1\"]");
|
||||
By breadCrumbTags = By.xpath("//div[@data-testid='breadcrumb-tags']/div");
|
||||
By editDescriptionButton = By.xpath("//button[@data-testid=\"edit-description\"]");
|
||||
By config = By.xpath("(//button[@data-testid = \"tab\"])[2]");
|
||||
By manage = By.xpath("(//button[@data-testid = \"tab\"])[3]");
|
||||
By config = By.cssSelector("[data-testid = 'Config']");
|
||||
By manage = By.cssSelector("[data-testid ='Manage']");
|
||||
By topicName = By.linkText("orders");
|
||||
By ownerName = By.xpath("//div[@data-testid='list-item']");
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class CommonTests {
|
||||
// actions.moveToElement(webDriver.findElement(common.editAssociatedTagButton())).perform();
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "PersonalData.Personal");
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "PersonalData:Personal");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "User.FacePhoto");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
@ -96,7 +96,7 @@ public class CommonTests {
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
Object tagCount = webDriver.findElements(common.containsText("#PersonalData.Personal")).size();
|
||||
Object tagCount = webDriver.findElements(common.containsText("#PersonalData:Personal")).size();
|
||||
Assert.assertEquals(tagCount, 1);
|
||||
}
|
||||
|
||||
@ -332,6 +332,7 @@ public class CommonTests {
|
||||
@Test
|
||||
@Order(15)
|
||||
public void tagFilterCountCheck() throws InterruptedException {
|
||||
int count = 0;
|
||||
openHomePage();
|
||||
Events.sendKeys(webDriver, common.searchBar(), tableName);
|
||||
Events.click(webDriver, common.searchSuggestion());
|
||||
@ -339,26 +340,29 @@ public class CommonTests {
|
||||
// actions.moveToElement(webDriver.findElement(common.editAssociatedTagButton())).perform();
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "P");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
count = count + 1;
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
for (int i = 0; i <= 1; i++) {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "U");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
count = count + 1;
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Object tagsCount = webDriver.findElements(common.tagCount()).size();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.explore());
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.viewMore());
|
||||
Object tagsFilterCount = webDriver.findElements(common.tagFilterCount()).size();
|
||||
Assert.assertEquals(tagsFilterCount.toString(), tagsCount.toString());
|
||||
Assert.assertEquals(tagsFilterCount.toString(), count);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openmetadata.catalog.selenium.pages.common;
|
||||
|
||||
import java.util.Optional;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.openqa.selenium.devtools.DevTools;
|
||||
import org.openqa.selenium.devtools.v95.fetch.Fetch;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class Interceptor {
|
||||
static DevTools devTools;
|
||||
|
||||
public Interceptor(DevTools devTools) {
|
||||
Interceptor.devTools = devTools;
|
||||
}
|
||||
|
||||
public void interceptor(String content, String replaceContent) {
|
||||
devTools.createSession();
|
||||
devTools.send(Fetch.enable(Optional.empty(), Optional.empty()));
|
||||
devTools.addListener(
|
||||
Fetch.requestPaused(),
|
||||
request -> {
|
||||
if (request.getRequest().getUrl().contains(content)) {
|
||||
String mockedUrl = request.getRequest().getUrl().replace(content, replaceContent);
|
||||
devTools.send(
|
||||
Fetch.continueRequest(
|
||||
request.getRequestId(),
|
||||
Optional.of(mockedUrl),
|
||||
Optional.of(request.getRequest().getMethod()),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
Optional.empty()));
|
||||
} else {
|
||||
devTools.send(
|
||||
Fetch.continueRequest(
|
||||
request.getRequestId(),
|
||||
Optional.of(request.getRequest().getUrl()),
|
||||
Optional.of(request.getRequest().getMethod()),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
Optional.empty()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -109,7 +109,7 @@ public class PaginationAndFilterTest {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.selectOverview("tables"));
|
||||
Events.click(webDriver, common.selectFilterExplore("Tier.Tier3"));
|
||||
Events.click(webDriver, common.selectFilterExplore("Tier:Tier3"));
|
||||
try {
|
||||
WebElement dataFound = wait.until(ExpectedConditions.presenceOfElementLocated(common.searchResults()));
|
||||
if (dataFound.isDisplayed()) {
|
||||
@ -184,9 +184,9 @@ public class PaginationAndFilterTest {
|
||||
if (viewMore.isDisplayed()) {
|
||||
Events.click(webDriver, common.viewMore());
|
||||
}
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData.Personal"));
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData:Personal"));
|
||||
} catch (TimeoutException | NoSuchElementException e) {
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData.Personal"));
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData:Personal"));
|
||||
}
|
||||
Events.click(webDriver, common.selectFilterExplore("shopify"));
|
||||
Thread.sleep(2000);
|
||||
|
@ -58,11 +58,10 @@ public class PostIngestionTests {
|
||||
public void setOwner() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.headerItem("explore"));
|
||||
Events.click(webDriver, common.entityTabIndex(3));
|
||||
Thread.sleep(waitTime);
|
||||
Events.sendKeys(webDriver, common.searchBar(), dashboard);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("sample_superset34"));
|
||||
Events.click(webDriver, common.entityTabIndex(4));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("sample_superset:34"));
|
||||
Events.click(webDriver, common.manage());
|
||||
Events.click(webDriver, common.ownerDropdown());
|
||||
Events.sendKeys(webDriver, common.ownerSearchBox(), "Cloud");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
@ -77,8 +76,8 @@ public class PostIngestionTests {
|
||||
Events.click(webDriver, common.headerItem("explore"));
|
||||
Thread.sleep(waitTime);
|
||||
Events.sendKeys(webDriver, common.searchBar(), dashboard);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("sample_superset34"));
|
||||
Events.click(webDriver, common.entityTabIndex(4));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("sample_superset:34"));
|
||||
Events.click(webDriver, common.manage());
|
||||
Events.click(webDriver, common.containsText("Cloud_Infra"));
|
||||
}
|
||||
}
|
||||
|
@ -81,11 +81,11 @@ public class UiExceptionHandling {
|
||||
|
||||
@Test
|
||||
public void exceptionCheckForUserList() {
|
||||
interceptor("users", "testing");
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.headerSettings());
|
||||
interceptor("/api/v1/teams", "/api/v1/testing");
|
||||
Events.click(webDriver, common.headerSettingsMenu("Users"));
|
||||
Events.click(webDriver, common.containsText("Request failed with status code 400"));
|
||||
Events.click(webDriver, common.containsText("Error while fetching teams!"));
|
||||
Events.click(webDriver, common.closeErrorMessage());
|
||||
// Assert.assertEquals(400, 400);
|
||||
}
|
||||
@ -144,7 +144,7 @@ public class UiExceptionHandling {
|
||||
Events.sendKeys(webDriver, common.addDescriptionString(), faker.address().toString());
|
||||
interceptor("services/databaseServices", "services/testing");
|
||||
Events.click(webDriver, common.editDescriptionSaveButton());
|
||||
Events.click(webDriver, common.containsText("Request failed with status code 500"));
|
||||
Events.click(webDriver, common.containsText("Error while updating description!"));
|
||||
Events.click(webDriver, common.closeErrorMessage());
|
||||
// Assert.assertEquals(500, 500);
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ public class DashboardServiceTestPage {
|
||||
openDashboardServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("connectionConfig"));
|
||||
Events.click(webDriver, common.connectionConfig());
|
||||
Events.sendKeys(webDriver, dashboardServicePage.editDashboardServiceUrl(), "1");
|
||||
Events.sendKeys(webDriver, common.serviceUsername(), "1");
|
||||
Events.sendKeys(webDriver, common.servicePassword(), "1");
|
||||
|
@ -137,7 +137,7 @@ public class DatabaseServicePageTest {
|
||||
openDatabaseServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("ingestions"));
|
||||
Events.click(webDriver, common.ingestion());
|
||||
try {
|
||||
WebElement runIngestion =
|
||||
wait.until(ExpectedConditions.presenceOfElementLocated(databaseServicePage.runIngestion()));
|
||||
@ -173,7 +173,7 @@ public class DatabaseServicePageTest {
|
||||
openDatabaseServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("connectionConfig"));
|
||||
Events.click(webDriver, common.connectionConfig());
|
||||
Events.sendKeys(webDriver, common.serviceUsername(), "1");
|
||||
Events.sendKeys(webDriver, common.servicePassword(), "1");
|
||||
Events.sendKeys(webDriver, common.databaseName(), "1");
|
||||
|
@ -277,7 +277,7 @@ class Explore {
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
void checkRandomDashboardCount() {
|
||||
void checkRandomDashboardCount() throws InterruptedException {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.click(webDriver, explorePage.dashboard());
|
||||
|
@ -218,7 +218,7 @@ public class GlossaryPageTest {
|
||||
void addTermReviewer() throws InterruptedException {
|
||||
openGlossaryPage();
|
||||
Events.click(webDriver, common.containsText(termName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("reviewers"));
|
||||
Events.click(webDriver, glossary.reviewers());
|
||||
Events.click(webDriver, common.addGlossaryReviewer());
|
||||
Events.click(webDriver, glossary.checkboxAddUser(3));
|
||||
Events.click(webDriver, glossary.saveTermReviewer());
|
||||
@ -232,7 +232,7 @@ public class GlossaryPageTest {
|
||||
void deleteTermReviewer() throws InterruptedException {
|
||||
openGlossaryPage();
|
||||
Events.click(webDriver, common.containsText(termName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("reviewers"));
|
||||
Events.click(webDriver, glossary.reviewers());
|
||||
Thread.sleep(waitTime);
|
||||
actions.moveToElement(webDriver.findElement(common.removeAssociatedTag())).perform();
|
||||
Events.click(webDriver, common.removeAssociatedTag());
|
||||
@ -246,7 +246,7 @@ public class GlossaryPageTest {
|
||||
void removeAddedReviewersToTerm() throws InterruptedException {
|
||||
openGlossaryPage();
|
||||
Events.click(webDriver, common.containsText(termName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("reviewers"));
|
||||
Events.click(webDriver, glossary.reviewers());
|
||||
Events.click(webDriver, common.addGlossaryReviewer());
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
Events.click(webDriver, glossary.checkboxAddUser(i));
|
||||
|
@ -112,7 +112,7 @@ public class MessagingServicePageTest {
|
||||
openMessagingServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("connectionConfig"));
|
||||
Events.click(webDriver, common.connectionConfig());
|
||||
Events.sendKeys(webDriver, messagingServicePage.messagingServiceBrokerUrl(), "1");
|
||||
Events.sendKeys(webDriver, messagingServicePage.messagingServiceSchemaRegistry(), "1");
|
||||
Events.click(webDriver, common.saveConnectionConfig());
|
||||
@ -124,7 +124,7 @@ public class MessagingServicePageTest {
|
||||
openMessagingServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("connectionConfig"));
|
||||
Events.click(webDriver, common.connectionConfig());
|
||||
Events.sendKeys(webDriver, messagingServicePage.messagingServiceBrokerUrl(), "1");
|
||||
Events.sendKeys(webDriver, messagingServicePage.messagingServiceSchemaRegistry(), "1");
|
||||
Events.click(webDriver, common.saveConnectionConfig());
|
||||
|
@ -132,7 +132,7 @@ public class MyDataPageTest {
|
||||
Events.click(webDriver, myDataPage.closeWhatsNew());
|
||||
wait.until(ExpectedConditions.elementToBeClickable(myDataPage.searchBox())); // Search bar/dim
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), sendkeys); // Search bar/dim
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcp:shopify:dim_address"));
|
||||
Thread.sleep(1000);
|
||||
WebElement tableName =
|
||||
tableDetails
|
||||
@ -222,7 +222,7 @@ public class MyDataPageTest {
|
||||
Events.click(webDriver, myDataPage.closeWhatsNew());
|
||||
Events.click(webDriver, myDataPage.tables());
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), table);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcp:shopify:dim_address"));
|
||||
Events.click(webDriver, tableDetails.manage());
|
||||
Events.click(webDriver, tableDetails.owner()); // Owner
|
||||
Events.click(webDriver, tableDetails.users());
|
||||
@ -248,7 +248,7 @@ public class MyDataPageTest {
|
||||
Events.click(webDriver, myDataPage.closeWhatsNew());
|
||||
Events.click(webDriver, myDataPage.tables());
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), table);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcp:shopify:dim_address"));
|
||||
String follow = webDriver.findElement(tableDetails.follow()).getText();
|
||||
if (follow.equals("Unfollow")) {
|
||||
Events.click(webDriver, tableDetails.follow());
|
||||
@ -277,7 +277,7 @@ public class MyDataPageTest {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
Events.click(webDriver, myDataPage.closeWhatsNew());
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), table);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcp:shopify:dim_address"));
|
||||
Events.click(webDriver, myDataPage.home());
|
||||
webDriver.navigate().refresh();
|
||||
String table = webDriver.findElement(myDataPage.recentlyViewed()).getText();
|
||||
|
@ -122,7 +122,7 @@ public class PipelineServiceTestPage {
|
||||
openPipelineServicePage();
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("connectionConfig"));
|
||||
Events.click(webDriver, common.connectionConfig());
|
||||
Events.sendKeys(webDriver, pipelineServicePage.pipelineServiceUrl(), "1");
|
||||
Events.click(webDriver, common.saveConnectionConfig());
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class TableDetailsPageTest {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), tableName);
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcp:shopify:dim_address"));
|
||||
Events.click(webDriver, tableDetails.profiler());
|
||||
Assert.assertTrue(tableDetails.schemaTableIsDisplayed());
|
||||
Events.click(webDriver, tableDetails.lineage());
|
||||
|
@ -0,0 +1,379 @@
|
||||
package org.openmetadata.catalog.selenium.pages.tableDetails;
|
||||
|
||||
import com.github.javafaker.Faker;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.openmetadata.catalog.selenium.events.Events;
|
||||
import org.openmetadata.catalog.selenium.objectRepository.Common;
|
||||
import org.openmetadata.catalog.selenium.objectRepository.TableDetails;
|
||||
import org.openmetadata.catalog.selenium.pages.common.Interceptor;
|
||||
import org.openmetadata.catalog.selenium.properties.Property;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.devtools.DevTools;
|
||||
import org.openqa.selenium.interactions.Actions;
|
||||
import org.openqa.selenium.support.ui.Select;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.testng.Assert;
|
||||
|
||||
@Slf4j
|
||||
@Order(21)
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
public class TableDetailsUIErrorHandling {
|
||||
|
||||
static ChromeDriver webDriver;
|
||||
static Common common;
|
||||
static TableDetails tableDetails;
|
||||
static DevTools devTools;
|
||||
static Interceptor interceptor;
|
||||
static String url = Property.getInstance().getURL();
|
||||
static Actions actions;
|
||||
static WebDriverWait wait;
|
||||
static Faker faker = new Faker();
|
||||
static String serviceName = faker.name().firstName();
|
||||
String webDriverInstance = Property.getInstance().getWebDriver();
|
||||
String webDriverPath = Property.getInstance().getWebDriverPath();
|
||||
static By toastMessage = By.cssSelector("[data-testid='toast']");
|
||||
List<WebElement> checkTabs = new ArrayList<>();
|
||||
WebElement explore;
|
||||
WebElement headerSettings;
|
||||
WebElement version;
|
||||
WebElement follow;
|
||||
|
||||
@BeforeEach
|
||||
public void openMetadataWindow() {
|
||||
System.setProperty(webDriverInstance, webDriverPath);
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("--headless");
|
||||
options.addArguments("--window-size=1280,800");
|
||||
webDriver = new ChromeDriver(options);
|
||||
common = new Common(webDriver);
|
||||
devTools = webDriver.getDevTools();
|
||||
interceptor = new Interceptor(devTools);
|
||||
tableDetails = new TableDetails(webDriver);
|
||||
actions = new Actions(webDriver);
|
||||
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
|
||||
webDriver.manage().window().maximize();
|
||||
webDriver.get(url);
|
||||
}
|
||||
|
||||
void assertElements() {
|
||||
explore = webDriver.findElement(common.explore());
|
||||
Assert.assertTrue(explore.isDisplayed());
|
||||
headerSettings = webDriver.findElement(common.headerSettings());
|
||||
Assert.assertTrue(headerSettings.isDisplayed());
|
||||
version = webDriver.findElement(common.version());
|
||||
Assert.assertTrue(version.isDisplayed());
|
||||
follow = webDriver.findElement(common.follow());
|
||||
Assert.assertTrue(follow.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
void exceptionCheckForFetchTableDetails() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
interceptor.interceptor("/tables/name", "/testing/name");
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while fetching table details!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(2)
|
||||
void exceptionCheckForFetchQueries() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
interceptor.interceptor("/tables/name", "/testing/name");
|
||||
Events.click(webDriver, tableDetails.queries());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while fetching table queries!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
assertElements();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(3)
|
||||
void exceptionCheckForAddTags() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, common.addTag());
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "P");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
interceptor.interceptor("/tables", "testing");
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while updating tags!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(4)
|
||||
void exceptionCheckForCreateConversation() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, tableDetails.openTagConversationThread());
|
||||
Events.click(webDriver, tableDetails.addConversation());
|
||||
Events.click(webDriver, tableDetails.conversationBox());
|
||||
Events.sendKeys(webDriver, tableDetails.conversationBox(), "@");
|
||||
Events.click(webDriver, tableDetails.select("@aaron_johnson0"));
|
||||
interceptor.interceptor("/feed", "/test");
|
||||
Events.click(webDriver, tableDetails.sendButton());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while creating conversation!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(5)
|
||||
void exceptionCheckForFetchConversationThreads() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
interceptor.interceptor("/feed", "/test");
|
||||
Events.click(webDriver, tableDetails.openTagConversationThread());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while fetching threads!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(6)
|
||||
void exceptionCheckForAddFeed() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.openTagConversationThread());
|
||||
Events.click(webDriver, tableDetails.mainMessageReply());
|
||||
Events.click(webDriver, tableDetails.conversationBox());
|
||||
Events.sendKeys(webDriver, tableDetails.conversationBox(), "Message");
|
||||
interceptor.interceptor("/feed", "/test");
|
||||
Events.click(webDriver, tableDetails.sendButton());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while adding feed!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(8)
|
||||
void exceptionCheckForAddTableTests() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.dataQuality());
|
||||
Events.click(webDriver, tableDetails.addTest());
|
||||
Events.click(webDriver, tableDetails.tableTest());
|
||||
Select selectTest = new Select(webDriver.findElement(tableDetails.selectTableTest()));
|
||||
selectTest.selectByIndex(3);
|
||||
Events.sendKeys(webDriver, tableDetails.value(), "10");
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.saveTest());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while adding table test!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
void exceptionCheckForAddColumnTests() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.dataQuality());
|
||||
Events.click(webDriver, tableDetails.addTest());
|
||||
Events.click(webDriver, tableDetails.columnTest());
|
||||
Select selectColumn = new Select(webDriver.findElement(tableDetails.selectColumn()));
|
||||
selectColumn.selectByIndex(1);
|
||||
Select selectTest = new Select(webDriver.findElement(tableDetails.selectColumnTest()));
|
||||
selectTest.selectByIndex(3);
|
||||
Events.sendKeys(webDriver, tableDetails.regex(), "10");
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.saveTest());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while adding column test!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(10)
|
||||
void exceptionCheckForDeleteTests() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.dataQuality());
|
||||
Events.click(webDriver, tableDetails.addTest());
|
||||
Events.click(webDriver, tableDetails.tableTest());
|
||||
Select selectTest = new Select(webDriver.findElement(tableDetails.selectTableTest()));
|
||||
selectTest.selectByIndex(3);
|
||||
Events.sendKeys(webDriver, tableDetails.value(), "10");
|
||||
Events.click(webDriver, tableDetails.saveTest());
|
||||
Events.click(webDriver, tableDetails.dismissToast());
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, tableDetails.deleteTests());
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.deleteSave());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while deleting test!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
void exceptionCheckForFetchLineage() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.lineage());
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.lineageNode());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while fetching lineage data!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void exceptionCheckForUpdatingDescription() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.editDescriptionButton());
|
||||
Events.sendKeys(webDriver, tableDetails.editDescriptionBox(), "updatedDescription");
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.saveTableDescription());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while updating description!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void exceptionCheckForUnfollow() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Thread.sleep(1000);
|
||||
String follow = webDriver.findElement(common.follow()).getText();
|
||||
if (follow.equals("Follow")) {
|
||||
Events.click(webDriver, common.follow());
|
||||
}
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, common.follow());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while unfollowing entity!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void exceptionCheckForFollow() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Thread.sleep(1000);
|
||||
String follow = webDriver.findElement(common.follow()).getText();
|
||||
if (follow.equals("Unfollow")) {
|
||||
Events.click(webDriver, common.follow());
|
||||
}
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, common.follow());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while following entity!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(12)
|
||||
void exceptionCheckForManage() throws InterruptedException {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, common.explore());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.manage());
|
||||
Events.click(webDriver, tableDetails.owner());
|
||||
Events.click(webDriver, tableDetails.selectUser());
|
||||
interceptor.interceptor("/api/v1/tables", "/api/v1/test");
|
||||
Events.click(webDriver, tableDetails.saveManage());
|
||||
Thread.sleep(2000);
|
||||
String errorMessage = webDriver.findElement(toastMessage).getText();
|
||||
Assert.assertEquals(errorMessage, "Error while updating entity!");
|
||||
checkTabs = tableDetails.checkTabs();
|
||||
for (WebElement e : checkTabs) {
|
||||
Assert.assertTrue(e.isDisplayed());
|
||||
}
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
public void closeTabs() {
|
||||
ArrayList<String> tabs = new ArrayList<>(webDriver.getWindowHandles());
|
||||
String originalHandle = webDriver.getWindowHandle();
|
||||
for (String handle : webDriver.getWindowHandles()) {
|
||||
if (!handle.equals(originalHandle)) {
|
||||
webDriver.switchTo().window(handle);
|
||||
webDriver.close();
|
||||
}
|
||||
}
|
||||
webDriver.switchTo().window(tabs.get(0)).close();
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user