Skip to content

Commit

Permalink
Selenium: Add the 'try-catch' to the 'GitPullTest' (#11652)
Browse files Browse the repository at this point in the history
  • Loading branch information
artaleks9 authored Oct 18, 2018
1 parent 7711b9e commit 4b5a297
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Git.Remotes.PULL;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Git.Remotes.REMOTES_TOP;
import static org.eclipse.che.selenium.pageobject.Wizard.TypeProject.BLANK;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import com.google.inject.name.Named;
Expand All @@ -31,6 +32,7 @@
import org.eclipse.che.selenium.pageobject.Menu;
import org.eclipse.che.selenium.pageobject.NotificationsPopupPanel;
import org.eclipse.che.selenium.pageobject.ProjectExplorer;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -92,7 +94,7 @@ public void pullTest() throws Exception {
git.waitGitStatusBarWithMess(
String.format("Successfully pulled from %s", testRepo.getHtmlUrl()));

checkPullAfterUpdatingContent(readmeTxtFileName, currentTimeInMillis);
checkPullAfterUpdatingContent(jsFileName, currentTimeInMillis);
checkPullAfterUpdatingContent(htmlFileName, currentTimeInMillis);
checkPullAfterUpdatingContent(readmeTxtFileName, currentTimeInMillis);

Expand All @@ -105,7 +107,7 @@ public void pullTest() throws Exception {
readmeTxtFileName,
String.format("/%s/%s/%s", PROJECT_NAME, folderWithPlainFilesPath, readmeTxtFileName));
checkPullAfterRemovingContent(
"README.md",
readmeMdFileName,
String.format("/%s/%s/%s", PROJECT_NAME, folderWithPlainFilesPath, readmeMdFileName));
}

Expand All @@ -129,7 +131,14 @@ private void checkPullAfterUpdatingContent(String tabNameOpenedFile, String expe

private void checkPullAfterRemovingContent(
String tabNameOpenedFile, String pathToItemInProjectExplorer) {
editor.waitTabIsNotPresent(tabNameOpenedFile);

try {
editor.waitTabIsNotPresent(tabNameOpenedFile);
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known random failure https://github.com/eclipse/che/issues/11648");
}

projectExplorer.waitLibrariesAreNotPresent(pathToItemInProjectExplorer);
}
}

0 comments on commit 4b5a297

Please sign in to comment.