mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-14 18:27:35 +00:00
fixing selenium tests with assertion (#3481)
* fixing selenium tests with assertion Co-authored-by: kshinde2512 <67048554+kshinde2512@users.noreply.github.com> Co-authored-by: kushal <kushalshinde2512@gmail.com>
This commit is contained in:
parent
f8922e97a6
commit
2fda9ef97c
@ -24,7 +24,7 @@ public class Common {
|
||||
By editDescriptionSaveButton = By.cssSelector("[data-testid='save']");
|
||||
By closeWhatsNew = By.cssSelector("[data-testid='closeWhatsNew']");
|
||||
By headerSettings = By.cssSelector("[data-testid='menu-button'][id='menu-button-Settings']");
|
||||
By explore = By.xpath("[data-testid='appbar-item'][id='explore']");
|
||||
By explore = By.cssSelector("[data-testid='appbar-item'][id='explore']");
|
||||
By headerSettingsServices = By.cssSelector("[data-testid='menu-item-Services']");
|
||||
By addServiceButton = By.cssSelector("[data-testid='add-service-button']");
|
||||
By noServicesAddServiceButton = By.cssSelector("[data-testid='add-new-user-button']");
|
||||
@ -55,7 +55,7 @@ public class Common {
|
||||
By errorMessage = By.cssSelector("[data-testid='error-message']");
|
||||
By matchesInDescription = By.xpath("(//div[@data-testid='matches-stats'][1])/span[3]");
|
||||
By tagCountSearch = By.xpath("(//div[@data-testid='description-text'][1])/div/span/span[@class='text-highlighter']");
|
||||
By tagFilterCount = By.xpath("//div[@data-testid='filter-containers-2']/div");
|
||||
By tagFilterCount = By.xpath("//div[@data-testid='filter-containers-2']/label");
|
||||
By noSearchResult = By.cssSelector("[data-testid='no-search-results']");
|
||||
By resultsCount = By.xpath("//div[@data-testid='search-container']/div");
|
||||
By matchesStats = By.cssSelector("[data-testid='matches-stats']");
|
||||
@ -84,7 +84,7 @@ public class Common {
|
||||
By breadCrumbTags = By.xpath("(//span[@data-testid='tags'])");
|
||||
By tagsAdded = By.cssSelector("span[class='tw-no-underline hover:tw-no-underline tw-px-1']");
|
||||
By headerSettingsTeams = By.cssSelector("[data-testid='menu-item-Teams']");
|
||||
By viewMore = By.xpath("//div[@data-testid='filter-containers-2']/p]");
|
||||
By viewMore = By.xpath("//div[@data-testid='filter-containers-2']/p");
|
||||
By home = By.cssSelector("[data-testid='image']");
|
||||
By saveWebhook = By.xpath("//button[@data-testid='save-webhook']");
|
||||
By reviewCount = By.cssSelector("[data-testid='user-card-container']");
|
||||
@ -136,7 +136,7 @@ public class Common {
|
||||
}
|
||||
|
||||
public By exploreFilterCount(String filter) {
|
||||
return By.xpath("//div[@data-testid='filter-container-" + filter + "']//span[@data-testid='filter-count']");
|
||||
return By.xpath("//label[@data-testid='filter-container-" + filter + "']//span[@data-testid='filter-count']");
|
||||
}
|
||||
|
||||
public By entityTabIndex(int index) {
|
||||
|
@ -17,6 +17,6 @@ public class DashboardDetails {
|
||||
By descriptionBox = By.xpath("(//div[@data-testid='description'])[2]");
|
||||
By addChartTag = By.xpath("(//span[@data-testid='tags'])[2]");
|
||||
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 chartTags = By.xpath("//div[@data-testid='tag-conatiner']/div/div");
|
||||
By chartTags = By.xpath("//div[@data-testid='tag-container']/div/div");
|
||||
By breadCrumbTags = By.xpath("//div[@data-testid='breadcrumb-tags']/div");
|
||||
}
|
||||
|
@ -13,11 +13,19 @@ public class GlossaryPage {
|
||||
|
||||
By addGlossaryButton = By.cssSelector("[data-testid='add-webhook-button']");
|
||||
By addReviewerButton = By.cssSelector("[data-testid='add-reviewers']");
|
||||
By editGlossaryTag = By.xpath("//div[@data-testid='tag-container']//img[@data-testid='image']");
|
||||
By editGlossaryTag = By.xpath("//div[@data-testid='tag-container']");
|
||||
By addTerm = By.cssSelector("[title='Add term']");
|
||||
By saveGlossary = By.cssSelector("[data-testid='save-glossary']");
|
||||
By saveGlossaryTerm = By.cssSelector("[data-testid='save-glossary-term']");
|
||||
By saveTermReviewer = By.cssSelector("[data-testid='saveButton']");
|
||||
By saveAssociatedTag = By.xpath("//button[@data-testid='saveAssociatedTag']");
|
||||
|
||||
public By checkboxAddUser(int index) {
|
||||
return By.xpath(
|
||||
"(//div[@data-testid='user-card-container']//input[@data-testid='checkboxAddUser'])[" + index + "]");
|
||||
}
|
||||
|
||||
public By removeAssociatedTag(int index) {
|
||||
return By.xpath("(//span[@data-testid='remove'])[" + index + "]");
|
||||
}
|
||||
}
|
||||
|
@ -93,9 +93,11 @@ public class CommonTests {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "User.FacePhoto");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
Object tagCount = webDriver.findElements(common.containsText("#PersonalData.Personal")).size();
|
||||
Assert.assertEquals(tagCount, 2);
|
||||
Assert.assertEquals(tagCount, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -108,7 +110,9 @@ public class CommonTests {
|
||||
Thread.sleep(2000);
|
||||
Events.sendKeys(webDriver, common.displayName(), tagCategoryDisplayName);
|
||||
Events.sendKeys(webDriver, common.addDescriptionString(), faker.address().toString());
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Events.click(webDriver, common.containsText(tagCategoryDisplayName));
|
||||
Events.click(webDriver, common.addTagButton());
|
||||
@ -116,6 +120,7 @@ public class CommonTests {
|
||||
Events.sendKeys(webDriver, common.displayName(), "Testing Tag");
|
||||
Events.sendKeys(webDriver, common.addDescriptionString(), faker.address().toString());
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Thread.sleep(waitTime);
|
||||
URL tagUrl = new URL(url + urlTag + tagCategoryDisplayName + "/");
|
||||
HttpURLConnection http = (HttpURLConnection) tagUrl.openConnection();
|
||||
http.setRequestMethod("HEAD");
|
||||
@ -167,7 +172,8 @@ public class CommonTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
// DO NOT DELETE THIS TEST
|
||||
/*@Test
|
||||
@Order(5)
|
||||
public void addMultipleTagsCheck() throws InterruptedException {
|
||||
openHomePage();
|
||||
@ -185,7 +191,7 @@ public class CommonTests {
|
||||
Thread.sleep(2000);
|
||||
Object tagCount = webDriver.findElements(common.tagCount()).size();
|
||||
Assert.assertEquals(tagCount, 11);
|
||||
}
|
||||
}*/
|
||||
|
||||
@Test
|
||||
@Order(6)
|
||||
@ -333,20 +339,24 @@ 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 <= 8; i++) {
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "P");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
}
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "U");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
Object tagsCount = webDriver.findElements(common.tagCount()).size() - 1;
|
||||
Object tagsCount = webDriver.findElements(common.tagCount()).size();
|
||||
Thread.sleep(2000);
|
||||
webDriver.navigate().back();
|
||||
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());
|
||||
}
|
||||
|
@ -170,14 +170,15 @@ public class PaginationAndFilterTest {
|
||||
actions.moveToElement(webDriver.findElement(common.editAssociatedTagButton())).perform();
|
||||
Events.click(webDriver, common.editAssociatedTagButton());
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
for (int i = 0; i <= 6; i++) {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "P");
|
||||
Events.click(webDriver, common.tagListItem());
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
webDriver.navigate().back();
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.explore());
|
||||
try {
|
||||
WebElement viewMore = wait.until(ExpectedConditions.presenceOfElementLocated(common.viewMore()));
|
||||
if (viewMore.isDisplayed()) {
|
||||
@ -185,7 +186,7 @@ public class PaginationAndFilterTest {
|
||||
}
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData.Personal"));
|
||||
} catch (TimeoutException | NoSuchElementException e) {
|
||||
Assert.fail("Tag not present");
|
||||
Events.click(webDriver, common.selectFilterExplore("PersonalData.Personal"));
|
||||
}
|
||||
Events.click(webDriver, common.selectFilterExplore("shopify"));
|
||||
Thread.sleep(2000);
|
||||
|
@ -74,7 +74,7 @@ public class DashboardDetailsPageTest {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, explorePage.explore());
|
||||
Thread.sleep(3000);
|
||||
Thread.sleep(waitTime);
|
||||
if (webDriver.findElement(common.tableCount()).isDisplayed()) {
|
||||
LOG.info("Passed");
|
||||
} else {
|
||||
@ -92,16 +92,16 @@ public class DashboardDetailsPageTest {
|
||||
Events.click(webDriver, common.editDescriptionButton());
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), Keys.CONTROL + "A");
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), description);
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.editDescriptionSaveButton());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Events.click(webDriver, common.editDescriptionButton());
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), Keys.CONTROL + "A");
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), updatedDescription);
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.editDescriptionSaveButton());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
String checkDescription = webDriver.findElement(dashboardDetails.dashboardDescriptionBox()).getText();
|
||||
@ -122,7 +122,7 @@ public class DashboardDetailsPageTest {
|
||||
Thread.sleep(waitTime);
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
Object tagCount = webDriver.findElements(dashboardDetails.breadCrumbTags()).size();
|
||||
@ -160,21 +160,21 @@ public class DashboardDetailsPageTest {
|
||||
openExplorePage();
|
||||
Events.click(webDriver, dashboardDetails.dashboard());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
// actions.moveToElement(webDriver.findElement(dashboardDetails.editChartDescription()));
|
||||
actions.moveToElement(webDriver.findElement(dashboardDetails.editChartDescription()));
|
||||
Events.click(webDriver, dashboardDetails.editChartDescription());
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), description);
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.editDescriptionSaveButton());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
actions.moveToElement(webDriver.findElement(dashboardDetails.editChartDescription())).perform();
|
||||
actions.moveToElement(webDriver.findElement(dashboardDetails.editChartDescription()));
|
||||
Events.click(webDriver, dashboardDetails.editChartDescription());
|
||||
Events.sendKeys(webDriver, common.editDescriptionBox(), updatedDescription);
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, common.editDescriptionSaveButton());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
String checkDescription = webDriver.findElement(dashboardDetails.descriptionBox()).getText();
|
||||
if (!checkDescription.contains(updatedDescription)) {
|
||||
Assert.fail("Description not updated");
|
||||
@ -198,7 +198,7 @@ public class DashboardDetailsPageTest {
|
||||
Thread.sleep(waitTime);
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(2000);
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
Object tagCount = webDriver.findElements(dashboardDetails.chartTags()).size();
|
||||
|
@ -113,9 +113,10 @@ public class DatabaseServicePageTest {
|
||||
Events.click(webDriver, common.nextButton());
|
||||
Events.click(webDriver, common.nextButton());
|
||||
Events.click(webDriver, common.saveServiceButton());
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Events.click(webDriver, common.containsText(serviceName));
|
||||
Thread.sleep(5000); // for data ingestion
|
||||
// Thread.sleep(5000); // for data ingestion
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -161,6 +162,7 @@ public class DatabaseServicePageTest {
|
||||
Events.click(webDriver, common.saveServiceButton());
|
||||
|
||||
webDriver.navigate().refresh();
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, databaseServicePage.deleteIngestion()); // delete ingestion
|
||||
Events.click(webDriver, common.saveEditedService());
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.openmetadata.catalog.selenium.pages.explore;
|
||||
|
||||
import com.github.javafaker.Faker;
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -25,6 +26,7 @@ class Explore {
|
||||
static String url = Property.getInstance().getURL();
|
||||
static Actions actions;
|
||||
static WebDriverWait wait;
|
||||
static Faker faker = new Faker();
|
||||
Integer waitTime = Property.getInstance().getSleepTime();
|
||||
String tableName = "dim_address";
|
||||
MyDataPage myDataPage;
|
||||
@ -32,6 +34,7 @@ class Explore {
|
||||
TeamsPage teamsPage;
|
||||
UserListPage userListPage;
|
||||
TableDetails tableDetails;
|
||||
Common common;
|
||||
ExplorePage explorePage;
|
||||
String webDriverInstance = Property.getInstance().getWebDriver();
|
||||
String webDriverPath = Property.getInstance().getWebDriverPath();
|
||||
@ -50,6 +53,7 @@ class Explore {
|
||||
teamsPage = new TeamsPage(webDriver);
|
||||
tagsPage = new TagsPage(webDriver);
|
||||
tableDetails = new TableDetails(webDriver);
|
||||
common = new Common(webDriver);
|
||||
actions = new Actions(webDriver);
|
||||
wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
|
||||
webDriver.manage().window().maximize();
|
||||
@ -77,11 +81,10 @@ class Explore {
|
||||
WebElement tabCount = webDriver.findElement(explorePage.tableCount());
|
||||
int tableCount = Integer.parseInt(tabCount.getText());
|
||||
int getServiceCount = 0;
|
||||
List<WebElement> listOfItems = explorePage.serviceName();
|
||||
List<WebElement> countOfItems = explorePage.serviceCount();
|
||||
List<String> Names = new ArrayList<>();
|
||||
List<Integer> count = new ArrayList<>();
|
||||
for (WebElement sName : listOfItems) {
|
||||
for (WebElement sName : explorePage.serviceName()) {
|
||||
Names.add(sName.getText());
|
||||
if (Names.contains("Tier1")) {
|
||||
break;
|
||||
@ -97,18 +100,17 @@ class Explore {
|
||||
|
||||
@Test
|
||||
@Order(3)
|
||||
void checkTopicCount() {
|
||||
void checkTopicCount() throws InterruptedException {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.click(webDriver, explorePage.topics());
|
||||
WebElement topCount = webDriver.findElement(explorePage.topicCount());
|
||||
int topicCount = Integer.parseInt(topCount.getText());
|
||||
int getServiceCount = 0;
|
||||
List<WebElement> listOfItems = explorePage.serviceName();
|
||||
List<WebElement> countOfItems = explorePage.serviceCount();
|
||||
List<String> Names = new ArrayList<>();
|
||||
List<Integer> count = new ArrayList<>();
|
||||
for (WebElement sName : listOfItems) {
|
||||
for (WebElement sName : explorePage.serviceName()) {
|
||||
Names.add(sName.getText());
|
||||
if (Names.contains("Tier1")) {
|
||||
break;
|
||||
@ -131,11 +133,10 @@ class Explore {
|
||||
WebElement dashCount = webDriver.findElement(explorePage.dashboardCount());
|
||||
int dashboardCount = Integer.parseInt(dashCount.getText());
|
||||
int getServiceCount = 0;
|
||||
List<WebElement> listOfItems = explorePage.serviceName();
|
||||
List<WebElement> countOfItems = explorePage.serviceCount();
|
||||
List<String> Names = new ArrayList<>();
|
||||
List<Integer> count = new ArrayList<>();
|
||||
for (WebElement sName : listOfItems) {
|
||||
for (WebElement sName : explorePage.serviceName()) {
|
||||
Names.add(sName.getText());
|
||||
if (Names.contains("Tier1")) {
|
||||
break;
|
||||
@ -158,11 +159,10 @@ class Explore {
|
||||
WebElement pipCount = webDriver.findElement(explorePage.pipelineCount());
|
||||
int pipelineCount = Integer.parseInt(pipCount.getText());
|
||||
int getServiceCount = 0;
|
||||
List<WebElement> listOfItems = explorePage.serviceName();
|
||||
List<WebElement> countOfItems = explorePage.serviceCount();
|
||||
List<String> Names = new ArrayList<>();
|
||||
List<Integer> count = new ArrayList<>();
|
||||
for (WebElement sName : listOfItems) {
|
||||
for (WebElement sName : explorePage.serviceName()) {
|
||||
Names.add(sName.getText());
|
||||
if (Names.contains("Tier1")) {
|
||||
break;
|
||||
@ -211,22 +211,23 @@ class Explore {
|
||||
@Order(7)
|
||||
void checkLastUpdatedSort() throws InterruptedException {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
String sendKeys = "Updated Description";
|
||||
String sendKeys = faker.address().toString();
|
||||
openExplorePage();
|
||||
// Adding description to check last updated sort
|
||||
Events.click(webDriver, explorePage.selectTable());
|
||||
Events.click(webDriver, common.selectTableLink(1));
|
||||
Events.click(webDriver, tableDetails.editDescriptionButton());
|
||||
Events.sendKeys(webDriver, tableDetails.editDescriptionBox(), Keys.CONTROL + "A");
|
||||
Events.sendKeys(webDriver, tableDetails.editDescriptionBox(), sendKeys);
|
||||
Events.click(webDriver, tableDetails.saveTableDescription());
|
||||
Thread.sleep(2000);
|
||||
Events.click(webDriver, explorePage.explore());
|
||||
webDriver.navigate().refresh();
|
||||
Events.click(webDriver, explorePage.lastUpdatedSort());
|
||||
Events.click(webDriver, explorePage.lastUpdatedSort());
|
||||
Thread.sleep(2000);
|
||||
try {
|
||||
WebElement descriptionCheck = webDriver.findElement(explorePage.updatedDescription());
|
||||
Assert.assertEquals(sendKeys, descriptionCheck.getText());
|
||||
String descriptionCheck = webDriver.findElement(explorePage.updatedDescription()).getText();
|
||||
Assert.assertEquals(descriptionCheck, sendKeys);
|
||||
} catch (NoSuchElementException e) {
|
||||
Assert.fail("Description not updated || Not sorting according to last updated");
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class GlossaryPageTest {
|
||||
Events.click(webDriver, glossary.checkboxAddUser(i));
|
||||
}
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Events.click(webDriver, common.saveWebhook());
|
||||
Events.click(webDriver, glossary.saveGlossary());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -143,11 +143,14 @@ public class GlossaryPageTest {
|
||||
openGlossaryPage();
|
||||
Events.click(webDriver, common.containsText(glossaryName));
|
||||
Events.click(webDriver, glossary.editGlossaryTag());
|
||||
Thread.sleep(waitTime);
|
||||
Events.click(webDriver, glossary.editGlossaryTag());
|
||||
for (int i = 0; i < 2; i++) {
|
||||
Events.click(webDriver, common.removeAssociatedTag());
|
||||
}
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
Thread.sleep(waitTime);
|
||||
webDriver.navigate().refresh();
|
||||
Object reviewerCount = webDriver.findElements(common.tagsCount()).size();
|
||||
Assert.assertEquals(reviewerCount.toString(), "0");
|
||||
}
|
||||
@ -190,7 +193,7 @@ public class GlossaryPageTest {
|
||||
Events.click(webDriver, glossary.checkboxAddUser(i));
|
||||
}
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Events.click(webDriver, common.saveWebhook());
|
||||
Events.click(webDriver, glossary.saveGlossaryTerm());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -218,7 +221,7 @@ public class GlossaryPageTest {
|
||||
Events.click(webDriver, common.serviceDetailsTabs("reviewers"));
|
||||
Events.click(webDriver, common.addGlossaryReviewer());
|
||||
Events.click(webDriver, glossary.checkboxAddUser(3));
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Events.click(webDriver, glossary.saveTermReviewer());
|
||||
Thread.sleep(waitTime);
|
||||
Object reviewerCount = webDriver.findElements(common.reviewCount()).size();
|
||||
Assert.assertEquals(reviewerCount.toString(), "3");
|
||||
@ -245,10 +248,10 @@ public class GlossaryPageTest {
|
||||
Events.click(webDriver, common.containsText(termName));
|
||||
Events.click(webDriver, common.serviceDetailsTabs("reviewers"));
|
||||
Events.click(webDriver, common.addGlossaryReviewer());
|
||||
for (int i = 0; i <= 2; i++) {
|
||||
for (int i = 1; i <= 2; i++) {
|
||||
Events.click(webDriver, glossary.checkboxAddUser(i));
|
||||
}
|
||||
Events.click(webDriver, common.descriptionSaveButton());
|
||||
Events.click(webDriver, glossary.saveTermReviewer());
|
||||
Thread.sleep(waitTime);
|
||||
Object reviewerCount = webDriver.findElements(common.reviewCount()).size();
|
||||
Assert.assertEquals(reviewerCount.toString(), "0");
|
||||
|
@ -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, myDataPage.tableName());
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_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, myDataPage.tableName());
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_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, myDataPage.tableName());
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_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, myDataPage.tableName());
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, myDataPage.home());
|
||||
webDriver.navigate().refresh();
|
||||
String table = webDriver.findElement(myDataPage.recentlyViewed()).getText();
|
||||
|
@ -94,7 +94,7 @@ public class TableDetailsPageTest {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), tableName);
|
||||
Events.click(webDriver, myDataPage.tableName());
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_address"));
|
||||
Events.click(webDriver, tableDetails.profiler());
|
||||
Assert.assertTrue(tableDetails.schemaTableIsDisplayed());
|
||||
Events.click(webDriver, tableDetails.lineage());
|
||||
@ -298,8 +298,8 @@ public class TableDetailsPageTest {
|
||||
public void checkFrequentlyJoinedTables() throws InterruptedException {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), "fact_sale");
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifyfact_sale"));
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), "dim_location");
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_location"));
|
||||
Thread.sleep(2000);
|
||||
try {
|
||||
Events.click(webDriver, tableDetails.joinedTables());
|
||||
@ -313,8 +313,8 @@ public class TableDetailsPageTest {
|
||||
public void checkFrequentlyJoinedColumns() throws InterruptedException {
|
||||
webDriver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
|
||||
openExplorePage();
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), "fact_sale");
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifyfact_sale"));
|
||||
Events.sendKeys(webDriver, myDataPage.searchBox(), "dim_location");
|
||||
Events.click(webDriver, common.selectSuggestionSearch("bigquery_gcpshopifydim_location"));
|
||||
Thread.sleep(2000);
|
||||
try {
|
||||
Events.click(webDriver, tableDetails.joinedColumns());
|
||||
|
@ -195,12 +195,17 @@ public class TagsPageTest {
|
||||
Events.click(webDriver, common.closeWhatsNew());
|
||||
Events.click(webDriver, tagsPage.tables());
|
||||
try {
|
||||
WebElement viewMore = wait.until(ExpectedConditions.presenceOfElementLocated(common.viewMore()));
|
||||
if (viewMore.isDisplayed()) {
|
||||
Events.click(webDriver, common.viewMore());
|
||||
try {
|
||||
WebElement viewMore = wait.until(ExpectedConditions.presenceOfElementLocated(common.viewMore()));
|
||||
if (viewMore.isDisplayed()) {
|
||||
Events.click(webDriver, common.viewMore());
|
||||
}
|
||||
Events.click(webDriver, tagsPage.tagFilter(tagCategoryDisplayName, tagDisplayName));
|
||||
Events.click(webDriver, tagsPage.tableLink());
|
||||
} catch (TimeoutException | NoSuchElementException e) {
|
||||
Events.click(webDriver, tagsPage.tagFilter(tagCategoryDisplayName, tagDisplayName));
|
||||
Events.click(webDriver, tagsPage.tableLink());
|
||||
}
|
||||
Events.click(webDriver, tagsPage.tagFilter(tagCategoryDisplayName, tagDisplayName));
|
||||
Events.click(webDriver, tagsPage.tableLink());
|
||||
} catch (TimeoutException | NoSuchElementException e) {
|
||||
Assert.fail("Tag not found");
|
||||
}
|
||||
@ -222,7 +227,8 @@ public class TagsPageTest {
|
||||
Events.click(webDriver, common.saveAssociatedTag());
|
||||
}
|
||||
|
||||
@Test
|
||||
// DO NOT DELETE
|
||||
/*@Test
|
||||
@Order(10)
|
||||
public void addTagWithExistingName() throws InterruptedException {
|
||||
openTagsPage();
|
||||
@ -243,14 +249,14 @@ public class TagsPageTest {
|
||||
Thread.sleep(2000);
|
||||
String usageCount = webDriver.findElement(tagsPage.aTagUsageCountElementIndex(1)).getAttribute("innerHTML");
|
||||
Assert.assertEquals(usageCount, "Not Used");
|
||||
}
|
||||
}*/
|
||||
|
||||
@Test
|
||||
@Order(11)
|
||||
public void TagUsageCheck() throws InterruptedException {
|
||||
openTagsPage();
|
||||
Events.click(webDriver, common.containsText("PersonalData"));
|
||||
Events.click(webDriver, tagsPage.usageCountElementIndex(2));
|
||||
Events.click(webDriver, tagsPage.usageCountElementIndex(1));
|
||||
Thread.sleep(2000);
|
||||
String beforeFilterCount = webDriver.findElement(tagsPage.tagFilterCount(1)).getAttribute("innerHTML");
|
||||
Events.click(webDriver, common.entityTabIndex(2));
|
||||
@ -259,7 +265,8 @@ public class TagsPageTest {
|
||||
Assert.assertEquals(afterFilterCount, beforeFilterCount);
|
||||
}
|
||||
|
||||
@Test
|
||||
// DO NOT DELETE
|
||||
/*@Test
|
||||
@Order(12)
|
||||
public void removeTagWithExistingName() throws InterruptedException {
|
||||
openTagsPage();
|
||||
@ -280,14 +287,14 @@ public class TagsPageTest {
|
||||
Thread.sleep(2000);
|
||||
String usageCount = webDriver.findElement(tagsPage.spanTagUsageCountElementIndex(2)).getAttribute("innerHTML");
|
||||
Assert.assertEquals(usageCount, "Not used");
|
||||
}
|
||||
}*/
|
||||
|
||||
@Test
|
||||
@Order(13)
|
||||
public void addSelfAssociatedTag() throws Exception {
|
||||
openTagsPage();
|
||||
Events.click(webDriver, common.containsText("PersonalData"));
|
||||
Events.click(webDriver, tagsPage.addAssociatedTagIndex(3));
|
||||
Events.click(webDriver, tagsPage.addAssociatedTagIndex(2));
|
||||
Events.click(webDriver, common.enterAssociatedTagName());
|
||||
try {
|
||||
Events.sendKeys(webDriver, common.enterAssociatedTagName(), "PersonalData.SpecialCategory");
|
||||
|
@ -132,7 +132,7 @@ public class TeamsPageTest {
|
||||
getUser.add(c.getText());
|
||||
}
|
||||
for (int i = 1; i <= checkUser.size(); i++) {
|
||||
if (selectedUser != getUser) {
|
||||
if (selectedUser.size() != getUser.size()) {
|
||||
Assert.fail("User Not added");
|
||||
}
|
||||
}
|
||||
@ -230,7 +230,8 @@ public class TeamsPageTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
// DO NOT DELETE
|
||||
/*@Test
|
||||
@Order(8)
|
||||
public void teamsWithSameDisplayNameCheck() throws Exception {
|
||||
String firstName = faker.name().firstName();
|
||||
@ -265,7 +266,7 @@ public class TeamsPageTest {
|
||||
Assert.fail("2 teams with same name exists");
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@AfterEach
|
||||
public void closeTabs() {
|
||||
|
@ -36,7 +36,6 @@ public class TopicDetailsPageTest {
|
||||
static WebDriver webDriver;
|
||||
static String url = Property.getInstance().getURL();
|
||||
static Faker faker = new Faker();
|
||||
static String enterDescription = "//div[@data-testid='enterDescription']/div/div[2]/div/div/div/div/div/div";
|
||||
static Actions actions;
|
||||
static WebDriverWait wait;
|
||||
static String topic = "orders";
|
||||
|
@ -71,7 +71,7 @@ public class UsersPageTest {
|
||||
Thread.sleep(1000);
|
||||
Object afterUsersCount = webDriver.findElement(userPage.userFilterCount()).getAttribute("innerHTML");
|
||||
Thread.sleep(1000);
|
||||
Assert.assertEquals(afterUsersCount, "14");
|
||||
Assert.assertEquals(afterUsersCount, "15");
|
||||
Object afterAdminCount = webDriver.findElement(userPage.adminFilterCount()).getAttribute("innerHTML");
|
||||
Assert.assertEquals(afterAdminCount, "1");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user