-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Selenium: cover working with factories on the Dashboard by selenium tests #8917
Conversation
@@ -117,7 +112,7 @@ public DashboardFactory( | |||
} | |||
|
|||
@FindBy(xpath = Locators.FACTORY_TAB_XPATH) |
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.
FACTORY_TAB_XPATH
> FACTORIES_TAB_XPATH
@@ -186,10 +192,8 @@ public void clickOnAddFactoryBtn() { | |||
public void selectWorkspaceForCreation(String wsNama) { | |||
// delay for animation page | |||
WaitUtils.sleepQuietly(1, TimeUnit.SECONDS); |
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.
It's better to use dedicated class TestWebElementRenderChecker to wait animation is ended.
* | ||
* @return the current factory url | ||
*/ | ||
/** click on the DOne button of Configure Button page */ |
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.
DOne
> Done
@@ -85,26 +71,35 @@ public DashboardFactory( | |||
this.actionsFactory = actionsFactory; | |||
this.dashboard = dashboard; | |||
this.ideUrl = ideUrlProvider.get().toString(); | |||
this.loadPageTimeoutSec = new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC); |
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.
Unclear name loadPageTimeoutSec
. What about loadPageTimeoutWait
?
String WORKSPACE_ITEM_XPATH = "//div[@class='project-name']/a[text()='%s']"; | ||
String JSON_FACTORY_EDITOR_AREA_CSS = "div.json-editor"; | ||
String NEXT_FACTORY_BTN_XPATH = "//button/span[text()='Create']"; | ||
String FACTORY_NAMED_URL_XPATH = | ||
"//div[@che-href='factoryInformationCtrl.factory.nameURL']//div[@layout]/span"; | ||
String FACTORY_NAME_FIELD_CSS = "input[placeholder='Name of the factory']"; | ||
String FACTORY_URL_MARKDAWN = "div.create-factory-share-header-widget-markdown"; | ||
String FACTORY_URL_MARKDOWN = "div.create-factory-share-header-widget-markdown"; |
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.
Looks like this is kind of CSS selector. Lets name it in appropriate way: FACTORY_URL_MARKDOWN_CSS
@@ -186,10 +192,8 @@ public void clickOnAddFactoryBtn() { | |||
public void selectWorkspaceForCreation(String wsNama) { |
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.
wsNama
> wsName
loadPageTimeoutSec.until(visibilityOf(deleleFactoryButton)).click(); | ||
} | ||
|
||
/** Click on the delete/remove button in the dialog window */ |
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.
Are there two possible names of the same button: delete or remove?
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.
Hm, only delete button.
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 see. In this case comment should be fixed a little: delete/remove
> delete
} | ||
|
||
public interface Locators { | ||
String FACTORY_NAME = "//span[contains(@class,'che-toolbar-title-label')]"; |
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.
FACTORY_NAME
> FACTORY_NAME_XPATH
|
||
public interface Locators { | ||
String FACTORY_NAME = "//span[contains(@class,'che-toolbar-title-label')]"; | ||
String BACK_TO_FACTORIES_LIST_BUTTON = "//a[@title='All factories']"; |
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.
BACK_TO_FACTORIES_LIST_BUTTON
> ALL_FACTORIES_BUTTON
public class FactoryDetails { | ||
|
||
private final SeleniumWebDriver seleniumWebDriver; | ||
private final WebDriverWait redrawUiElementsTimeout; |
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.
redrawUiElementsTimeout
> redrawUiElementsTimeoutWait
import org.openqa.selenium.support.PageFactory; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
||
public class NewFactory { |
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.
CreateFactoryPage
class name sounds better, IMHO.
@@ -140,7 +140,7 @@ public void waitNoWorkspacesFound() { | |||
visibilityOfElementLocated(By.xpath(Locators.NO_WORKSPACE_FOUND))); | |||
} | |||
|
|||
// select workspaces by checkboxes | |||
// select workspaces by checkbox |
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.
workspaces
> workspace
private static final String FACTORY_CREATED_FROM_WORKSPACE_NAME = generate("factory", 4); | ||
private static final String MIN_FACTORY_NAME = generate("", 3); | ||
private static final String MAX_FACTORY_NAME = generate("", 20); | ||
private static final String NAME_IS_TOO_SHORT = "The name has to be more than 3 characters long."; |
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.
NAME_IS_TOO_SHORT
> TOO_SHORT_NAME
private static final String MIN_FACTORY_NAME = generate("", 3); | ||
private static final String MAX_FACTORY_NAME = generate("", 20); | ||
private static final String NAME_IS_TOO_SHORT = "The name has to be more than 3 characters long."; | ||
private static final String NAME_IS_TOO_LONG = "The name has to be less than 20 characters long."; |
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.
NAME_IS_TOO_LONG
> TOO_LONG_NAME
dashboardFactories.clickOnAddFactoryBtn(); | ||
newFactory.waitToolbarTitle(); | ||
|
||
// open tabs and check it fields |
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.
it
> their
|
||
@Test | ||
public void checkFactoryName() { | ||
dashboardFactories.selectFactoriesOnNavBar(); |
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.
Comment on this part as well, please.
|
||
@Test | ||
public void checkCreatingFactoryFromTemplates() { | ||
dashboardFactories.selectFactoriesOnNavBar(); |
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.
Comment on this part as well, please.
|
||
@Test | ||
public void checkCreatingFactoryFromWorkspace() { | ||
dashboardFactories.selectFactoriesOnNavBar(); |
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.
Comment on this part as well, please.
} | ||
|
||
@Test | ||
public void checkCreatingFactoryFromWorkspace() { |
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.
checkCreatingFactoryFromWorkspace
> shouldCreatingFactoryFromWorkspace
} | ||
|
||
@Test | ||
public void checkCreatingFactoryFromTemplates() { |
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.
checkCreatingFactoryFromTemplates
> shouldCreateFactoryFromTemplate
} | ||
|
||
@Test | ||
public void checkFactoryName() { |
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.
checkFactoryName
> shouldHandleIncorrectFactoryNames
|
||
@Test | ||
public void checkNewFactoryPage() { | ||
dashboardFactories.selectFactoriesOnNavBar(); |
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.
Looks like this test duplicates other ones.
|
||
@Test | ||
public void checkWorkspaceFiltering() { | ||
dashboardFactories.selectFactoriesOnNavBar(); |
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.
Comment on this part as well, please.
Please, don't forget to add new tests into the CheSuite.xml file. |
What does this PR do?
This PR add selenium tests which cover working with factories on the Dashboard.
The CreateFactoryTest test:
The FactoriesListTest test:
What issues does this PR fix or reference?
#8891