Conversation
|
ci-test |
|
ci-test build report: |
| // TODO it is the workaround, delete it after resolve the issue | ||
| // TODO https://github.com/eclipse/che/issues/10515 | ||
| // close unexpected error information dialog and click on the 'Save' button; | ||
| int counterErrorDialog = 0; |
There was a problem hiding this comment.
please encapsulate this logic to the method for more readability
There was a problem hiding this comment.
Even more. Better to use the next construction:
webDriverWaitFactory.get().until((ExpectedCondition<Boolean>) driver -> {
informationDialog.waitFormToOpen();
informationDialog.clickOkBtn();
projectWizard.clickSaveButton();
loader.waitOnClosed();
return informationDialog.waitFormIsOpened();
});
In this case we explicitely provide time for event waiting.
In case of using "while" the infinite loop is possible.
| seleniumWebDriverHelper.waitVisibility(dialogForm); | ||
| } | ||
|
|
||
| public boolean waitFormIsOpened() { |
| loader.waitOnClosed(); | ||
| } | ||
|
|
||
| System.out.println( |
| // then open files | ||
| // open a java file | ||
| projectExplorer.quickRevealToItemWithJavaScript( | ||
| String.format("%s/%s", PROJECT_NAME, PATH_TO_JAVA_FILE)); |
There was a problem hiding this comment.
What about creating the constant for this path?
|
|
||
| // open a xml file | ||
| projectExplorer.quickRevealToItemWithJavaScript( | ||
| String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); |
|
|
||
| // open a ts file | ||
| projectExplorer.quickRevealToItemWithJavaScript( | ||
| String.format("%s/%s", PROJECT_NAME, PATH_TO_TS_FILE)); |
|
|
||
| // open the resolving dependencies form | ||
| loader.waitOnClosed(); | ||
| mavenPluginStatusBar.waitExpectedTextInInfoPanel("Resolving project:", 120); |
There was a problem hiding this comment.
Please create variable or constant which describes this "magic number". I mean "120"
| mavenPluginStatusBar.waitResolveDependenciesFormToOpen(); | ||
|
|
||
| // wait while dependencies are resolved | ||
| mavenPluginStatusBar.waitClosingInfoPanel(2900); |
| @Test(priority = 1) | ||
| public void checkErrorMarkersInEditor() { | ||
| // check an error marker in the pom.xml file | ||
| projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); |
| editor.waitMarkerInvisibility(ERROR, 12); | ||
|
|
||
| // check error marker in the ts file | ||
| projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_TS_FILE)); |
|
|
||
| @Test | ||
| public void checkImportAndResolveDependenciesEclipceCheProject() { | ||
| int timeoutToOpenInfoPanel = 120; |
There was a problem hiding this comment.
they should be "final"
final int timeoutToOpenInfoPanel = 120;
final int timeoutToClosingInfoPanel = 2900;
| projectExplorer.quickRevealToItemWithJavaScript( | ||
| String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); | ||
| projectExplorer.openItemByPath(String.format("%s/%s", PROJECT_NAME, PATH_TO_POM_FILE)); | ||
| projectExplorer.quickRevealToItemWithJavaScript(PATH_TO_POM_FILE); |
There was a problem hiding this comment.
this place repeats several times:
projectExplorer.quickRevealToItemWithJavaScript( ... );
projectExplorer.openItemByPath( ... );
what about to create a private method in the test or public method in the "ProjectExplorer" which will encapsulate this two methods, something like that:
private void quickRevealToItemWithJavaScriptAndOpenFile(String pathToItem){
projectExplorer.quickRevealToItemWithJavaScript(pathToItem);
projectExplorer.openItemByPath(pathToItem);
}
There was a problem hiding this comment.
I agree. I think it is better to do in the test.
|
|
||
| if (counterErrorDialog > 5) { | ||
|
|
||
| Assert.assertEquals( |
There was a problem hiding this comment.
"assertEquals" looks redundant, in my opinion, "Assert.fail()" is better to use in this case:
fail("The unexpected error information dialog is appeared more than "+ counterErrorDialog +" times");
What does this PR do?
What issues does this PR fix or reference?
#10107