Skip to content
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

control center framework steps phase2 #232

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

priyabhatnagar25
Copy link
Contributor

No description provided.

Comment on lines 42 to 45
static {
cdfNameSpaceAdminLocators = SeleniumHelper.getPropertiesLocators(
CdfControlCenterLocators.class);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a static block here ? Could it not be a simple initialization ?

public static CdfControlCenterLocators cdfNameSpaceAdminLocators =
    SeleniumHelper.getPropertiesLocators(CdfControlCenterLocators.class);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I changed it to as above.

Comment on lines 31 to 38
@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-hamburger-icon']")
public static WebElement hamburgerMenu;

@FindBy(how = How.XPATH, using = "//*[@data-cy='navbar-control-center-link']")
public static WebElement controlCenterMenu;

@FindBy(how = How.XPATH, using = "//*[@data-cy='feature-heading'][//div[contains(text(),'Control Center')]]")
public static WebElement pageHeaderControlCenter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use data-cy to locate elements. Use data-testid instead. If data-testid is not present for an element, please add it in cdap-ui.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed it for 31 and 34 lines , but for 37 that is the only locator available so used as it is and for adding in cdap-ui the development team has to be informed.

Comment on lines 43 to 44
@FindBy(how = How.XPATH, using = "//span[@class='entity-type'][//span[contains(text(),'Data Pipeline')]]")
public static WebElement dataPipelineControlCenter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using text. Especially in framework codebase. If the copy changes, all of the tests using this locator will start failing, which is not desirable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to div class locator.Please verify the same in the latest commit.

Comment on lines 50 to 56
public static By clickOnDeleteButton() {
return By.xpath("//button[@class='btn btn-primary'][//button[@data-cy='Delete']]");
}

public static By clickOnTruncateButton() {
return By.xpath("//div//button[@data-cy='Truncate']");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use data-cy, use data-testid instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used data-testid for both.

Comment on lines 61 to 54
@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search']")
public static WebElement searchTabControlCenter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using placeholder text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the placeholder from here.

Comment on lines 130 to 140
@FindBy(how = How.XPATH, using = "//span[contains(text(),'Displaying Applications, Datasets, sorted by Newest')]")
public static WebElement newestOptionMessage;

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Displaying Applications, Datasets, sorted by Oldest')]")
public static WebElement oldestOptionMessage;

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Displaying Applications, Datasets, sorted by Z - A')]")
public static WebElement zToAOptionMessage;

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Displaying Applications, Datasets, sorted by A - Z')]")
public static WebElement aToZOptionMessage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using text content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the locator for all of them.

Comment on lines 145 to 147
public static WebElement selectSortDropdownValue(String option) {
return SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(text(),'" + option + "')]"));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using text content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also dont have any data-testid , so we need to use this to choose the option for sorting

Comment on lines +156 to +117
@FindBy(how = How.XPATH, using = "//*[contains(text(),'Tags (1)')]")
public static WebElement tagCountIconIncreaseDatasetEntity;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using text content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are adding the tags , when we are adding it changes to 1 and so on. Its dynamic so we are using above, we dont have anything for this also.

Comment on lines 162 to 166
@FindBy(how = How.XPATH, using = "//i[normalize-space()='No tags found. Click to add a new business tag.']")
public static WebElement tagCounDecreaseIconDatasetEntityMessage;

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Search results for \"testingtag\", filtered by Appli')]")
public static WebElement searchedTagShowsDisplayedMessage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not locate elements using text content.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the above both.

Comment on lines 383 to 412
public static void clickOnSearchTagControlCenter(String searchedText) {
ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, searchedText);
ElementHelper.clickOnElement(CdfControlCenterLocators.searchTabControlCenter);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename this method to make it clear what it does. probably to enterTextInSearchBarInControlCenter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it to above .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants