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

Selenium: Add the 'try-catch' to the 'GitPullTest' #11652

Merged
merged 5 commits into from
Oct 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}