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 #13

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

priyabhatnagar25
Copy link
Collaborator

No description provided.

ElementHelper.clickOnElement(CdfControlCenterLocators.navigateControlCenterPage);
}

public static void clickCreateButtonControlCenterPage() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

clickOn*CreateButtonCenterPage()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed

@FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" +
"//*[@class='icon-svg icon-trash']")
public static WebElement clickDeleteIconControlCenter;
public static By clickDeleteButton() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

clickOn*DeleteButton

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed

public void pipelinePresentControlCenterPage() {
CdfControlCenterActions.pipelinePresentControlCenterPage();
}
@Then("Verify user can click on the delete icon of the created pipeline and pipeline gets deleted successfully")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are not verifying if the piplline is deleted or not , we are simply deleting it . Can we add the validation steps that after deleting the pipline is not present inside control center or something like that ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Working for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Working on it

}

public static void clickOnHamburgerMenu() {
ElementHelper.clickOnElement(CdfControlCenterLocators.hamburgerMenu);
Copy link
Collaborator

Choose a reason for hiding this comment

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

click on HamburgerMenu is used for Namespace admin cases also , If you can reuse the same no need to add new method here .

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ignore the above comment as we are raising the PRs individually .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

ElementHelper.clickOnElement(CdfControlCenterLocators.controlCenterMenu);
}

public static void navigateOnControlCenterTab() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

change the method Name to navigateToControlCenter()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed

public static WebElement controlCenterMenu;

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

Choose a reason for hiding this comment

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

Change the locator name pageHeaderControlCenter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed pageHeaderControlCenter


private static final Logger logger = LoggerFactory.getLogger(ControlCenterSteps.class);

@Then("Click on the Hamburger bar on the left panel")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this and use the namespace admin code

public static WebElement navigateControlCenterPage;

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Create')]")
public static WebElement clickCreateButtonControlCenter;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove click , it should be createButtonControlCenter

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

public static WebElement clickCreateButtonControlCenter;

@FindBy(how = How.XPATH, using = "//span[@class='entity-type'][//span[contains(text(),'Data Pipeline')]]")
public static WebElement clickDataPipelineControlCenter;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove click

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed click


@FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" +
"//*[@class='icon-svg icon-trash']")
public static WebElement clickDeleteIconControlCenter;
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove click

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed click

}

public static void clickOnDeleteButtonIfDisplayed() {
ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickDeleteButton());
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can use clickOnElement function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have used this as its a alert box coming after clicking on the delete icon , so if it displyed then click on it

ElementHelper.clickOnElement(CdfControlCenterLocators.clickDataPipelineControlCenter);
}

public static void clickOnDeleteButtonIfDisplayed() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change method name to clickOnDeleteButtonOnConfirmationBox()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed clickOnDeleteButtonOnConfirmationBox

"//*[@class='icon-svg icon-trash']")
public static WebElement clickDeleteIconControlCenter;
public static By clickDeleteButton() {
return By.xpath("//button[@class='btn btn-primary'][//button[@data-cy='Delete']]");
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a data-cy or data-test-id for this we can use it and create something like this : //div//button[@data-cy='Delete'] or //div//button[@data-testid='Delete']

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Have used both things here class and data-cy also, i think thats fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note - Class names are mostly defined by developers to apply styling/css on web pages and they can change them quite frequently while an UI update.

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

@FindBy(how = How.XPATH, using = "//span[contains(text(),'Create')]")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try to use //*[@id='create-pipeline-link'] as we have id for element

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Used //*[@id='create-pipeline-link']

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

@FindBy(how = How.XPATH, using = "//div[contains(text(),'Control Center')]")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use data-cy or data-testid as it exists for this element

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed the loactor //*[@data-cy='navbar-control-center-link']

public static void clickOnDeleteButtonOnConfirmationBox() {
ElementHelper.clickIfDisplayed(CdfControlCenterLocators.clickOnDeleteButton());
}
public static void deletePipelineControlCenter() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

public static void deletePipelineControlCenter() {
ElementHelper.clickOnElement(CdfControlCenterLocators.deleteIconControlCenter);
clickOnDeleteButtonOnConfirmationBox();

Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove extra line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed extra line

clickOnDeleteButtonOnConfirmationBox();

}
public static void pipelineDeletedIsNotPresent() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use formatter to resolve these line spacing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done removed extraa lines

@Then("Verify user is able to click on the create button to create a pipeline successfully")
public void createButtonControlCenterPage() {
CdfControlCenterActions.clickOnCreateButtonControlCenterPage();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

add space here , avoid these kind of mistakes

@Then("Verify the pipeline created successfully is present in control center page")
public void pipelinePresentControlCenterPage() {
CdfControlCenterActions.pipelinePresentControlCenterPage();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

add space after this


@FindBy(how = How.XPATH, using = "//div[@class='just-added-entities-list']//button[@class='btn btn-link']" +
"//*[@class='icon-svg icon-trash']")
public static WebElement deleteIconControlCenter;
Copy link
Collaborator

Choose a reason for hiding this comment

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

add space below

}

public static void pipelineDeletedIsNotPresent() {
clickOnSearchTabControlCenter(PipelineSteps.pipelineName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this step will search the recently deleted pipline ?

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

Successfully merging this pull request may close these issues.

4 participants