-
Notifications
You must be signed in to change notification settings - Fork 25
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
base: develop
Are you sure you want to change the base?
control center framework steps phase2 #232
Conversation
static { | ||
cdfNameSpaceAdminLocators = SeleniumHelper.getPropertiesLocators( | ||
CdfControlCenterLocators.class); | ||
} |
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 do we need a static block here ? Could it not be a simple initialization ?
public static CdfControlCenterLocators cdfNameSpaceAdminLocators =
SeleniumHelper.getPropertiesLocators(CdfControlCenterLocators.class);
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.
Hi, I changed it to as above.
@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; |
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.
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.
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 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.
@FindBy(how = How.XPATH, using = "//span[@class='entity-type'][//span[contains(text(),'Data Pipeline')]]") | ||
public static WebElement dataPipelineControlCenter; |
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.
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.
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.
Changed it to div class locator.Please verify the same in the latest commit.
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']"); | ||
} |
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.
do not use data-cy
, use data-testid
instead.
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 have used data-testid for both.
@FindBy(how = How.XPATH, using = "//input[@class='search-input form-control'][@placeholder='Search']") | ||
public static WebElement searchTabControlCenter; |
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.
do not locate elements using placeholder text.
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.
Removed the placeholder from here.
@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; |
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.
do not locate elements using text content.
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.
Changed the locator for all of them.
public static WebElement selectSortDropdownValue(String option) { | ||
return SeleniumDriver.getDriver().findElement(By.xpath("//*[contains(text(),'" + option + "')]")); | ||
} |
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.
do not locate elements using text content.
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 also dont have any data-testid , so we need to use this to choose the option for sorting
@FindBy(how = How.XPATH, using = "//*[contains(text(),'Tags (1)')]") | ||
public static WebElement tagCountIconIncreaseDatasetEntity; |
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.
do not locate elements using text content.
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.
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.
@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; |
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.
do not locate elements using text content.
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.
Changed the above both.
public static void clickOnSearchTagControlCenter(String searchedText) { | ||
ElementHelper.sendKeys(CdfControlCenterLocators.searchTabControlCenter, searchedText); | ||
ElementHelper.clickOnElement(CdfControlCenterLocators.searchTabControlCenter); | ||
} |
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.
rename this method to make it clear what it does. probably to enterTextInSearchBarInControlCenter
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.
Renamed it to above .
b9eabdf
to
1c08384
Compare
6504d54
to
c63b278
Compare
No description provided.