() {
- @Override
- public String call() throws Exception {
- return editorPage.getBasicTranslationTargetAtRowIndex(0);
- }
- }, Matchers.equalTo("hello world translated"));
+ assertThat(editorPage.expectBasicTranslationAtRowIndex(0,
+ "hello world translated")).isTrue();
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/dashboard/DashboardTest.java b/functional-test/src/test/java/org/zanata/feature/dashboard/DashboardTest.java
index d2c5957e17..0f3509fc30 100644
--- a/functional-test/src/test/java/org/zanata/feature/dashboard/DashboardTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/dashboard/DashboardTest.java
@@ -31,6 +31,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
@@ -72,7 +73,9 @@ public void setUp() {
dashboard = new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Feature(summary = "The user can traverse Dashboard activity lists",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
@Category(BasicAcceptanceTest.class)
public void dashboardBasicTests() throws Exception {
assertThat(dashboardPresentAfterLogin())
@@ -91,8 +94,7 @@ private boolean activityListExpands() throws Exception {
DashboardActivityTab activityTab = dashboard.gotoActivityTab();
assertThat(activityTab.getMyActivityList()).isNotEmpty();
int initialActivitySize = activityTab.getMyActivityList().size();
- activityTab.clickMoreActivity();
- return activityTab.getMyActivityList().size() > initialActivitySize;
+ return activityTab.clickMoreActivity();
}
private boolean projectListIsNotEmpty() throws Exception {
@@ -100,30 +102,33 @@ private boolean projectListIsNotEmpty() throws Exception {
return projectsTab.getMaintainedProjectList().size() > 0;
}
- @Test
+ @Feature(summary = "The user can change their email address",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void accountEmailModification() throws Exception {
- final String successMessage =
- "You will soon receive an email with a link to activate your email account change.";
dashboard.goToSettingsTab()
.gotoSettingsAccountTab()
.typeNewAccountEmailAddress("new@fakeemail.com")
.clickUpdateEmailButton();
- assertThat(dashboard.expectNotification(successMessage));
+ assertThat(dashboard.expectNotification(DashboardBasePage.EMAIL_SENT));
}
- @Test
+ @Feature(summary = "The user can change their password",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 86823)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void passwordChange() throws Exception {
- final String passwordChanged =
- "Your password has been successfully changed.";
dashboard.goToSettingsTab()
.gotoSettingsAccountTab()
.typeOldPassword("admin")
.typeNewPassword("admin2")
.clickUpdatePasswordButton();
- assertThat(dashboard.expectNotification(passwordChanged));
+ assertThat(dashboard.expectNotification(
+ DashboardBasePage.PASSWORD_UPDATE_SUCCESS));
}
- @Test
+ @Feature(summary = "The user can begin creating a project from the Dashboard",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void createProject() throws Exception {
CreateProjectPage createProjectPage =
dashboard.gotoProjectsTab().clickOnCreateProjectLink();
diff --git a/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java
new file mode 100644
index 0000000000..915eb81702
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/feature/document/DocTypeUploadTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.feature.document;
+
+import lombok.extern.slf4j.Slf4j;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.experimental.categories.Category;
+import org.junit.experimental.theories.DataPoint;
+import org.junit.experimental.theories.Theories;
+import org.junit.experimental.theories.Theory;
+import org.junit.runner.RunWith;
+import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
+import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.page.projectversion.VersionDocumentsPage;
+import org.zanata.page.projectversion.VersionLanguagesPage;
+import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab;
+import org.zanata.page.webtrans.EditorPage;
+import org.zanata.util.CleanDocumentStorageRule;
+import org.zanata.util.SampleProjectRule;
+import org.zanata.util.TestFileGenerator;
+import org.zanata.workflow.LoginWorkFlow;
+import org.zanata.workflow.ProjectWorkFlow;
+
+import java.io.File;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Damian Jansen
+ * djansen@redhat.com
+ */
+@Slf4j
+@RunWith(Theories.class)
+public class DocTypeUploadTest extends ZanataTestCase {
+
+ @ClassRule
+ public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
+
+ @ClassRule
+ public static CleanDocumentStorageRule documentStorageRule =
+ new CleanDocumentStorageRule();
+
+ @BeforeClass
+ public static void beforeClass() {
+ new LoginWorkFlow().signIn("admin", "admin");
+ new ProjectWorkFlow().createNewProjectVersion(
+ "about fedora", "doctype-upload", "File")
+ .logout();
+ }
+
+ private static String testString = "Test text 1";
+
+ @DataPoint
+ public static File SRT_FILE = new TestFileGenerator()
+ .generateTestFileWithContent(
+ "testsrtfile", ".srt",
+ "1" + sep() + "00:00:01,000 --> 00:00:02,000" +
+ sep() + testString);
+
+ @DataPoint
+ public static File WEBVTT_FILE = new TestFileGenerator()
+ .generateTestFileWithContent(
+ "testvttfile", ".vtt",
+ "00:01.000 --> 00:01.000" +
+ sep() + testString);
+
+ @DataPoint
+ public static File SBT_FILE = new TestFileGenerator()
+ .generateTestFileWithContent(
+ "testsbtfile", ".sbt",
+ "00:04:35.03,00:04:38.82" +
+ sep() + testString);
+
+ @DataPoint
+ public static File SUB_FILE = new TestFileGenerator()
+ .generateTestFileWithContent(
+ "testsubfile", ".sub",
+ "00:04:35.03,00:04:38.82" +
+ sep() + testString);
+
+ @Theory
+ @Category(BasicAcceptanceTest.class)
+ public void uploadFile(File testFile) throws Exception {
+ String testFileName = testFile.getName();
+ log.info("[uploadFile] "+testFileName);
+
+ VersionDocumentsPage versionDocumentsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("doctype-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoDocumentTab();
+
+ assertThat(versionDocumentsPage.sourceDocumentsContains(testFileName))
+ .as("Document shows in table");
+
+ EditorPage editorPage = versionDocumentsPage
+ .gotoLanguageTab()
+ .translate("pl", testFileName);
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo(testString)
+ .as("The translation source is correct");
+ }
+
+ private static String sep() {
+ return System.getProperty("line.separator");
+ }
+
+}
diff --git a/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java b/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java
index 6c1ba265c0..5c82671150 100644
--- a/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/document/HTMLDocumentTypeTest.java
@@ -22,89 +22,140 @@
import java.io.File;
-import org.hamcrest.Matchers;
import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projectversion.VersionDocumentsPage;
-import org.zanata.page.projectversion.VersionLanguagesPage;
+import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab;
import org.zanata.page.webtrans.EditorPage;
-import org.zanata.util.CleanDocumentStorageRule;
import org.zanata.util.SampleProjectRule;
import org.zanata.util.TestFileGenerator;
-import org.zanata.workflow.BasicWorkFlow;
import org.zanata.workflow.LoginWorkFlow;
+import org.zanata.page.projects.projectsettings.ProjectPermissionsTab;
+import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.zanata.util.FunctionalTestHelper.assumeFalse;
+import static org.assertj.core.api.Assertions.assertThat;
/**
- * @author Damian Jansen djansen@redhat.com
+ * @author Damian Jansen
+ * djansen@redhat.com
*/
@Category(DetailedTest.class)
public class HTMLDocumentTypeTest extends ZanataTestCase {
- @Rule
- public SampleProjectRule sampleProjectRule = new SampleProjectRule();
-
- @Rule
- public CleanDocumentStorageRule documentStorageRule =
- new CleanDocumentStorageRule();
+ @ClassRule
+ public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
private TestFileGenerator testFileGenerator = new TestFileGenerator();
- @Before
- public void before() {
- new BasicWorkFlow().goToHome().deleteCookiesAndRefresh();
- String documentStorageDirectory =
- CleanDocumentStorageRule.getDocumentStoragePath()
- .concat(File.separator).concat("documents")
- .concat(File.separator);
- assumeFalse("", new File(documentStorageDirectory).exists());
+ @BeforeClass
+ public static void beforeClass() {
+ ProjectPermissionsTab projectPermissionsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsPermissionsTab()
+ .enterSearchMaintainer("translator")
+ .selectSearchMaintainer("translator");
+ projectPermissionsTab.expectNotification(
+ "Maintainer \"translator\" has been added to project.");
+ projectPermissionsTab = projectPermissionsTab.clickRemoveOn("admin");
+ projectPermissionsTab.expectNotification("Maintainer \"Administrator\" " +
+ "has been removed from project.");
+ new ProjectWorkFlow().createNewProjectVersion(
+ "about fedora", "html-upload", "File")
+ .logout();
}
- @Test
- public void uploadHTMLFile() {
- File htmlfile =
- testFileGenerator
- .generateTestFileWithContent("testhtmlfile", ".html",
- "Test content
This is Bold text");
+ @Feature(bugzilla = 980670,
+ summary = "Administrator can upload a HTML file for translation",
+ tcmsTestCaseIds = { 377743 },
+ tcmsTestPlanIds = { 5316 } )
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void uploadHTMLFileAsAdministrator() throws Exception {
+ File htmlfile = testFileGenerator.generateTestFileWithContent(
+ "testhtmlfile", ".html",
+ "Test content" +
+ "
This is Bold text");
String testFileName = htmlfile.getName();
- String successfullyUploaded = "Document " + testFileName + " uploaded.";
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin")
- .goToProjects()
- .goToProject("about fedora")
- .gotoVersion("master")
- .gotoSettingsTab()
- .gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(htmlfile.getAbsolutePath())
- .submitUpload();
- assertThat("Document uploaded notification shows",
- projectVersionPage.getNotificationMessage(),
- Matchers.equalTo(successfullyUploaded));
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("html-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(htmlfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
VersionDocumentsPage versionDocumentsPage =
- projectVersionPage.gotoDocumentTab();
+ versionDocumentsTab.gotoDocumentTab();
+
+ assertThat(versionDocumentsPage.
+ sourceDocumentsContains(htmlfile.getName()))
+ .as("Document shows in table");
+
+ EditorPage editorPage = versionDocumentsPage
+ .gotoLanguageTab()
+ .translate("pl", testFileName);
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test content")
+ .as("The first translation source is correct");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("This is Bold text")
+ .as("The second translation source is correct");
+ }
+
+ @Feature(bugzilla = 980670,
+ summary = "Maintainer can upload a HTML file for translation",
+ tcmsTestCaseIds = { 377837 },
+ tcmsTestPlanIds = { 5316 } )
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void uploadHTMLFileAsMaintainer() throws Exception {
+ File htmlfile = testFileGenerator.generateTestFileWithContent(
+ "testhtmlfile", ".html",
+ "Test content" +
+ "
This is Bold text"
+ );
+ String testFileName = htmlfile.getName();
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("html-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(htmlfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
- assertThat("Document shows in table", versionDocumentsPage
- .sourceDocumentsContains(htmlfile.getName()));
+ VersionDocumentsPage versionDocumentsPage =
+ versionDocumentsTab.gotoDocumentTab();
- EditorPage editorPage =
- projectVersionPage.goToProjects().goToProject("about fedora")
- .gotoVersion("master").translate("pl", testFileName);
+ assertThat(versionDocumentsPage
+ .sourceDocumentsContains(htmlfile.getName()))
+ .as("Document shows in table");
- assertThat("The first translation source is correct",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("Test content"));
- assertThat("The second translation source is correct",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("This is Bold text"));
+ EditorPage editorPage = versionDocumentsPage
+ .gotoLanguageTab()
+ .translate("pl", testFileName);
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test content")
+ .as("The first translation source is correct");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("This is Bold text")
+ .as("The second translation source is correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java
new file mode 100644
index 0000000000..d974b21a53
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/feature/document/MultiFileUploadTest.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2013, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.feature.document;
+
+import java.io.File;
+
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
+import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.page.projectversion.VersionDocumentsPage;
+import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab;
+import org.zanata.util.CleanDocumentStorageRule;
+import org.zanata.util.SampleProjectRule;
+import org.zanata.util.TestFileGenerator;
+import org.zanata.workflow.BasicWorkFlow;
+import org.zanata.workflow.LoginWorkFlow;
+import org.zanata.workflow.ProjectWorkFlow;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Damian Jansen
+ * djansen@redhat.com
+ */
+@Category(DetailedTest.class)
+@Slf4j
+public class MultiFileUploadTest extends ZanataTestCase {
+
+ @ClassRule
+ public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
+
+ @Rule
+ public CleanDocumentStorageRule documentStorageRule =
+ new CleanDocumentStorageRule();
+
+ private TestFileGenerator testFileGenerator = new TestFileGenerator();
+ private String documentStorageDirectory;
+
+
+ @BeforeClass
+ public static void beforeClass() {
+ new LoginWorkFlow().signIn("admin", "admin");
+ new ProjectWorkFlow().createNewProjectVersion(
+ "about fedora", "multi-upload", "File")
+ .logout();
+ }
+
+ @Before
+ public void before() {
+ new BasicWorkFlow().goToHome().deleteCookiesAndRefresh();
+ documentStorageDirectory = CleanDocumentStorageRule
+ .getDocumentStoragePath()
+ .concat(File.separator)
+ .concat("documents")
+ .concat(File.separator);
+
+ if (new File(documentStorageDirectory).exists()) {
+ log.warn("Document storage directory exists (cleanup incomplete)");
+ }
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ @Category(BasicAcceptanceTest.class)
+ public void uploadedDocumentsAreInFilesystem() {
+ File firstFile = testFileGenerator.generateTestFileWithContent(
+ "multiuploadInFilesystem", ".txt",
+ "This is a test file");
+ File secondFile = testFileGenerator.generateTestFileWithContent(
+ "multiuploadInFilesystem2", ".txt",
+ "This is another test file");
+ String testFileName = firstFile.getName();
+
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("multi-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(firstFile.getAbsolutePath())
+ .enterFilePath(secondFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
+
+ assertThat(new File(documentStorageDirectory).list().length)
+ .isEqualTo(2)
+ .as("There are two uploaded source files");
+
+ VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
+ .gotoDocumentTab()
+ .waitForSourceDocsContains(testFileName);
+
+ assertThat(versionDocumentsPage.getSourceDocumentNames())
+ .contains(firstFile.getName())
+ .contains(secondFile.getName())
+ .as("The documents were uploaded");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void removeFileFromUploadList() {
+ File keptUploadFile = testFileGenerator.generateTestFileWithContent(
+ "removeFileFromUploadList", ".txt", "Remove File Upload Test");
+
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("multi-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(keptUploadFile.getAbsolutePath())
+ .enterFilePath("/tmp/fakefile.txt");
+
+ assertThat(versionDocumentsTab.getUploadList())
+ .contains(keptUploadFile.getName())
+ .contains("fakefile.txt")
+ .as("The intended files are listed");
+
+ versionDocumentsTab = versionDocumentsTab.clickRemoveOn("fakefile.txt");
+
+ assertThat(versionDocumentsTab.getUploadList())
+ .contains(keptUploadFile.getName())
+ .doesNotContain("fakefile.txt")
+ .as("The fakefile has been removed");
+
+ VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
+ .submitUpload()
+ .clickUploadDone()
+ .gotoDocumentTab();
+
+ assertThat(versionDocumentsPage.getSourceDocumentNames())
+ .contains(keptUploadFile.getName())
+ .doesNotContain("fakefile.txt")
+ .as("Only the intended file was uploaded");
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java b/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java
new file mode 100644
index 0000000000..8a2434f55d
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/feature/document/SubtitleDocumentTypeTest.java
@@ -0,0 +1,274 @@
+/*
+ * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.feature.document;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.page.projectversion.VersionDocumentsPage;
+import org.zanata.page.projectversion.VersionLanguagesPage;
+import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab;
+import org.zanata.page.webtrans.EditorPage;
+import org.zanata.util.CleanDocumentStorageRule;
+import org.zanata.util.SampleProjectRule;
+import org.zanata.util.TestFileGenerator;
+import org.zanata.workflow.BasicWorkFlow;
+import org.zanata.workflow.LoginWorkFlow;
+import org.zanata.workflow.ProjectWorkFlow;
+
+import java.io.File;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.zanata.util.FunctionalTestHelper.assumeTrue;
+
+/**
+ * Covers more detailed testing of the subtitle formats
+ * @see DocTypeUploadTest
+ * @author Damian Jansen
+ * djansen@redhat.com
+ */
+@Category(DetailedTest.class)
+public class SubtitleDocumentTypeTest extends ZanataTestCase {
+
+ @ClassRule
+ public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
+
+ @Rule
+ public CleanDocumentStorageRule documentStorageRule =
+ new CleanDocumentStorageRule();
+
+ private TestFileGenerator testFileGenerator = new TestFileGenerator();
+ private String sep = System.getProperty("line.separator");
+
+ @BeforeClass
+ public static void beforeClass() {
+ new LoginWorkFlow().signIn("admin", "admin");
+ new ProjectWorkFlow().createNewProjectVersion(
+ "about fedora", "subtitle-upload", "File")
+ .logout();
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void similarSrtEntriesAreIndividual() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("duplicationinsrtfile", ".srt",
+ "1" + sep +
+ "00:00:01,000 --> 00:00:02,000" + sep +
+ "Exactly the same text" + sep + sep +
+ "2" + sep +
+ "00:00:02,000 --> 00:00:03,000" + sep +
+ "Exactly the same text"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Exactly the same text")
+ .as("The first translation source is correct");
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Exactly the same text")
+ .as("The second translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void webVttLabelsAreNotParsed() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("labelledVttfile", ".vtt",
+ "Introduction" + sep +
+ "00:00:01.000 --> 00:00:02.000" + sep +
+ "Test subtitle 1"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test subtitle 1")
+ .as("The translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void multilineSRTAreParsedCorrectly() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("multilinesrtfile", ".srt",
+ "1" + sep +
+ "00:00:01,000 --> 00:00:02,000" + sep +
+ "Test subtitle 1" + sep +
+ "Test subtitle 1 line 2" + sep + sep +
+ "2" + sep +
+ "00:00:03,000 --> 00:00:04,000" + sep +
+ "Test subtitle 2"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test subtitle 1" + sep + "Test subtitle 1 line 2")
+ .as("The first translation source is correct");
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Test subtitle 2")
+ .as("The second translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void multilineVTTAreParsedCorrectly() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("multilinevttfile", ".vtt",
+ "00:00:01.000 --> 00:00:02.000" + sep +
+ "Test subtitle 1" + sep +
+ "Test subtitle 1 line 2" + sep + sep +
+ "00:00:03.000 --> 00:00:04.000" + sep +
+ "Test subtitle 2"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test subtitle 1" + sep + "Test subtitle 1 line 2")
+ .as("The first translation source is correct");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Test subtitle 2")
+ .as("The second translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void multilineSBTAreParsedCorrectly() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("multilinesbtfile", ".sbt",
+ "00:04:35.03,00:04:38.82" + sep +
+ "Test subtitle 1" + sep +
+ "Test subtitle 1 line 2" + sep + sep +
+ "2" + sep +
+ "00:04:39.03,00:04:44.82" + sep +
+ "Test subtitle 2"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test subtitle 1" + sep + "Test subtitle 1 line 2")
+ .as("The first translation source is correct");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Test subtitle 2")
+ .as("The second translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void multilineSubAreParsedCorrectly() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(testFileGenerator
+ .generateTestFileWithContent("multilinesubfile", ".sub",
+ "00:04:35.03,00:04:38.82" + sep +
+ "Test subtitle 1" + sep +
+ "Test subtitle 1 line 2" + sep + sep +
+ "00:04:39.03,00:04:44.82" + sep +
+ "Test subtitle 2"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Test subtitle 1" + sep + "Test subtitle 1 line 2")
+ .as("The first translation source is correct");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Test subtitle 2")
+ .as("The second translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void formattingInSrtEntries() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(
+ testFileGenerator.generateTestFileWithContent(
+ "formattedsrtfile",
+ ".srt",
+ "1" + sep + "00:00:01,000 --> 00:00:02,000" + sep +
+ "Exactly the same text {u}and more{/u}"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Exactly the same text {u}and more{/u}")
+ .as("The translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void formattingInVttEntries() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(
+ testFileGenerator.generateTestFileWithContent(
+ "formattedvttfile",
+ ".vtt",
+ "00:00:01.000 --> 00:00:02.000" + sep +
+ "Exactly the same text {u}and more{/u}"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Exactly the same text {u}and more{/u}")
+ .as("The translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void formattingInSbtEntries() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(
+ testFileGenerator.generateTestFileWithContent(
+ "formattedsbtfile",
+ ".sbt",
+ "00:04:35.03,00:04:38.82" + sep +
+ "Exactly the same text {u}and more{/u}"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Exactly the same text {u}and more{/u}")
+ .as("The translation source is correct");
+ }
+
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void formattingInSubEntries() throws Exception {
+ EditorPage editorPage = uploadAndGoToDocument(
+ testFileGenerator.generateTestFileWithContent(
+ "formattedsubfile",
+ ".sub",
+ "00:04:35.03,00:04:38.82" + sep +
+ "Exactly the same text {u}and more{/u}"));
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Exactly the same text {u}and more{/u}")
+ .as("The translation source is correct");
+ }
+
+ /*
+ * Upload and open the test file in the editor for verification
+ */
+ private EditorPage uploadAndGoToDocument(File testFile) {
+ VersionDocumentsPage versionDocumentsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("subtitle-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoDocumentTab();
+
+ assertThat(versionDocumentsPage.sourceDocumentsContains(testFile
+ .getName())).as("Document shows in table");
+
+ return versionDocumentsPage
+ .gotoLanguageTab()
+ .translate("pl", testFile.getName());
+ }
+
+ private boolean storageIsClean(String documentStorageDirectory) {
+ File testDir;
+ try {
+ testDir = new File(documentStorageDirectory);
+ return testDir.listFiles().equals(null) ||
+ testDir.listFiles().length == 0;
+ } catch (NullPointerException npe) {
+ return true;
+ }
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java b/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java
index 12abbba142..cae51a2683 100644
--- a/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/document/UploadTest.java
@@ -23,8 +23,9 @@
import java.io.File;
import lombok.extern.slf4j.Slf4j;
-import org.hamcrest.Matchers;
import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -33,27 +34,27 @@
import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projectversion.VersionDocumentsPage;
-import org.zanata.page.projectversion.VersionLanguagesPage;
import org.zanata.page.projectversion.versionsettings.VersionDocumentsTab;
import org.zanata.util.CleanDocumentStorageRule;
import org.zanata.util.SampleProjectRule;
import org.zanata.util.TestFileGenerator;
import org.zanata.workflow.BasicWorkFlow;
import org.zanata.workflow.LoginWorkFlow;
+import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeTrue;
/**
- * @author Damian Jansen djansen@redhat.com
+ * @author Damian Jansen
+ * djansen@redhat.com
*/
@Category(DetailedTest.class)
@Slf4j
public class UploadTest extends ZanataTestCase {
- @Rule
- public SampleProjectRule sampleProjectRule = new SampleProjectRule();
+ @ClassRule
+ public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
@Rule
public CleanDocumentStorageRule documentStorageRule =
@@ -62,6 +63,15 @@ public class UploadTest extends ZanataTestCase {
private TestFileGenerator testFileGenerator = new TestFileGenerator();
private String documentStorageDirectory;
+
+ @BeforeClass
+ public static void beforeClass() {
+ new LoginWorkFlow().signIn("admin", "admin");
+ new ProjectWorkFlow().createNewProjectVersion(
+ "about fedora", "txt-upload", "File")
+ .logout();
+ }
+
@Before
public void before() {
new BasicWorkFlow().goToHome().deleteCookiesAndRefresh();
@@ -76,7 +86,7 @@ public void before() {
}
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
@Category(BasicAcceptanceTest.class)
public void uploadedDocumentIsInFilesystem() {
File originalFile =
@@ -85,34 +95,39 @@ public void uploadedDocumentIsInFilesystem() {
"This is a test file");
String testFileName = originalFile.getName();
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(originalFile.getAbsolutePath())
- .submitUpload();
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(originalFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
- // We should be able to assume the new file is the only file
- assertThat("There is only one uploaded source file", new File(
- documentStorageDirectory).list().length, Matchers.equalTo(1));
+ assertThat(new File(documentStorageDirectory).list().length)
+ .isEqualTo(1)
+ .as("There is only one uploaded source file");
File newlyCreatedFile = new File(documentStorageDirectory,
testFileGenerator
.getFirstFileNameInDirectory(documentStorageDirectory));
- assertThat("The contents of the file were also uploaded",
- testFileGenerator.getTestFileContent(newlyCreatedFile),
- Matchers.equalTo("This is a test file"));
- VersionDocumentsPage versionDocumentsPage = projectVersionPage
+ assertThat(testFileGenerator.getTestFileContent(newlyCreatedFile))
+ .isEqualTo("This is a test file")
+ .as("The contents of the file were also uploaded");
+ VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
.gotoDocumentTab()
.waitForSourceDocsContains(testFileName);
- assertThat("Document shows in table",
- versionDocumentsPage.sourceDocumentsContains(testFileName));
+ assertThat(versionDocumentsPage.sourceDocumentsContains(testFileName))
+ .isTrue()
+ .as("Document shows in table");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void cancelFileUpload() {
File cancelUploadFile =
testFileGenerator.generateTestFileWithContent(
@@ -122,51 +137,59 @@ public void cancelFileUpload() {
.signIn("admin", "admin")
.goToProjects()
.goToProject("about fedora")
- .gotoVersion("master")
+ .gotoVersion("txt-upload")
.gotoSettingsTab()
.gotoSettingsDocumentsTab()
.pressUploadFileButton()
.enterFilePath(cancelUploadFile.getAbsolutePath())
.cancelUpload();
- assertThat("Document does not show in table",
- !versionDocumentsTab
- .sourceDocumentsContains("cancelFileUpload.txt"));
+ assertThat(versionDocumentsTab.sourceDocumentsContains("cancelFileUpload.txt"))
+ .isFalse()
+ .as("Document does not show in table");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void emptyFilenameUpload() {
- VersionDocumentsTab versionDocumentsTab =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton();
-
- assertThat("The upload button is not available",
- !versionDocumentsTab.canSubmitDocument());
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton();
+
+ assertThat(versionDocumentsTab.canSubmitDocument())
+ .isFalse()
+ .as("The upload button is not available");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
@Ignore("RHBZ-990836")
public void handleReallyBigFile() {
File bigFile =
- testFileGenerator.generateTestFileWithContent("bigFile",
- ".txt", "Big file content");
+ testFileGenerator.generateTestFileWithContent(
+ "bigFile", ".txt", "Big file content");
long fileSizeInMB = (1024 * 1024) * 500;
testFileGenerator.forceFileSize(bigFile, fileSizeInMB);
assumeTrue("Data file " + bigFile.getName() + " is big",
bigFile.length() == fileSizeInMB);
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(bigFile.getAbsolutePath())
- .submitUpload();
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(bigFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
- projectVersionPage.assertNoCriticalErrors();
+ versionDocumentsTab.assertNoCriticalErrors();
// TODO: Verify graceful handling of scenario
}
@@ -179,99 +202,102 @@ public void failOnInvalidFileUpload() {
String successfullyUploaded =
"Document " + noFile.getName() + " uploaded.";
- VersionDocumentsTab versionDocumentsTab =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(noFile.getAbsolutePath());
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(noFile.getAbsolutePath());
- assertThat("Data file " + noFile.getName() + " does not exist",
- noFile.delete() && !noFile.exists());
+ assertThat(noFile.delete() && !noFile.exists())
+ .as("Data file " + noFile.getName() + " does not exist");
- VersionLanguagesPage versionLanguagesPage = versionDocumentsTab
- .submitUpload();
- versionLanguagesPage.assertNoCriticalErrors();
- assertThat("Success message is shown",
- versionLanguagesPage.expectNotification(successfullyUploaded));
+ versionDocumentsTab = versionDocumentsTab
+ .submitUpload()
+ .clickUploadDone();
+
+ versionDocumentsTab.assertNoCriticalErrors();
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void handleVeryLongFileNames() {
- File longFile =
- testFileGenerator.generateTestFileWithContent(
- testFileGenerator.longFileName(), ".txt",
- "This filename is long");
- String successfullyUploaded =
- "Document " + longFile.getName() + " uploaded.";
-
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(longFile.getAbsolutePath())
- .submitUpload();
-
- assertThat("Document uploaded notification shows",
- projectVersionPage.expectNotification(successfullyUploaded));
+ File longFile = testFileGenerator.generateTestFileWithContent(
+ testFileGenerator.longFileName(), ".txt",
+ "This filename is long");
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(longFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
- VersionDocumentsPage versionDocumentsPage = projectVersionPage
+ VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
.gotoDocumentTab()
.waitForSourceDocsContains(longFile.getName());
- assertThat("Document shows in table", versionDocumentsPage
- .sourceDocumentsContains(longFile.getName()));
+ assertThat(versionDocumentsPage.sourceDocumentsContains(longFile.getName()))
+ .isTrue()
+ .as("Document shows in table");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void emptyFile() {
- File emptyFile =
- testFileGenerator.generateTestFileWithContent("emptyFile",
- ".txt", "");
- String successfullyUploaded =
- "Document " + emptyFile.getName() + " uploaded.";
-
+ File emptyFile = testFileGenerator
+ .generateTestFileWithContent("emptyFile", ".txt", "");
assumeTrue("File is empty", emptyFile.length() == 0);
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(emptyFile.getAbsolutePath())
- .submitUpload();
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(emptyFile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone();
- assertThat("Data file emptyFile.txt still exists", emptyFile.exists());
- assertThat("Document uploaded notification shows",
- projectVersionPage.expectNotification(successfullyUploaded));
+ assertThat(emptyFile.exists())
+ .isTrue()
+ .as("Data file emptyFile.txt still exists");
- VersionDocumentsPage versionDocumentsPage = projectVersionPage
+ VersionDocumentsPage versionDocumentsPage = versionDocumentsTab
.gotoDocumentTab()
.waitForSourceDocsContains(emptyFile.getName());
- assertThat("Document shows in table", versionDocumentsPage
- .sourceDocumentsContains(emptyFile.getName()));
+ assertThat(versionDocumentsPage.sourceDocumentsContains(emptyFile.getName()))
+ .isTrue()
+ .as("Document shows in table");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void rejectUnsupportedValidFiletype() {
- File unsupportedFile =
- testFileGenerator.generateTestFileWithContent("testfodt",
- ".fodt", "");
- String uploadFailed =
- "Unrecognized file extension for " + unsupportedFile.getName();
-
- VersionLanguagesPage projectVersionPage =
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(unsupportedFile.getAbsolutePath())
- .submitUpload();
-
- assertThat("Unrecognized file extension error is shown",
- projectVersionPage.expectNotification(uploadFailed));
+ File unsupportedFile = testFileGenerator
+ .generateTestFileWithContent("testfodt", ".fodt", "");
+
+ VersionDocumentsTab versionDocumentsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoVersion("txt-upload")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(unsupportedFile.getAbsolutePath())
+ .submitUpload();
+
+ assertThat(versionDocumentsTab.getUploadError())
+ .contains("is not valid for a source file on this server")
+ .as("Unrecognized file extension error is shown");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java b/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java
index 97e3655a56..3ee96d9422 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/EditorFilterMessagesTest.java
@@ -12,6 +12,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.webtrans.EditorPage;
@@ -44,11 +45,14 @@ public void setUp() {
new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Feature(summary = "The user can filter translation entries using more " +
+ "than one search term",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void canFilterByMultipleFields() {
EditorPage editorPage =
new BasicWorkFlow().goToEditor("about-fedora", "master", "fr",
- document).setSyntaxHighlighting(false);
+ document);
assertThat(editorPage.getMessageSources()).containsExactly(
"hello world", "greetings", "hey");
final EditorPage page = editorPage.inputFilterQuery("resource-id:res2");
@@ -61,7 +65,9 @@ public List call() throws Exception {
}, Matchers.contains("greetings"));
}
- @Test
+ @Feature(summary = "The user may save the filter url for later use",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void editorFilterIsBookmarkable() {
String urlForEditor =
String.format(BasicWorkFlow.EDITOR_TEMPLATE, "about-fedora",
@@ -70,7 +76,7 @@ public void editorFilterIsBookmarkable() {
urlForEditor + ";search:hello%20w;resid:res1";
EditorPage editorPage =
new BasicWorkFlow().goToPage(urlWithFilterCondition,
- EditorPage.class).setSyntaxHighlighting(false);
+ EditorPage.class);
assertThat(editorPage.getMessageSources()).containsExactly("hello world");
assertThat(editorPage.getFilterQuery().trim()).isEqualTo("text:hello w resource-id:res1");
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java
index 7c559083f6..16ecd92e08 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java
@@ -23,14 +23,15 @@
import java.io.File;
import java.util.HashMap;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.experimental.categories.Category;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
+import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.webtrans.EditorPage;
@@ -41,7 +42,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeFalse;
/**
@@ -52,6 +53,9 @@
@Category(DetailedTest.class)
public class TranslateHTMLTest extends ZanataTestCase {
+ @Rule
+ public Timeout timeout = new Timeout(ZanataTestCase.MAX_LONG_TEST_DURATION);
+
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
@@ -77,71 +81,63 @@ public void before() {
new LoginWorkFlow().signIn("admin", "admin");
}
+ @Feature(summary = "The user can translate HyperText Markup Language files",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
@Theory
public void translateBasicHTMLFile(String extension) {
- File testfile =
- testFileGenerator.generateTestFileWithContent("basichtml", "."
- + extension, "Line OneLine Two
"
- + "Line Three");
-
- HashMap projectSettings =
- ProjectWorkFlow.projectDefaults();
- projectSettings.put("Project ID", extension + "-project");
- projectSettings.put("Name", extension + "-project");
- projectSettings.put("Project Type", "File");
+ File testfile = testFileGenerator.generateTestFileWithContent(
+ "basichtml", "." + extension,
+ "Line OneLine Two
Line Three");
EditorPage editorPage = new ProjectWorkFlow()
- .createNewProject(projectSettings)
- .clickCreateVersionLink().inputVersionId(extension)
- .saveVersion()
+ .goToProjectByName("about fedora")
+ .gotoVersion("master")
.gotoSettingsTab()
.gotoSettingsDocumentsTab()
.pressUploadFileButton()
.enterFilePath(testfile.getAbsolutePath())
.submitUpload()
+ .clickUploadDone()
+ .gotoLanguageTab()
.translate("fr", testfile.getName());
- assertThat("Item 1 shows Line One",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("Line One"));
- assertThat("Item 2 shows Line Two",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("Line Two"));
- assertThat("Item 3 shows Line Three",
- editorPage.getMessageSourceAtRowIndex(2),
- Matchers.equalTo("Line Three"));
-
- editorPage =
- editorPage.translateTargetAtRowIndex(0, "Une Ligne")
- .approveTranslationAtRow(0);
- editorPage =
- editorPage.translateTargetAtRowIndex(1, "Deux Ligne")
- .approveTranslationAtRow(1);
- editorPage =
- editorPage.translateTargetAtRowIndex(2, "Ligne Trois")
- .approveTranslationAtRow(2);
-
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
-
- // Close and reopen the editor to test save, switches to CodeMirror
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Line One")
+ .as("Item 1 shows Line One");
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Line Two")
+ .as("Item 2 shows Line Two");
+ assertThat(editorPage.getMessageSourceAtRowIndex(2))
+ .isEqualTo("Line Three")
+ .as("Item 3 shows Line Three");
+
+ editorPage = editorPage
+ .translateTargetAtRowIndex(0, "Une Ligne")
+ .approveTranslationAtRow(0)
+ .translateTargetAtRowIndex(1, "Deux Ligne")
+ .approveTranslationAtRow(1)
+ .translateTargetAtRowIndex(2, "Ligne Trois")
+ .approveTranslationAtRow(2);
+
+ assertTranslations(editorPage);
+
+ // Close and reopen the editor to test save
editorPage.reload();
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ assertTranslations(editorPage);
+
+ }
+
+ private void assertTranslations(EditorPage editorPage) {
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("Une Ligne")
+ .as("Item 1 shows a translation of Line One");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(1))
+ .isEqualTo("Deux Ligne")
+ .as("Item 2 shows a translation of Line Two");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(2))
+ .isEqualTo("Ligne Trois")
+ .as("Item 3 shows a translation of Line Three");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java
index d57b46fcc7..2660ff7909 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java
@@ -23,14 +23,13 @@
import java.io.File;
import java.util.HashMap;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
-import org.zanata.page.projectversion.VersionLanguagesPage;
import org.zanata.page.webtrans.EditorPage;
import org.zanata.util.CleanDocumentStorageRule;
import org.zanata.util.SampleProjectRule;
@@ -39,7 +38,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeFalse;
/**
@@ -69,71 +68,58 @@ public void before() {
new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Feature(summary = "The user can translate an InDesign file",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void translateBasicIdmlFile() {
File testfile = testFileGenerator.openTestFile("test-idml.idml");
- HashMap projectSettings =
- ProjectWorkFlow.projectDefaults();
- projectSettings.put("Project ID", "idml-project");
- projectSettings.put("Name", "idml-project");
- projectSettings.put("Project Type", "File");
-
- VersionLanguagesPage projectVersionPage =
- new ProjectWorkFlow().createNewProject(projectSettings)
- .clickCreateVersionLink().inputVersionId("idml")
- .saveVersion()
- .gotoSettingsTab()
- .gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(testfile.getAbsolutePath())
- .submitUpload();
-
- EditorPage editorPage =
- projectVersionPage.translate("fr",
- testfile.getName());
-
- assertThat("Item 1 shows Line One",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("Line One"));
- assertThat("Item 2 shows Line Two",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("Line Two"));
- assertThat("Item 3 shows Line Three",
- editorPage.getMessageSourceAtRowIndex(2),
- Matchers.equalTo("Line Three"));
-
- editorPage =
- editorPage.translateTargetAtRowIndex(0, "Une Ligne")
- .approveTranslationAtRow(0);
- editorPage =
- editorPage.translateTargetAtRowIndex(1, "Deux Ligne")
- .approveTranslationAtRow(1);
- editorPage =
- editorPage.translateTargetAtRowIndex(2, "Ligne Trois")
- .approveTranslationAtRow(2);
-
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
-
- // Close and reopen the editor to test save, switches to CodeMirror
+ EditorPage editorPage = new ProjectWorkFlow()
+ .goToProjectByName("about fedora")
+ .gotoVersion("master")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoLanguageTab()
+ .translate("fr", testfile.getName());
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Line One")
+ .as("Item 1 shows Line One");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Line Two")
+ .as("Item 2 shows Line Two");
+ assertThat(editorPage.getMessageSourceAtRowIndex(2))
+ .isEqualTo("Line Three")
+ .as("Item 3 shows Line Three");
+
+ editorPage = editorPage.translateTargetAtRowIndex(0, "Une Ligne")
+ .approveTranslationAtRow(0)
+ .translateTargetAtRowIndex(1, "Deux Ligne")
+ .approveTranslationAtRow(1)
+ .translateTargetAtRowIndex(2, "Ligne Trois")
+ .approveTranslationAtRow(2);
+
+ assertTranslations(editorPage);
+
+ // Close and reopen the editor to test save
editorPage.reload();
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ assertTranslations(editorPage);
+ }
+
+ private void assertTranslations(EditorPage editorPage) {
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("Une Ligne")
+ .as("Item 1 shows a translation of Line One");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(1))
+ .isEqualTo("Deux Ligne")
+ .as("Item 2 shows a translation of Line Two");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(2))
+ .isEqualTo("Ligne Trois")
+ .as("Item 3 shows a translation of Line Three");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOdsTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOdsTest.java
index fb59555c88..b66a89277b 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOdsTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOdsTest.java
@@ -23,11 +23,11 @@
import java.io.File;
import java.util.HashMap;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projectversion.VersionLanguagesPage;
@@ -39,7 +39,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeFalse;
/**
@@ -69,94 +69,75 @@ public void before() {
new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Feature(summary = "The user can translate an OpenOffice spreadsheet file",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void translateBasicOdsFile() {
File testfile = testFileGenerator.openTestFile("test-ods.ods");
- HashMap projectSettings =
- ProjectWorkFlow.projectDefaults();
- projectSettings.put("Project ID", "ods-project");
- projectSettings.put("Name", "ods-project");
- projectSettings.put("Project Type", "File");
-
- VersionLanguagesPage projectVersionPage =
- new ProjectWorkFlow().createNewProject(projectSettings)
- .clickCreateVersionLink().inputVersionId("ods")
- .saveVersion()
- .gotoSettingsTab()
- .gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(testfile.getAbsolutePath())
- .submitUpload();
-
- EditorPage editorPage =
- projectVersionPage.translate("fr", testfile.getName());
-
- assertThat("Item 1 shows TestODS (the sheet name)",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("TestODS"));
- assertThat("Item 2 shows First (the page name)",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("First"));
- assertThat("Item 3 shows Line One",
- editorPage.getMessageSourceAtRowIndex(2),
- Matchers.equalTo("Line One"));
- assertThat("Item 4 shows Line Two",
- editorPage.getMessageSourceAtRowIndex(3),
- Matchers.equalTo("Line Two"));
- assertThat("Item 5 shows Line Three",
- editorPage.getMessageSourceAtRowIndex(4),
- Matchers.equalTo("Line Three"));
-
- editorPage =
- editorPage.translateTargetAtRowIndex(0, "TestODS")
- .approveTranslationAtRow(0);
- editorPage =
- editorPage.translateTargetAtRowIndex(1, "Début")
- .approveTranslationAtRow(1);
- editorPage =
- editorPage.translateTargetAtRowIndex(2, "Une Ligne")
- .approveTranslationAtRow(2);
- editorPage =
- editorPage.translateTargetAtRowIndex(3, "Deux Ligne")
- .approveTranslationAtRow(3);
- editorPage =
- editorPage.translateTargetAtRowIndex(4, "Ligne Trois")
- .approveTranslationAtRow(4);
-
- assertThat("Item 1 shows a translation of the sheet name",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("TestODS"));
- assertThat("Item 2 shows a translation of page name",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Début"));
- assertThat("Item 3 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 4 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(3),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 5 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(4),
- Matchers.equalTo("Ligne Trois"));
+ EditorPage editorPage = new ProjectWorkFlow()
+ .goToProjectByName("about fedora")
+ .gotoVersion("master")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoLanguageTab()
+ .translate("fr", testfile.getName());
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("TestODS")
+ .as("Item 1 shows TestODS (the sheet name)");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("First")
+ .as("Item 2 shows First (the page name)");
+ assertThat(editorPage.getMessageSourceAtRowIndex(2))
+ .isEqualTo("Line One")
+ .as("Item 3 shows Line One");
+ assertThat(editorPage.getMessageSourceAtRowIndex(3))
+ .isEqualTo("Line Two")
+ .as("Item 4 shows Line Two");
+ assertThat(editorPage.getMessageSourceAtRowIndex(4))
+ .isEqualTo("Line Three")
+ .as("Item 5 shows Line Three");
+
+ editorPage = editorPage
+ .translateTargetAtRowIndex(0, "TestODS")
+ .approveTranslationAtRow(0)
+ .translateTargetAtRowIndex(1, "Début")
+ .approveTranslationAtRow(1)
+ .translateTargetAtRowIndex(2, "Une Ligne")
+ .approveTranslationAtRow(2)
+ .translateTargetAtRowIndex(3, "Deux Ligne")
+ .approveTranslationAtRow(3)
+ .translateTargetAtRowIndex(4, "Ligne Trois")
+ .approveTranslationAtRow(4);
+
+ assertTranslations(editorPage);
// Close and reopen the editor to test save, switches to CodeMirror
editorPage.reload();
- assertThat("Item 1 shows a translation of the sheet name",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("TestODS"));
- assertThat("Item 2 shows a translation of page name",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Début"));
- assertThat("Item 3 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 4 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(3),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 5 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(4),
- Matchers.equalTo("Ligne Trois"));
+ assertTranslations(editorPage);
+ }
+
+ private void assertTranslations(EditorPage editorPage) {
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("TestODS")
+ .as("Item 1 shows a translation of the sheet name");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(1))
+ .isEqualTo("Début")
+ .as("Item 2 shows a translation of page name");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(2))
+ .isEqualTo("Une Ligne")
+ .as("Item 3 shows a translation of Line One");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(3))
+ .isEqualTo("Deux Ligne")
+ .as("Item 4 shows a translation of Line Two");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(4))
+ .isEqualTo("Ligne Trois")
+ .as("Item 5 shows a translation of Line Three");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java
index a20062053b..e9f2b64a96 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java
@@ -23,14 +23,15 @@
import java.io.File;
import java.util.HashMap;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.experimental.categories.Category;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
+import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.webtrans.EditorPage;
@@ -41,7 +42,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeFalse;
/**
@@ -52,6 +53,9 @@
@Category(DetailedTest.class)
public class TranslateOpenOfficeTest extends ZanataTestCase {
+ @Rule
+ public Timeout timeout = new Timeout(ZanataTestCase.MAX_LONG_TEST_DURATION);
+
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
@@ -79,68 +83,60 @@ public void before() {
new LoginWorkFlow().signIn("admin", "admin");
}
+ @Feature(summary = "The user can translate OpenOffice files",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
@Theory
public void translateBasicOpenOfficeFile(String extension) {
- File testfile =
- testFileGenerator.openTestFile("test-" + extension + "."
- + extension);
-
- HashMap projectSettings =
- ProjectWorkFlow.projectDefaults();
- projectSettings.put("Project ID", extension + "-project");
- projectSettings.put("Name", extension + "-project");
- projectSettings.put("Project Type", "File");
-
- EditorPage editorPage =
- new ProjectWorkFlow().createNewProject(projectSettings)
- .clickCreateVersionLink().inputVersionId(extension)
- .saveVersion().gotoSettingsTab()
- .gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(testfile.getAbsolutePath())
- .submitUpload().translate("fr", testfile.getName());
-
- assertThat("Item 1 shows Line One",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("Line One"));
- assertThat("Item 2 shows Line Two",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("Line Two"));
- assertThat("Item 3 shows Line Three",
- editorPage.getMessageSourceAtRowIndex(2),
- Matchers.equalTo("Line Three"));
-
- editorPage =
- editorPage.translateTargetAtRowIndex(0, "Une Ligne")
- .approveTranslationAtRow(0);
- editorPage =
- editorPage.translateTargetAtRowIndex(1, "Deux Ligne")
- .approveTranslationAtRow(1);
- editorPage =
- editorPage.translateTargetAtRowIndex(2, "Ligne Trois")
- .approveTranslationAtRow(2);
-
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ File testfile = testFileGenerator
+ .openTestFile("test-" + extension + "." + extension);
+
+ EditorPage editorPage = new ProjectWorkFlow()
+ .goToProjectByName("about fedora")
+ .gotoVersion("master")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoLanguageTab()
+ .translate("fr", testfile.getName());
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Line One")
+ .as("Item 1 shows Line One");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Line Two")
+ .as("Item 2 shows Line Two");
+ assertThat(editorPage.getMessageSourceAtRowIndex(2))
+ .isEqualTo("Line Three")
+ .as("Item 3 shows Line Three");
+
+ editorPage = editorPage
+ .translateTargetAtRowIndex(0, "Une Ligne")
+ .approveTranslationAtRow(0)
+ .translateTargetAtRowIndex(1, "Deux Ligne")
+ .approveTranslationAtRow(1)
+ .translateTargetAtRowIndex(2, "Ligne Trois")
+ .approveTranslationAtRow(2);
+
+ assertTranslations(editorPage);
// Close and reopen the editor to test save, switches to CodeMirror
editorPage.reload();
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ assertTranslations(editorPage);
+ }
+
+ private void assertTranslations(EditorPage editorPage) {
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("Une Ligne")
+ .as("Item 1 shows a translation of Line One");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(1))
+ .isEqualTo("Deux Ligne")
+ .as("Item 2 shows a translation of Line Two");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(2))
+ .isEqualTo("Ligne Trois")
+ .as("Item 3 shows a translation of Line Three");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java b/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java
index 8390fd225e..b1a9fbb16b 100644
--- a/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java
@@ -23,11 +23,11 @@
import java.io.File;
import java.util.HashMap;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.webtrans.EditorPage;
@@ -38,7 +38,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.util.FunctionalTestHelper.assumeFalse;
/**
@@ -68,69 +68,60 @@ public void before() {
new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Feature(summary = "The user can translate a plain text file",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void translateBasicTextFile() {
- File testfile =
- testFileGenerator.generateTestFileWithContent("basictext",
- ".txt", "Line One\nLine Two\nLine Three");
-
- HashMap projectSettings =
- ProjectWorkFlow.projectDefaults();
- projectSettings.put("Project ID", "text-project");
- projectSettings.put("Name", "text-project");
- projectSettings.put("Project Type", "File");
-
- EditorPage editorPage =
- new ProjectWorkFlow().createNewProject(projectSettings)
- .clickCreateVersionLink().inputVersionId("text")
- .saveVersion()
- .gotoSettingsTab()
- .gotoSettingsDocumentsTab()
- .pressUploadFileButton()
- .enterFilePath(testfile.getAbsolutePath())
- .submitUpload().translate("fr", testfile.getName());
-
- assertThat("Item 1 shows Line One",
- editorPage.getMessageSourceAtRowIndex(0),
- Matchers.equalTo("Line One"));
- assertThat("Item 2 shows Line Two",
- editorPage.getMessageSourceAtRowIndex(1),
- Matchers.equalTo("Line Two"));
- assertThat("Item 3 shows Line Three",
- editorPage.getMessageSourceAtRowIndex(2),
- Matchers.equalTo("Line Three"));
-
- editorPage =
- editorPage.translateTargetAtRowIndex(0, "Une Ligne")
- .approveTranslationAtRow(0);
- editorPage =
- editorPage.translateTargetAtRowIndex(1, "Deux Ligne")
- .approveTranslationAtRow(1);
- editorPage =
- editorPage.translateTargetAtRowIndex(2, "Ligne Trois")
- .approveTranslationAtRow(2);
-
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ File testfile = testFileGenerator.generateTestFileWithContent(
+ "basictext",".txt",
+ "Line One\nLine Two\nLine Three");
+
+ EditorPage editorPage = new ProjectWorkFlow()
+ .goToProjectByName("about fedora")
+ .gotoVersion("master")
+ .gotoSettingsTab()
+ .gotoSettingsDocumentsTab()
+ .pressUploadFileButton()
+ .enterFilePath(testfile.getAbsolutePath())
+ .submitUpload()
+ .clickUploadDone()
+ .gotoLanguageTab()
+ .translate("fr", testfile.getName());
+
+ assertThat(editorPage.getMessageSourceAtRowIndex(0))
+ .isEqualTo("Line One")
+ .as("Item 1 shows Line One");
+ assertThat(editorPage.getMessageSourceAtRowIndex(1))
+ .isEqualTo("Line Two")
+ .as("Item 2 shows Line Two");
+ assertThat(editorPage.getMessageSourceAtRowIndex(2))
+ .isEqualTo("Line Three")
+ .as("Item 3 shows Line Three");
+
+ editorPage = editorPage.translateTargetAtRowIndex(0, "Une Ligne")
+ .approveTranslationAtRow(0)
+ .translateTargetAtRowIndex(1, "Deux Ligne")
+ .approveTranslationAtRow(1)
+ .translateTargetAtRowIndex(2, "Ligne Trois")
+ .approveTranslationAtRow(2);
+
+ assertTranslations(editorPage);
// Close and reopen the editor to test save, switches to CodeMirror
editorPage.reload();
- assertThat("Item 1 shows a translation of Line One",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- Matchers.equalTo("Une Ligne"));
- assertThat("Item 2 shows a translation of Line Two",
- editorPage.getBasicTranslationTargetAtRowIndex(1),
- Matchers.equalTo("Deux Ligne"));
- assertThat("Item 3 shows a translation of Line Three",
- editorPage.getBasicTranslationTargetAtRowIndex(2),
- Matchers.equalTo("Ligne Trois"));
+ assertTranslations(editorPage);
+ }
+
+ private void assertTranslations(EditorPage editorPage) {
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("Une Ligne")
+ .as("Item 1 shows a translation of Line One");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(1))
+ .isEqualTo("Deux Ligne")
+ .as("Item 2 shows a translation of Line Two");
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(2))
+ .isEqualTo("Ligne Trois")
+ .as("Item 3 shows a translation of Line Three");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java
index c992e4b17d..3139217c90 100644
--- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryAdminTest.java
@@ -63,7 +63,7 @@ public class GlossaryAdminTest extends ZanataTestCase {
* Setup.
* @see TCMS Test Case 181711
*/
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void testGlossaryView() {
// Push a glossary
File projectRootPath =
diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java
index 08b6bda96b..9cad9f3288 100644
--- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryDeleteTest.java
@@ -30,6 +30,7 @@
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.webtrans.EditorPage;
import org.zanata.util.SampleProjectRule;
+import org.zanata.workflow.BasicWorkFlow;
import org.zanata.workflow.ClientWorkFlow;
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
@@ -72,7 +73,7 @@ public void before() {
basicUserConfigPath = ClientWorkFlow.getUserConfigPath("translator");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void testGlossaryDelete() throws Exception {
List result = clientWorkFlow .callWithTimeout(
projectRootPath, pushCommand + userConfigPath);
@@ -87,21 +88,17 @@ public void testGlossaryDelete() throws Exception {
.as("Glossary delete was successful");
- EditorPage editorPage = new LoginWorkFlow()
- .signIn("admin", "admin")
- .goToProjects()
- .goToProject("about fedora")
- .gotoVersion("master")
- .translate("hi", "About_Fedora")
- .searchGlossary("hello");
+ new LoginWorkFlow().signIn("admin", "admin");
+ EditorPage editorPage =
+ new BasicWorkFlow().goToEditor("about-fedora", "master", "hi",
+ "About_Fedora")
+ .searchGlossary("hello");
assertThat(editorPage.getGlossaryResultTable())
.as("Glossary table is empty").isEmpty();
- editorPage = new ProjectWorkFlow()
- .goToProjectByName("about fedora")
- .gotoVersion("master")
- .translate("pl", "About_Fedora")
+ editorPage = new BasicWorkFlow().goToEditor("about-fedora", "master",
+ "pl", "About_Fedora")
.searchGlossary("hello");
assertThat(editorPage.getGlossaryResultTable()
@@ -109,7 +106,7 @@ public void testGlossaryDelete() throws Exception {
.as("The glossary result in row 2, column 2 is correct");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void unauthorizedGlossaryDeleteRejected() throws Exception {
List result = clientWorkFlow .callWithTimeout(
projectRootPath, pushCommand + userConfigPath);
diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java
index a339d8bd6f..41e90f2fdb 100644
--- a/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/glossary/GlossaryPushTest.java
@@ -74,7 +74,7 @@ public void before() {
basicUserConfigPath = ClientWorkFlow.getUserConfigPath("translator");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void successfulGlossaryPush() throws Exception {
List result = push(pushCommand, userConfigPath);
log.info(resultByLines(result));
@@ -83,14 +83,8 @@ public void successfulGlossaryPush() throws Exception {
.isTrue()
.as("The glossary push was successful");
- assertThat(new LoginWorkFlow()
- .signIn("translator", "translator")
- .loggedInAs())
- .isEqualTo("translator")
- .as("Admin has logged in");
-
- EditorPage editorPage = new BasicWorkFlow()
- .goToHome()
+ EditorPage editorPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
.goToProjects()
.goToProject("about fedora")
.gotoVersion("master")
@@ -103,7 +97,7 @@ public void successfulGlossaryPush() throws Exception {
.as("The first glossary result is correct");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void failedCSVGlossaryPush() throws Exception {
List result = push(pushCSVCommand, userConfigPath);
log.info(resultByLines(result));
@@ -123,7 +117,7 @@ private String resultByLines(List output) {
return Joiner.on("\n").join(output);
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void unauthorizedGlossaryPushRejected() throws Exception {
List result = clientWorkFlow .callWithTimeout(
projectRootPath, pushCommand + userConfigPath);
diff --git a/functional-test/src/test/java/org/zanata/feature/glossary/InvalidGlossaryPushTest.java b/functional-test/src/test/java/org/zanata/feature/glossary/InvalidGlossaryPushTest.java
index 0845dedd7e..69cd2354f9 100644
--- a/functional-test/src/test/java/org/zanata/feature/glossary/InvalidGlossaryPushTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/glossary/InvalidGlossaryPushTest.java
@@ -27,6 +27,7 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestRule;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.util.SampleProjectRule;
@@ -62,7 +63,8 @@ public void before() {
userConfigPath = ClientWorkFlow.getUserConfigPath("glossarist");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ @Feature(summary = "Invalid glossary file will be rejected by the server")
public void successfulGlossaryPush() throws Exception {
List result = push(pushCommand, userConfigPath);
log.info(resultByLines(result));
diff --git a/functional-test/src/test/java/org/zanata/feature/googleopenid/GoogleOpenIDTest.java b/functional-test/src/test/java/org/zanata/feature/googleopenid/GoogleOpenIDTest.java
index 4628b60a6d..8a48d3c438 100644
--- a/functional-test/src/test/java/org/zanata/feature/googleopenid/GoogleOpenIDTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/googleopenid/GoogleOpenIDTest.java
@@ -81,7 +81,7 @@ public void before() {
assumeTrue(googleAccountPage.getUrl().contains("/ServiceLogin"));
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void signInWithGoogleOpenID() {
String googleUsername = googleUsername1;
String googlePassword = googlePassword1;
diff --git a/functional-test/src/test/java/org/zanata/feature/infrastructure/RetryRuleTest.java b/functional-test/src/test/java/org/zanata/feature/infrastructure/RetryRuleTest.java
index 84ad277820..294a982364 100644
--- a/functional-test/src/test/java/org/zanata/feature/infrastructure/RetryRuleTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/infrastructure/RetryRuleTest.java
@@ -41,7 +41,7 @@ public class RetryRuleTest extends ZanataTestCase {
@Rule
public RetryRule retryRule = new RetryRule(2);
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void retryPassAfterFail() {
// Fail on the first execution, but pass on the second
assertThat("Current try is greater than 1", retryRule.currentTry(),
@@ -51,7 +51,7 @@ public void retryPassAfterFail() {
Matchers.equalTo(2));
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void passWillPass() {
assertThat("A normal passing test will pass", true);
assertThat("And pass on the first try", retryRule.currentTry(),
diff --git a/functional-test/src/test/java/org/zanata/feature/language/AddLanguageTest.java b/functional-test/src/test/java/org/zanata/feature/language/AddLanguageTest.java
index 958ba8259f..bf56632a83 100644
--- a/functional-test/src/test/java/org/zanata/feature/language/AddLanguageTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/language/AddLanguageTest.java
@@ -24,11 +24,10 @@
import java.util.List;
import java.util.Map;
-import org.hamcrest.Matchers;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.administration.AddLanguagePage;
@@ -36,7 +35,7 @@
import org.zanata.util.SampleProjectRule;
import org.zanata.workflow.LoginWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Damian Jansen enabledLocaleList = manageLanguagePage.goToHomePage()
- .goToProjects()
- .goToProject("about fedora")
- .gotoVersion("master")
- .gotoSettingsTab()
- .gotoSettingsLanguagesTab()
- .clickInheritCheckbox()
- .waitForLocaleListVisible()
- .getEnabledLocaleList();
-
- assertThat("The language is enabled by default", enabledLocaleList,
- Matchers.hasItem(languageDisplayName));
+ List enabledLocaleList = manageLanguagePage
+ .goToHomePage()
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsLanguagesTab()
+ .waitForLocaleListVisible()
+ .getEnabledLocaleList();
+
+ assertThat(enabledLocaleList)
+ .contains(languageDisplayName)
+ .as("The language is enabled by default");
}
- @Test
- public void addLanguageAsDisabled() {
+ @Feature(summary = "The administrator can add a disabled language to Zanata",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 181709)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addLanguageAsDisabled() throws Exception {
String language = "Klingon";
String languageDisplayName = "klingon[Klingon]";
- ManageLanguagePage manageLanguagePage =
- new LoginWorkFlow().signIn("admin", "admin").goToHomePage()
- .goToAdministration().goToManageLanguagePage();
+ ManageLanguagePage manageLanguagePage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToHomePage()
+ .goToAdministration()
+ .goToManageLanguagePage();
- assertThat("The language is not listed",
- manageLanguagePage.getLanguageLocales(),
- Matchers.not(Matchers.hasItem(language)));
+ assertThat(manageLanguagePage.getLanguageLocales())
+ .doesNotContain(language)
+ .as("The language is not listed");
- manageLanguagePage =
- manageLanguagePage.addNewLanguage().inputLanguage(language)
- .disableLanguageByDefault().saveLanguage();
+ manageLanguagePage = manageLanguagePage
+ .addNewLanguage()
+ .inputLanguage(language)
+ .disableLanguageByDefault()
+ .saveLanguage();
- assertThat("The language is listed",
- manageLanguagePage.getLanguageLocales(),
- Matchers.hasItem(language));
- assertThat("The language is disabled by default",
- !manageLanguagePage.languageIsEnabled(language));
+ assertThat(manageLanguagePage.getLanguageLocales())
+ .contains(language)
+ .as("The language is listed");
+ assertThat(manageLanguagePage.languageIsEnabled(language))
+ .isFalse()
+ .as("The language is disabled by default");
List enabledLocaleList = manageLanguagePage.goToHomePage()
.goToProjects()
- .goToProject("about fedora").gotoVersion("master")
- .gotoSettingsTab().gotoSettingsLanguagesTab()
- .clickInheritCheckbox()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsLanguagesTab()
.waitForLocaleListVisible()
.getEnabledLocaleList();
- assertThat("The language is disabled by default", enabledLocaleList,
- Matchers.not(Matchers.hasItem(languageDisplayName)));
+ assertThat(enabledLocaleList)
+ .doesNotContain(languageDisplayName)
+ .as("The language is disabled by default");
}
- @Test
- public void addKnownLanguage() {
+ @Feature(summary = "The administrator can add a known language to Zanata",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 181709)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addKnownLanguage() throws Exception {
String language = "ru-RU";
- ManageLanguagePage manageLanguagePage =
- new LoginWorkFlow().signIn("admin", "admin").goToHomePage()
- .goToAdministration().goToManageLanguagePage();
+ ManageLanguagePage manageLanguagePage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToHomePage()
+ .goToAdministration()
+ .goToManageLanguagePage();
- assertThat("The language is not listed",
- manageLanguagePage.getLanguageLocales(),
- Matchers.not(Matchers.hasItem(language)));
+ assertThat(manageLanguagePage.getLanguageLocales())
+ .doesNotContain(language)
+ .as("The language is not listed");
- AddLanguagePage addLanguagePage =
- manageLanguagePage.addNewLanguage().inputLanguage("ru-RU");
+ AddLanguagePage addLanguagePage = manageLanguagePage
+ .addNewLanguage()
+ .inputLanguage("ru-RU");
Map languageInfo = addLanguagePage.getLanguageDetails();
- assertThat("The name is correct", languageInfo.get("Name"),
- Matchers.equalTo("Russian (Russia)"));
- assertThat("The native name is correct",
- languageInfo.get("Native Name"),
- Matchers.equalTo("русский (Россия)"));
- assertThat("The language is correct",
- languageInfo.get("Language Code"), Matchers.equalTo("ru"));
- assertThat("The country code is correct",
- languageInfo.get("Country Code"), Matchers.equalTo("RU"));
+ assertThat(languageInfo.get("Name"))
+ .isEqualTo("Russian (Russia)")
+ .as("The name is correct");
+ assertThat(languageInfo.get("Native Name"))
+ .isEqualTo("русский (Россия)")
+ .as("The native name is correct");
+ assertThat(languageInfo.get("Language Code"))
+ .isEqualTo("ru")
+ .as("The language is correct");
+ assertThat(languageInfo.get("Country Code"))
+ .isEqualTo("RU")
+ .as("The country code is correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/language/JoinLanguageTeamTest.java b/functional-test/src/test/java/org/zanata/feature/language/JoinLanguageTeamTest.java
index bd7602b3af..8631a5e823 100644
--- a/functional-test/src/test/java/org/zanata/feature/language/JoinLanguageTeamTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/language/JoinLanguageTeamTest.java
@@ -22,6 +22,7 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.administration.ManageLanguageTeamMemberPage;
@@ -36,8 +37,10 @@
@Category(DetailedTest.class)
public class JoinLanguageTeamTest extends ZanataTestCase {
- @Test
- public void translatorJoinsLanguageTeam() {
+ @Feature(summary = "The administrator can add a member to a language team",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 181703)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void translatorJoinsLanguageTeam() throws Exception {
ManageLanguageTeamMemberPage manageTeamMemberPage = new LoginWorkFlow()
.signIn("admin", "admin")
.goToAdministration()
diff --git a/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java b/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java
index c61bdb06e1..2fa9e0dd69 100644
--- a/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/misc/ContactAdminTest.java
@@ -2,12 +2,12 @@
import java.util.List;
-import org.hamcrest.Matchers;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.subethamail.wiser.WiserMessage;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.dashboard.DashboardBasePage;
@@ -19,12 +19,9 @@
import org.zanata.util.PropertiesHolder;
import org.zanata.workflow.LoginWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
/**
- * TCMS test case 181717
- *
* @author Patrick Huang pahuang@redhat.com
*/
@@ -33,41 +30,63 @@ public class ContactAdminTest extends ZanataTestCase {
@Rule
public AddUsersRule addUsersRule = new AddUsersRule();
- @ClassRule
- public static HasEmailRule emailRule = new HasEmailRule();
+ @Rule
+ public HasEmailRule emailRule = new HasEmailRule();
- @Test
+ @Feature(summary = "The user can contact the site administrator",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 181717)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void testContactAdmin() {
DashboardBasePage dashboard =
new LoginWorkFlow().signIn("translator", "translator");
ContactAdminFormPage contactAdminFormPage =
dashboard.goToHelp().clickContactAdmin();
- HelpPage helpPage =
- contactAdminFormPage.inputSubject("hello admin")
- .inputMessage("I love Zanata").send();
+ HelpPage helpPage = contactAdminFormPage
+ .inputSubject("hello admin")
+ .inputMessage("I love Zanata")
+ .send();
+
+ assertThat(helpPage.expectNotification("Your message has been sent " +
+ "to the administrator"))
+ .isTrue()
+ .as("An email sent notification shows");
- assertThat(
- helpPage.getNotificationMessage(),
- Matchers.equalTo("Your message has been sent to the administrator"));
List messages = emailRule.getMessages();
- assertThat(messages, Matchers.hasSize(1));
+
+ assertThat(messages.size())
+ .isEqualTo(1)
+ .as("One email was sent");
+
WiserMessage wiserMessage = messages.get(0);
- assertThat(wiserMessage.getEnvelopeReceiver(),
- Matchers.equalTo("admin@example.com"));
+
+ assertThat(wiserMessage.getEnvelopeReceiver())
+ .isEqualTo("admin@example.com")
+ .as("The email recipient is the administrator");
String content = HasEmailRule.getEmailContent(wiserMessage);
- assertThat(
- content,
- Matchers.containsString("Zanata user 'translator' with id 'translator' has sent the following message:"));
- assertThat(content, Matchers.containsString("I love Zanata"));
- assertThat(
- content,
- Matchers.containsString("You can reply to translator at translator@example.com"));
+
+ assertThat(content)
+ .contains("Zanata user ")
+ .contains("translator")
+ .contains(" with id ")
+ .contains(" has sent the following message:")
+ .as("The email header is correct");
+ assertThat(content)
+ .contains("I love Zanata")
+ .as("The message content is correct");
+ assertThat(content)
+ .contains("You can reply to translator at " +
+ "translator@example.com")
+ .as("The email instructions are correct");
+
// contains instance url (without last slash)
- String instanceUrl = PropertiesHolder
- .getProperty(Constants.zanataInstance.value()).replaceAll("/$", "");
- assertThat(content, Matchers.containsString(instanceUrl));
+ String instanceUrl = PropertiesHolder.getProperty(
+ Constants.zanataInstance.value()).replaceAll("/$", "");
+
+ assertThat(content)
+ .contains(instanceUrl)
+ .as("The email origin (server) is correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/misc/ObsoleteTextTest.java b/functional-test/src/test/java/org/zanata/feature/misc/ObsoleteTextTest.java
index 1d701f8aa6..0ede5f3d39 100644
--- a/functional-test/src/test/java/org/zanata/feature/misc/ObsoleteTextTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/misc/ObsoleteTextTest.java
@@ -61,7 +61,7 @@ public void setUp() throws Exception {
* 10. Enter translation editor for bem and see whether the project and document are 100%translated.
*
*/
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void obsoleteTextTest() {
restCaller
.createProjectAndVersion("obsolete-test", "master", "gettext");
diff --git a/functional-test/src/test/java/org/zanata/feature/misc/RateLimitRestAndUITest.java b/functional-test/src/test/java/org/zanata/feature/misc/RateLimitRestAndUITest.java
index 8f2d28c015..eae4a4230d 100644
--- a/functional-test/src/test/java/org/zanata/feature/misc/RateLimitRestAndUITest.java
+++ b/functional-test/src/test/java/org/zanata/feature/misc/RateLimitRestAndUITest.java
@@ -10,12 +10,12 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.hamcrest.Matchers;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.core.BaseClientResponse;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.administration.AdministrationPage;
@@ -32,7 +32,7 @@
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.model.HApplicationConfiguration.KEY_ADMIN_EMAIL;
import static org.zanata.model.HApplicationConfiguration.KEY_MAX_ACTIVE_REQ_PER_API_KEY;
import static org.zanata.model.HApplicationConfiguration.KEY_MAX_CONCURRENT_REQ_PER_API_KEY;
@@ -43,6 +43,8 @@
* @author Patrick Huang pahuang@redhat.com
*/
+@Feature(summary = "The system can be set to rate consecutive REST access calls",
+ tcmsTestPlanIds = 5315, tcmsTestCaseIds = 0)
@Category(DetailedTest.class)
@Slf4j
public class RateLimitRestAndUITest extends ZanataTestCase {
@@ -57,7 +59,7 @@ public class RateLimitRestAndUITest extends ZanataTestCase {
+ KEY_MAX_CONCURRENT_REQ_PER_API_KEY;
private String maxActivePathParam = "c/" + KEY_MAX_ACTIVE_REQ_PER_API_KEY;
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void canConfigureRateLimitByWebUI() {
new LoginWorkFlow().signIn("admin", "admin");
BasicWorkFlow basicWorkFlow = new BasicWorkFlow();
@@ -65,27 +67,27 @@ public void canConfigureRateLimitByWebUI() {
basicWorkFlow.goToPage("admin/server_configuration",
ServerConfigurationPage.class);
- assertThat(serverConfigPage.getMaxConcurrentRequestsPerApiKey(),
- Matchers.isEmptyString());
- assertThat(serverConfigPage.getMaxActiveRequestsPerApiKey(),
- Matchers.isEmptyString());
+ assertThat(serverConfigPage.getMaxConcurrentRequestsPerApiKey())
+ .isEqualTo("default is 6");
+ assertThat(serverConfigPage.getMaxActiveRequestsPerApiKey())
+ .isEqualTo("default is 2");
AdministrationPage administrationPage =
serverConfigPage.inputMaxConcurrent(5).inputMaxActive(3).save();
- assertThat(administrationPage.getNotificationMessage(),
- Matchers.equalTo("Configuration was successfully updated."));
+ assertThat(administrationPage.getNotificationMessage())
+ .isEqualTo("Configuration was successfully updated.");
serverConfigPage =
basicWorkFlow.goToPage("admin/server_configuration",
ServerConfigurationPage.class);
- assertThat(serverConfigPage.getMaxActiveRequestsPerApiKey(),
- Matchers.equalTo("3"));
- assertThat(serverConfigPage.getMaxConcurrentRequestsPerApiKey(),
- Matchers.equalTo("5"));
+ assertThat(serverConfigPage.getMaxActiveRequestsPerApiKey())
+ .isEqualTo("3");
+ assertThat(serverConfigPage.getMaxConcurrentRequestsPerApiKey())
+ .isEqualTo("5");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void canCallServerConfigurationRestService() throws Exception {
ClientRequest clientRequest =
clientRequestAsAdmin("rest/configurations/"
@@ -94,20 +96,20 @@ public void canCallServerConfigurationRestService() throws Exception {
// can put
Response putResponse = clientRequest.put();
- assertThat(getStatusAndReleaseConnection(putResponse), Matchers.is(201));
+ assertThat(getStatusAndReleaseConnection(putResponse)).isEqualTo(201);
// can get single configuration
Response getResponse =
clientRequestAsAdmin(
"rest/configurations/" + maxConcurrentPathParam).get();
- assertThat(getResponse.getStatus(), Matchers.is(200));
+ assertThat(getResponse.getStatus()).isEqualTo(200);
String rateLimitConfig =
((BaseClientResponse) getResponse)
.getEntity(String.class);
- assertThat(rateLimitConfig,
- Matchers.containsString(KEY_MAX_CONCURRENT_REQ_PER_API_KEY));
- assertThat(rateLimitConfig, Matchers.containsString("1"));
+ assertThat(rateLimitConfig)
+ .contains(KEY_MAX_CONCURRENT_REQ_PER_API_KEY);
+ assertThat(rateLimitConfig).contains("1");
// can get all configurations
Response getAllResponse =
@@ -118,9 +120,9 @@ public void canCallServerConfigurationRestService() throws Exception {
String configurations = baseClientResponse.getEntity(String.class);
log.info("result {}", configurations);
- assertThat(getStatusAndReleaseConnection(getAllResponse),
- Matchers.is(200));
- assertThat(configurations, Matchers.notNullValue());
+ assertThat(getStatusAndReleaseConnection(getAllResponse))
+ .isEqualTo(200);
+ assertThat(configurations).isNotNull();
}
private static ClientRequest clientRequestAsAdmin(String path) {
@@ -135,25 +137,25 @@ private static ClientRequest clientRequestAsAdmin(String path) {
return clientRequest;
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void serverConfigurationRestServiceOnlyAvailableToAdmin()
throws Exception {
// all request should be rejected
Response response =
clientRequestAsTranslator("rest/configurations/").get();
- assertThat(getStatusAndReleaseConnection(response), Matchers.is(401));
+ assertThat(getStatusAndReleaseConnection(response)).isEqualTo(401);
Response response1 =
clientRequestAsTranslator(
"rest/configurations/c/" + KEY_ADMIN_EMAIL).get();
- assertThat(getStatusAndReleaseConnection(response1), Matchers.is(401));
+ assertThat(getStatusAndReleaseConnection(response1)).isEqualTo(401);
ClientRequest request =
clientRequestAsTranslator("rest/configurations/c/"
+ KEY_ADMIN_EMAIL);
request.body("text/plain", "admin@email.com");
Response response2 = request.put();
- assertThat(getStatusAndReleaseConnection(response2), Matchers.is(401));
+ assertThat(getStatusAndReleaseConnection(response2)).isEqualTo(401);
}
private static ClientRequest clientRequestAsTranslator(String path) {
@@ -167,20 +169,20 @@ private static ClientRequest clientRequestAsTranslator(String path) {
return clientRequest;
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void canOnlyDealWithKnownConfiguration() throws Exception {
ClientRequest clientRequest =
clientRequestAsAdmin("rest/configurations/c/abc");
Response putResponse = clientRequest.put();
- assertThat(getStatusAndReleaseConnection(putResponse), Matchers.is(400));
+ assertThat(getStatusAndReleaseConnection(putResponse)).isEqualTo(400);
Response getResponse =
clientRequestAsAdmin("rest/configurations/c/abc").get();
- assertThat(getStatusAndReleaseConnection(getResponse), Matchers.is(404));
+ assertThat(getStatusAndReleaseConnection(getResponse)).isEqualTo(404);
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void canLimitConcurrentRestRequestsPerAPIKey() throws Exception {
// translator creates the project/version
final String projectSlug = "project";
@@ -238,7 +240,7 @@ ImmutableList.> builder()
// 1 request from translator should get 403 and fail
log.info("result: {}", result);
- assertThat(result, Matchers.containsInAnyOrder(201, 201, 201, 201, 429));
+ assertThat(result).contains(201, 201, 201, 201, 429);
}
@Test(timeout = 5000)
@@ -260,7 +262,7 @@ public void exceptionWillReleaseSemaphore() throws Exception {
// Then: request that result in exception should still release
// semaphore. i.e. no permit leak
- assertThat(1, Matchers.is(1));
+ assertThat(1).isEqualTo(1);
}
@Test(timeout = 5000)
@@ -282,7 +284,7 @@ public void unmappedExceptionWillAlsoReleaseSemaphore() throws Exception {
// Then: request that result in exception should still release
// semaphore. i.e. no permit leak
- assertThat(1, Matchers.is(1));
+ assertThat(1).isEqualTo(1);
}
private static Integer invokeRestService(ZanataRestCaller restCaller,
diff --git a/functional-test/src/test/java/org/zanata/feature/project/CreateProjectTest.java b/functional-test/src/test/java/org/zanata/feature/project/CreateProjectTest.java
index 698773a79f..3d6dd88555 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/CreateProjectTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/CreateProjectTest.java
@@ -22,11 +22,11 @@
package org.zanata.feature.project;
import java.util.HashMap;
-import java.util.List;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
@@ -36,9 +36,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.zanata.workflow.ProjectWorkFlow.projectDefaults;
/**
@@ -51,47 +49,46 @@ public class CreateProjectTest extends ZanataTestCase {
@ClassRule
public static AddUsersRule addUsersRule = new AddUsersRule();
- @Test
+ @Feature(summary = "The user can create a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 144262)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
@Category(BasicAcceptanceTest.class)
- public void createABasicProject() {
-
- assertThat("User logs in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- equalTo("admin"));
+ public void createABasicProject() throws Exception {
+ assertThat(new LoginWorkFlow().signIn("admin", "admin").loggedInAs())
+ .isEqualTo("admin")
+ .as("User logs in");
ProjectVersionsPage projectVersionsPage = new ProjectWorkFlow()
.createNewSimpleProject("basicproject", "basicproject");
- assertThat("The project name is correct",
- projectVersionsPage.getProjectName().trim(),
- equalTo("basicproject"));
+ assertThat(projectVersionsPage.getProjectName().trim())
+ .isEqualTo("basicproject")
+ .as("The project name is correct");
}
- @Test
- public void createABasicProjectWithHomepageContent() {
-
+ @Feature(summary = "The user can create a project with description",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 144262)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void createABasicProjectWithDescription() throws Exception {
HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "homepageproject");
- projectSettings.put("Name", "Project With Homepage Test");
+ projectSettings.put("Project ID", "descriptionproject");
+ projectSettings.put("Name", "Project With Description Test");
projectSettings.put("Description", "Project Description!");
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- equalTo("admin"));
+ assertThat(new LoginWorkFlow().signIn("admin", "admin").loggedInAs())
+ .isEqualTo("admin")
+ .as("Admin can log in");
ProjectBasePage projectPage =
new ProjectWorkFlow().createNewProject(projectSettings);
- assertThat("The project name is correct",
- projectPage.getProjectName().trim(),
- equalTo(projectSettings.get("Name")));
-
- List paragraphs = projectPage.getContentAreaParagraphs();
-
- assertThat("The project content area shows the description",
- paragraphs,
- hasItem(projectSettings.get("Description")));
+ assertThat(projectPage.getProjectName().trim())
+ .isEqualTo(projectSettings.get("Name"))
+ .as("The project name is correct");
+ assertThat(projectPage.getContentAreaParagraphs())
+ .contains(projectSettings.get("Description"))
+ .as("The project content area shows the description");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/project/EditPermissionsTest.java b/functional-test/src/test/java/org/zanata/feature/project/EditPermissionsTest.java
index 5161f6d2d6..49a764efb0 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/EditPermissionsTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/EditPermissionsTest.java
@@ -21,17 +21,16 @@
package org.zanata.feature.project;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.not;
+import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.page.projects.ProjectBasePage;
import org.zanata.page.projects.ProjectMaintainersPage;
import org.zanata.page.projects.projectsettings.ProjectPermissionsTab;
import org.zanata.page.projects.ProjectVersionsPage;
@@ -49,73 +48,78 @@ public class EditPermissionsTest extends ZanataTestCase {
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void maintainerDetailsAreDisplayed() {
- ProjectPermissionsTab projectPermissionsTab =
- new LoginWorkFlow()
- .signIn("admin", "admin")
- .goToProjects()
- .goToProject("about fedora")
- .gotoSettingsTab()
- .gotoSettingsPermissionsTab();
+ @Feature(summary = "The user can view maintainers for a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void maintainerDetailsAreDisplayed() throws Exception {
+ ProjectPermissionsTab projectPermissionsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsPermissionsTab();
- assertThat("The admin user is shown in the list",
- projectPermissionsTab.getSettingsMaintainersList(),
- hasItem("admin"));
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .contains("admin")
+ .as("The admin user is shown in the list");
ProjectMaintainersPage projectMaintainersPage = projectPermissionsTab
.gotoMaintainersTab();
- assertThat("The admin user is shown in the list",
- projectMaintainersPage.getMaintainers(),
- hasItem("Administrator @admin"));
+ assertThat(projectMaintainersPage.getMaintainers())
+ .contains("Administrator @admin")
+ .as("The admin user is shown in the list");
}
- @Test
- @Ignore("rhbz1097030")
- public void addMaintainerAsAdmin() {
- ProjectPermissionsTab projectPermissionsTab =
- new LoginWorkFlow()
- .signIn("admin", "admin")
- .goToProjects()
- .goToProject("about fedora")
- .gotoSettingsTab()
- .gotoSettingsPermissionsTab();
-
- assertThat("The translator user is not a maintainer",
- projectPermissionsTab.getSettingsMaintainersList(),
- not(hasItem("translator")));
+ @Feature(summary = "The administrator can add a maintainer to a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addMaintainerAsAdmin() throws Exception {
+ ProjectPermissionsTab projectPermissionsTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsPermissionsTab();
+
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .doesNotContain("translator")
+ .as("The translator user is not a maintainer");
projectPermissionsTab = new ProjectWorkFlow()
.addMaintainer("about fedora", "translator");
- assertThat("The translator user is a maintainer",
- projectPermissionsTab.getSettingsMaintainersList(),
- hasItem("translator"));
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .contains("translator")
+ .as("The translator user is a maintainer");
ProjectMaintainersPage projectMaintainersPage = projectPermissionsTab
.gotoMaintainersTab();
- assertThat("The translator user is shown in the list",
- projectMaintainersPage.getMaintainers(),
- hasItem("translator @translator"));
+ assertThat(projectMaintainersPage.getMaintainers())
+ .contains("translator @translator")
+ .as("The translator user is shown in the list");
projectMaintainersPage.logout();
- assertThat("The settings tab is now available to the user",
- new LoginWorkFlow().signIn("translator", "translator")
- .goToProjects()
- .goToProject("about fedora")
- .settingsTabIsDisplayed());
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .goToProjects()
+ .goToProject("about fedora")
+ .settingsTabIsDisplayed())
+ .isTrue()
+ .as("The settings tab is now available to the user");
}
- @Test
- @Ignore("rhbz1097030")
- public void addMaintainerAsMaintainer() {
-
- assertThat("Translator has signed in",
- new LoginWorkFlow().signIn("translator", "translator").loggedInAs(),
- equalTo("translator"));
+ @Feature(summary = "The maintainer can add a maintainer to a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 199006)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addMaintainerAsMaintainer() throws Exception {
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .loggedInAs())
+ .isEqualTo("translator")
+ .as("Translator has signed in");
ProjectPermissionsTab projectPermissionsTab = new ProjectWorkFlow()
.createNewSimpleProject("addmaintainer", "addmaintainer")
@@ -126,16 +130,16 @@ public void addMaintainerAsMaintainer() {
projectPermissionsTab.waitForMaintainersContains("glossarist");
- assertThat("The glossarist user was added as a maintainer",
- projectPermissionsTab.getSettingsMaintainersList(),
- hasItem("glossarist"));
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .contains("glossarist")
+ .as("The glossarist user was added as a maintainer");
ProjectMaintainersPage projectMaintainersPage = projectPermissionsTab
.gotoMaintainersTab();
- assertThat("The glossarist user is shown in the list",
- projectMaintainersPage.getMaintainers(),
- hasItem("glossarist @glossarist"));
+ assertThat(projectMaintainersPage.getMaintainers())
+ .contains("glossarist @glossarist")
+ .as("The glossarist user is shown in the list");
projectMaintainersPage.logout();
@@ -144,78 +148,85 @@ public void addMaintainerAsMaintainer() {
.goToProjects()
.goToProject("addmaintainer");
- assertThat("The settings tab is now available to the glossarist",
- projectVersionsPage.settingsTabIsDisplayed());
+ assertThat(projectVersionsPage.settingsTabIsDisplayed())
+ .isTrue()
+ .as("The settings tab is now available to the glossarist");
}
- @Test
- @Ignore("rhbz1097030")
- public void removeMaintainer() {
-
- assertThat("Translator has signed in",
- new LoginWorkFlow().signIn("translator", "translator").loggedInAs(),
- equalTo("translator"));
-
- assertThat("The project is created",
- new ProjectWorkFlow()
- .createNewSimpleProject("removemaintainer",
- "removemaintainer")
- .getProjectName(),
- equalTo("removemaintainer"));
-
- assertThat("Glossarist maintainer is added",
- new ProjectWorkFlow()
- .addMaintainer("removemaintainer", "glossarist")
- .getSettingsMaintainersList(),
- hasItem("glossarist"));
-
+ @Feature(summary = "The maintainer can remove a maintainer from a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 321234)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void removeMaintainer() throws Exception {
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .loggedInAs())
+ .isEqualTo("translator")
+ .as("Translator has signed in");
+
+ assertThat(new ProjectWorkFlow()
+ .createNewSimpleProject("removemaintainer", "removemaintainer")
+ .getProjectName())
+ .isEqualTo("removemaintainer")
+ .as("The project is created");
+
+ assertThat(new ProjectWorkFlow()
+ .addMaintainer("removemaintainer", "glossarist")
+ .getSettingsMaintainersList())
+ .contains("glossarist")
+ .as("Glossarist maintainer is added");
ProjectPermissionsTab projectPermissionsTab = new ProjectWorkFlow()
.removeMaintainer("removemaintainer", "glossarist");
- assertThat("Glossarist maintainer is removed",
- projectPermissionsTab.getSettingsMaintainersList(),
- not(hasItem("glossarist")));
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .doesNotContain("glossarist")
+ .as("Glossarist maintainer is removed");
ProjectMaintainersPage projectMaintainersPage = projectPermissionsTab
.gotoMaintainersTab();
- assertThat("The glossarist user is not in the list",
- projectMaintainersPage.getMaintainers(),
- not(hasItem("Glossarist @glossarist")));
+ assertThat(projectMaintainersPage.getMaintainers())
+ .doesNotContain("Glossarist @glossarist")
+ .as("The glossarist user is not in the list");
}
-
- @Test
- @Ignore("Exception on self removal")
- public void removeSelfAsMaintainer() {
-
- assertThat("Translator has signed in",
- new LoginWorkFlow().signIn("translator", "translator").loggedInAs(),
- equalTo("translator"));
-
- assertThat("The project is created",
- new ProjectWorkFlow()
- .createNewSimpleProject("removemaintainer",
- "removemaintainer")
- .getProjectName(),
- equalTo("removemaintainer"));
+ @Feature(summary = "The maintainer can remove themselves as maintainer " +
+ "from a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Ignore("Exception thrown on removing self")
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void removeSelfAsMaintainer() throws Exception {
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .loggedInAs())
+ .isEqualTo("translator")
+ .as("Translator has signed in");
+
+ assertThat(new ProjectWorkFlow()
+ .createNewSimpleProject("removemaintainer", "removemaintainer")
+ .getProjectName())
+ .isEqualTo("removemaintainer")
+ .as("The project is created");
ProjectPermissionsTab projectPermissionsTab = new ProjectWorkFlow()
.addMaintainer("removemaintainer", "admin");
- assertThat("admin maintainer is added",
- projectPermissionsTab.getSettingsMaintainersList(),
- hasItem("admin"));
+ assertThat(projectPermissionsTab.getSettingsMaintainersList())
+ .contains("admin")
+ .as("admin maintainer is added");
- ProjectVersionsPage projectVersionsPage = projectPermissionsTab
- .clickRemoveOnSelf("translator")
- .goToHomePage().goToProjects()
+ projectPermissionsTab.slightPause();
+ ProjectBasePage projectBasePage = projectPermissionsTab
+ .clickRemoveOnSelf("translator");
+ projectBasePage.slightPause();
+ ProjectVersionsPage projectVersionsPage = projectBasePage
+ .goToHomePage()
+ .goToProjects()
.goToProject("removemaintainer");
- assertThat("The translator user is no longer a maintainer",
- projectVersionsPage.settingsTabIsDisplayed(),
- not(true));
+ assertThat(projectVersionsPage.settingsTabIsDisplayed())
+ .isFalse()
+ .as("The translator user is no longer a maintainer");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/project/EditProjectAboutTest.java b/functional-test/src/test/java/org/zanata/feature/project/EditProjectAboutTest.java
index b670180f90..9198a7f287 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/EditProjectAboutTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/EditProjectAboutTest.java
@@ -21,9 +21,10 @@
package org.zanata.feature.project;
-import org.junit.ClassRule;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projects.ProjectAboutPage;
@@ -32,9 +33,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.isEmptyOrNullString;
+import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Damian Jansen
@@ -43,36 +42,39 @@
@Category(DetailedTest.class)
public class EditProjectAboutTest extends ZanataTestCase {
- @ClassRule
- public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
-
- @Test
- public void addAboutPageDetails() {
+ @Rule
+ public SampleProjectRule sampleProjectRule = new SampleProjectRule();
+ @Feature(summary = "The administrator can change a project about content",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addAboutPageDetails() throws Exception {
String aboutText = "This is my about text for AF";
- assertThat("Admin is logged in", new LoginWorkFlow()
+ assertThat(new LoginWorkFlow()
.signIn("admin", "admin")
- .loggedInAs(),
- equalTo("admin"));
+ .loggedInAs())
+ .isEqualTo("admin")
+ .as("Admin is logged in");
ProjectAboutTab projectAboutTab = new ProjectWorkFlow()
.createNewSimpleProject("aboutpagetest", "aboutpagetest")
.gotoSettingsTab()
.gotoSettingsAboutTab();
- assertThat("The text is empty",
- projectAboutTab.getAboutText(),
- isEmptyOrNullString());
+ assertThat(projectAboutTab.getAboutText())
+ .as("The text is empty")
+ .isNullOrEmpty();
- projectAboutTab = projectAboutTab.clearAboutText()
+ projectAboutTab = projectAboutTab
+ .clearAboutText()
.enterAboutText(aboutText)
.pressSave();
- //TODO waitForNotification
+ projectAboutTab.expectNotification("Successfully updated");
ProjectAboutPage projectAboutPage = projectAboutTab.gotoAboutTab();
- assertThat("The text in the About tab is correct",
- projectAboutPage.getAboutText(),
- equalTo(aboutText));
+ assertThat(projectAboutPage.getAboutText())
+ .isEqualTo(aboutText)
+ .as("The text in the About tab is correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/project/EditProjectGeneralTest.java b/functional-test/src/test/java/org/zanata/feature/project/EditProjectGeneralTest.java
index 67457bcada..fabb4ea1bc 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/EditProjectGeneralTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/EditProjectGeneralTest.java
@@ -20,27 +20,20 @@
*/
package org.zanata.feature.project;
-import org.hamcrest.Matchers;
-import org.junit.ClassRule;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projects.projectsettings.ProjectGeneralTab;
import org.zanata.page.projects.ProjectVersionsPage;
import org.zanata.page.projects.ProjectsPage;
-import org.zanata.util.AddUsersRule;
+import org.zanata.util.SampleProjectRule;
import org.zanata.workflow.BasicWorkFlow;
import org.zanata.workflow.LoginWorkFlow;
-import org.zanata.workflow.ProjectWorkFlow;
-import java.util.HashMap;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.not;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
-import static org.zanata.workflow.ProjectWorkFlow.projectDefaults;
+import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Damian Jansen
@@ -49,78 +42,65 @@
@Category(DetailedTest.class)
public class EditProjectGeneralTest extends ZanataTestCase {
- @ClassRule
- public static AddUsersRule addUsersRule = new AddUsersRule();
-
- @Test
- public void setAProjectToReadOnly() {
-
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "deactivateproject");
- projectSettings.put("Name", "Deactivate Project Test");
-
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- equalTo("admin"));
+ @Rule
+ public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ @Feature(summary = "The administrator can set a project to read-only",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 135848)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setAProjectToReadOnly() throws Exception {
+ ProjectsPage projectsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
- .lockProject();
-
- ProjectsPage projectsPage = new BasicWorkFlow()
- .goToHome()
+ .lockProject()
.goToProjects()
.setActiveFilterEnabled(true)
.setReadOnlyFilterEnabled(false)
.setObsoleteFilterEnabled(false)
- .waitForProjectVisibility(projectSettings.get("Name"), false);
+ .waitForProjectVisibility("about fedora", false);
- assertThat("The project is not displayed",
- projectsPage.getProjectNamesOnCurrentPage(),
- not(hasItem(projectSettings.get("Name"))));
+ assertThat(projectsPage.getProjectNamesOnCurrentPage())
+ .doesNotContain("about fedora")
+ .as("The project is not displayed");
projectsPage = projectsPage.setActiveFilterEnabled(false)
.setReadOnlyFilterEnabled(true)
.setObsoleteFilterEnabled(false)
- .waitForProjectVisibility(projectSettings.get("Name"), true);
+ .waitForProjectVisibility("about fedora", true);
- assertThat("The project is now displayed",
- projectsPage.getProjectNamesOnCurrentPage(),
- hasItem(projectSettings.get("Name")));
+ assertThat(projectsPage.getProjectNamesOnCurrentPage())
+ .contains("about fedora")
+ .as("The project is now displayed");
}
- @Test
- public void setAProjectToWritable() {
-
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "rewritableproject");
- projectSettings.put("Name", "Rewrite Project Test");
-
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- equalTo("admin"));
-
- assertThat("The project is locked",
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
- .gotoSettingsTab()
- .gotoSettingsGeneral()
- .lockProject()
- .goToProjects()
- .setActiveFilterEnabled(false)
- .setReadOnlyFilterEnabled(true)
- .setObsoleteFilterEnabled(false)
- .waitForProjectVisibility(
- projectSettings.get("Name"), true)
- .getProjectNamesOnCurrentPage(),
- hasItem(projectSettings.get("Name")));
+ @Feature(summary = "The administrator can set a read-only project " +
+ "to writable",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setAProjectToWritable() throws Exception {
+ assertThat(new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsGeneral()
+ .lockProject()
+ .goToProjects()
+ .setActiveFilterEnabled(false)
+ .setReadOnlyFilterEnabled(true)
+ .setObsoleteFilterEnabled(false)
+ .waitForProjectVisibility("about fedora", true)
+ .getProjectNamesOnCurrentPage())
+ .contains("about fedora")
+ .as("The project is locked");
ProjectsPage projectsPage = new BasicWorkFlow()
.goToHome()
.goToProjects()
- .goToProject(projectSettings.get("Name"))
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
.unlockProject()
@@ -128,134 +108,93 @@ public void setAProjectToWritable() {
.setActiveFilterEnabled(true)
.setReadOnlyFilterEnabled(false)
.setObsoleteFilterEnabled(false)
- .waitForProjectVisibility(projectSettings.get("Name"), true);
+ .waitForProjectVisibility("about fedora", true);
- assertThat("The project is now displayed",
- projectsPage.getProjectNamesOnCurrentPage(),
- hasItem(projectSettings.get("Name")));
+ assertThat(projectsPage.getProjectNamesOnCurrentPage())
+ .contains("about fedora")
+ .as("The project is now displayed");
}
- @Test
- public void setAProjectObsolete() {
-
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "setobsoleteproject");
- projectSettings.put("Name", "Obsolete Project Test");
- projectSettings.put("Project Type", "File");
-
- assertThat("Translator can log in",
- new LoginWorkFlow()
- .signIn("translator", "translator")
- .loggedInAs(),
- equalTo("translator"));
-
- assertThat("Archiving is not available to non admin",
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
- .gotoSettingsTab()
- .gotoSettingsGeneral()
- .isArchiveButtonAvailable(),
- not(true));
-
- new BasicWorkFlow().goToHome().logout();
-
+ @Feature(summary = "The administrator can set a project to obsolete",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 135846)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setAProjectObsolete() throws Exception {
ProjectsPage projectsPage = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
- .goToProject(projectSettings.get("Name"))
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
.archiveProject()
.goToProjects();
- assertThat("The project is not displayed",
- projectsPage.getProjectNamesOnCurrentPage(),
- not(hasItem(projectSettings.get("Name"))));
+ assertThat(projectsPage.getProjectNamesOnCurrentPage())
+ .doesNotContain("about fedora")
+ .as("The project is not displayed");
projectsPage = projectsPage.setActiveFilterEnabled(false)
.setReadOnlyFilterEnabled(false)
.setObsoleteFilterEnabled(true);
- projectsPage
- .waitForProjectVisibility(projectSettings.get("Name"), true);
+ projectsPage.waitForProjectVisibility("about fedora", true);
- assertThat("The project is now displayed",
- projectsPage.getProjectNamesOnCurrentPage(),
- hasItem(projectSettings.get("Name")));
+ assertThat(projectsPage.getProjectNamesOnCurrentPage())
+ .contains("about fedora")
+ .as("The project is now displayed");
projectsPage.logout();
- assertThat("User cannot navigate to a project",
- new LoginWorkFlow()
- .signIn("translator", "translator")
- .goToProjects()
- .getProjectNamesOnCurrentPage(),
- not(hasItem(projectSettings.get("Name"))));
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .goToProjects()
+ .getProjectNamesOnCurrentPage())
+ .doesNotContain("about fedora")
+ .as("User cannot navigate to the obsolete project");
}
- @Test
- public void setAnObsoleteProjectAsActive() {
-
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "setobsoleteprojectactive");
- projectSettings.put("Name", "Unobsolete Project Test");
- projectSettings.put("Project Type", "File");
-
- assertThat("Translator can log in",
- new LoginWorkFlow()
- .signIn("translator", "translator")
- .loggedInAs(),
- equalTo("translator"));
-
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ @Feature(summary = "The administrator can set an obsolete project " +
+ "to active",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setAnObsoleteProjectAsActive() throws Exception {
+ ProjectGeneralTab projectGeneralTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
- .logout();
-
- ProjectGeneralTab projectGeneralTab =
- new LoginWorkFlow()
- .signIn("admin", "admin")
- .goToProjects()
- .goToProject(projectSettings.get("Name"))
- .gotoSettingsTab()
- .gotoSettingsGeneral()
- .archiveProject()
- .goToProjects()
- .setObsoleteFilterEnabled(true)
- .goToProject(projectSettings.get("Name"))
- .gotoSettingsTab()
- .gotoSettingsGeneral()
- .unarchiveProject();
-
- assertThat("The archive button is now available",
- projectGeneralTab.isArchiveButtonAvailable());
-
- assertThat("Translator can view the project",
- new LoginWorkFlow()
- .signIn("translator", "translator")
- .goToProjects()
- .goToProject(projectSettings.get("Name"))
- .getProjectName(),
- equalTo(projectSettings.get("Name")));
-
- }
+ .archiveProject()
+ .goToProjects()
+ .setObsoleteFilterEnabled(true)
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsGeneral()
+ .unarchiveProject();
- @Test
- public void changeProjectName() {
+ assertThat(projectGeneralTab.isArchiveButtonAvailable())
+ .isTrue()
+ .as("The archive button is now available");
- String replacementText = "a new name";
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "changeName");
- projectSettings.put("Name", "Project Name Change Test");
+ projectGeneralTab.logout();
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- Matchers.equalTo("admin"));
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .goToProjects()
+ .goToProject("about fedora")
+ .getProjectName())
+ .isEqualTo("about fedora")
+ .as("Translator can view the project");
+ }
- ProjectVersionsPage projectVersionsPage =
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ @Feature(summary = "The administrator can change a project's name",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 198431)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void changeProjectName() throws Exception {
+ String replacementText = "a new name";
+ ProjectVersionsPage projectVersionsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
.enterProjectName(replacementText)
@@ -263,93 +202,81 @@ public void changeProjectName() {
.goToProjects()
.goToProject(replacementText);
- assertThat("The name has changed",
- projectVersionsPage.getProjectName(),
- Matchers.equalTo(replacementText));
+ assertThat(projectVersionsPage.getProjectName())
+ .isEqualTo(replacementText)
+ .as("The project name has changed");
}
- @Test
- public void changeProjectDescription() {
-
+ @Feature(summary = "The administrator can change a project's description",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 198431)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void changeProjectDescription() throws Exception {
String replacementText = "a new description";
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "changeDescription");
- projectSettings.put("Name", "Project Description Test");
- projectSettings.put("Description", "An old description");
-
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- Matchers.equalTo("admin"));
-
- ProjectVersionsPage projectVersionsPage =
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ ProjectVersionsPage projectVersionsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora");
+
+ assertThat(projectVersionsPage.getContentAreaParagraphs())
+ .doesNotContain(replacementText)
+ .as("The description is default");
+
+ ProjectGeneralTab projectGeneralTab = projectVersionsPage
.gotoSettingsTab()
.gotoSettingsGeneral()
.enterDescription(replacementText)
- .updateProject()
- .goToProjects()
- .goToProject(projectSettings.get("Name"));
+ .updateProject();
- assertThat("The text has changed",
- projectVersionsPage.getContentAreaParagraphs(),
- Matchers.hasItem(replacementText));
+ assertThat(projectGeneralTab.getContentAreaParagraphs())
+ .contains(replacementText)
+ .as("The text has changed");
}
- @Test
- public void changeProjectType() {
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "changeType");
- projectSettings.put("Name", "Project Type Test");
-
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- Matchers.equalTo("admin"));
-
- ProjectGeneralTab projectGeneralTab =
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ @Feature(summary = "The administrator can change a project's type",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 198431)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void changeProjectType() throws Exception {
+ ProjectGeneralTab projectGeneralTab = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
.selectProjectType("Properties")
- .updateProject()
- .goToProjects()
- .goToProject(projectSettings.get("Name"))
+ .updateProject();
+
+ projectGeneralTab.reload();
+ projectGeneralTab = projectGeneralTab
.gotoSettingsTab()
.gotoSettingsGeneral();
- assertThat("The type is correct",
- projectGeneralTab.getSelectedProjectType(),
- Matchers.equalTo("Properties"));
+ assertThat(projectGeneralTab.getSelectedProjectType())
+ .isEqualTo("Properties")
+ .as("The project type is correct");
}
- @Test
- public void changeSourceLinks() {
- HashMap projectSettings = projectDefaults();
- projectSettings.put("Project ID", "changeLinks");
- projectSettings.put("Name", "Project Links Test");
-
- assertThat("Admin can log in",
- new LoginWorkFlow().signIn("admin", "admin").loggedInAs(),
- Matchers.equalTo("admin"));
-
- ProjectVersionsPage projectVersionsPage =
- new ProjectWorkFlow()
- .createNewProject(projectSettings)
+ @Feature(summary = "The administrator can change a project's source urls",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 198431)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void changeSourceLinks() throws Exception {
+ ProjectVersionsPage projectVersionsPage = new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
.gotoSettingsTab()
.gotoSettingsGeneral()
.enterHomePage("http://www.example.com")
.enterRepository("http://www.test.com")
.updateProject()
.goToProjects()
- .goToProject(projectSettings.get("Name"));
+ .goToProject("about fedora");
- assertThat("The homepage is correct",
- projectVersionsPage.getHomepage(),
- Matchers.equalTo("http://www.example.com"));
+ assertThat(projectVersionsPage.getHomepage())
+ .isEqualTo("http://www.example.com")
+ .as("The homepage is correct");
- assertThat("The git url is correct",
- projectVersionsPage.getGitUrl(),
- Matchers.equalTo("http://www.test.com"));
+ assertThat(projectVersionsPage.getGitUrl())
+ .isEqualTo("http://www.test.com")
+ .as("The git url is correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/project/EditProjectLanguagesTest.java b/functional-test/src/test/java/org/zanata/feature/project/EditProjectLanguagesTest.java
index d70af91596..857d2598b8 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/EditProjectLanguagesTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/EditProjectLanguagesTest.java
@@ -21,20 +21,21 @@
package org.zanata.feature.project;
-import org.junit.ClassRule;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+
+import org.assertj.core.api.Assertions;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
-import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.page.projects.projectsettings.ProjectLanguagesTab;
import org.zanata.util.SampleProjectRule;
import org.zanata.workflow.LoginWorkFlow;
-import java.util.List;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-
/**
* @author Damian Jansen
* djansen@redhat.com
@@ -42,11 +43,13 @@
@Category(DetailedTest.class)
public class EditProjectLanguagesTest extends ZanataTestCase {
- @ClassRule
- public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
+ @Rule
+ public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void editProjectLanguages() {
+ @Feature(summary = "The administrator can edit the project languages",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void editProjectLanguages() throws Exception {
ProjectLanguagesTab projectLanguagesTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -54,17 +57,19 @@ public void editProjectLanguages() {
.gotoSettingsTab()
.gotoSettingsLanguagesTab();
+ projectLanguagesTab.slightPause();
+
List enabledLocaleList = projectLanguagesTab
.getEnabledLocaleList();
- assertThat("The enabled list contains three languages",
- enabledLocaleList,
- contains("French[fr]", "Hindi[hi]", "Polish[pl]"));
+ assertThat(enabledLocaleList)
+ .contains("French[fr]", "Hindi[hi]", "Polish[pl]")
+ .as("The enabled list contains three languages");
- assertThat("The enabled list does not contain " +
- "'English (United States)[en-US]'",
- enabledLocaleList,
- not(hasItem("English (United States)[en-US]")));
+ assertThat(enabledLocaleList)
+ .doesNotContain("English (United States)[en-US]")
+ .as("The enabled list does not contain " +
+ "'English (United States)[en-US]'");
projectLanguagesTab = projectLanguagesTab
.gotoSettingsTab()
@@ -76,13 +81,10 @@ public void editProjectLanguages() {
.gotoSettingsLanguagesTab()
.getEnabledLocaleList();
- assertThat("The enabled list does not contain 'US English'",
- enabledLocaleList,
- not(hasItem("English (United States)[en-US]")));
-
- assertThat("The enabled list does not contain 'Polish'",
- enabledLocaleList,
- not(hasItem("Polish[pl]")));
+ assertThat(enabledLocaleList)
+ .doesNotContain("English (United States)[en-US]")
+ .doesNotContain("Polish[pl]")
+ .as("The enabled list does not contain 'US English' or Polish");
enabledLocaleList = projectLanguagesTab
.gotoSettingsTab()
@@ -91,10 +93,10 @@ public void editProjectLanguages() {
.addLanguage("English (United States)[en-US]")
.getEnabledLocaleList();
- assertThat("Three languages are available to translate",
- enabledLocaleList,
- contains("English (United States)[en-US]",
+ Assertions.assertThat(enabledLocaleList)
+ .contains("English (United States)[en-US]",
"French[fr]",
- "Hindi[hi]"));
+ "Hindi[hi]")
+ .as("The enabled language list contains en-US, fr and hi");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/project/EditProjectValidationsTest.java b/functional-test/src/test/java/org/zanata/feature/project/EditProjectValidationsTest.java
index 5894c462c3..d81610920f 100644
--- a/functional-test/src/test/java/org/zanata/feature/project/EditProjectValidationsTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/project/EditProjectValidationsTest.java
@@ -23,13 +23,14 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projects.projectsettings.ProjectTranslationTab;
import org.zanata.util.SampleProjectRule;
import org.zanata.workflow.LoginWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeTrue;
/**
@@ -42,8 +43,11 @@ public class EditProjectValidationsTest extends ZanataTestCase {
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void setValidationOptions() {
+ @Feature(summary = "The administrator can change the validation levels " +
+ "for a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setValidationOptions() throws Exception {
ProjectTranslationTab projectTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
@@ -52,9 +56,10 @@ public void setValidationOptions() {
.gotoSettingsTab()
.gotoSettingsTranslationTab();
- assertThat("The level for tabs is currently Warning",
- projectTranslationTab.isValidationLevel(
- "Tab characters (\\t)", "Warning"));
+ assertThat(projectTranslationTab
+ .isValidationLevel("Tab characters (\\t)", "Warning"))
+ .isTrue()
+ .as("The level for tabs is currently Warning");
projectTranslationTab = projectTranslationTab
.setValidationLevel("HTML/XML tags", "Error")
@@ -73,48 +78,73 @@ public void setValidationOptions() {
.gotoSettingsTab()
.gotoSettingsTranslationTab();
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("HTML/XML tags", "Error"));
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("Java variables", "Error"));
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("Leading/trailing newline (\\n)", "Error"));
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("Printf variables", "Error"));
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("Tab characters (\\t)", "Error"));
- assertThat("The validation changes were saved", projectTranslationTab
- .isValidationLevel("XML entity reference", "Error"));
+ assertThat(projectTranslationTab
+ .isValidationLevel("HTML/XML tags", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
+ assertThat(projectTranslationTab
+ .isValidationLevel("Java variables", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
+ assertThat(projectTranslationTab
+ .isValidationLevel("Leading/trailing newline (\\n)", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
+ assertThat(projectTranslationTab
+ .isValidationLevel("Printf variables", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
+ assertThat(projectTranslationTab
+ .isValidationLevel("Tab characters (\\t)", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
+ assertThat(projectTranslationTab
+ .isValidationLevel("XML entity reference", "Error"))
+ .isTrue()
+ .as("The validation changes were saved");
}
- @Test
- public void printfAndPositionalPrintfAreExclusive() {
+ @Feature(summary = "The system will only allow one of the two Printf " +
+ "validation options to be active at one time",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void printfAndPositionalPrintfAreExclusive() throws Exception {
ProjectTranslationTab projectTranslationTab = new LoginWorkFlow()
- .signIn("admin", "admin")
- .goToProjects()
- .goToProject("about fedora")
- .gotoSettingsTab()
- .gotoSettingsTranslationTab()
- .setValidationLevel(
- "Positional printf (XSI extension)", "Error");
-
- assertThat("The Positional printf level is Error",
- projectTranslationTab.isValidationLevel(
- "Positional printf (XSI extension)", "Error"));
-
- assertThat("The Printf level is Off",
- projectTranslationTab
- .isValidationLevel("Printf variables", "Off"));
+ .signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsTranslationTab()
+ .setValidationLevel(
+ "Positional printf (XSI extension)", "Error");
+
+ projectTranslationTab.expectNotification("Updated validation " +
+ "Positional printf (XSI extension) to Error.");
+
+ assertThat(projectTranslationTab
+ .isValidationLevel("Positional printf (XSI extension)", "Error"))
+ .isTrue()
+ .as("The Positional printf level is Error");
+
+ assertThat(projectTranslationTab
+ .isValidationLevel("Printf variables", "Off"))
+ .isTrue()
+ .as("The Printf level is Off");
projectTranslationTab = projectTranslationTab
.setValidationLevel("Printf variables", "Error");
- assertThat("The Printf level is Error",
- projectTranslationTab
- .isValidationLevel("Printf variables", "Error"));
+ projectTranslationTab.expectNotification("Updated validation " +
+ "Printf variables to Error.");
+
+ assertThat(projectTranslationTab
+ .isValidationLevel("Printf variables", "Error"))
+ .isTrue()
+ .as("The Printf level is Error");
- assertThat("The Positional printf level is Off",
- projectTranslationTab.isValidationLevel(
- "Positional printf (XSI extension)", "Off"));
+ assertThat(projectTranslationTab
+ .isValidationLevel("Positional printf (XSI extension)", "Off"))
+ .isTrue()
+ .as("The Positional printf level is Off");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/projectversion/CreateProjectVersionTest.java b/functional-test/src/test/java/org/zanata/feature/projectversion/CreateProjectVersionTest.java
index 0fea070941..af1c8a58c7 100644
--- a/functional-test/src/test/java/org/zanata/feature/projectversion/CreateProjectVersionTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/projectversion/CreateProjectVersionTest.java
@@ -24,6 +24,7 @@
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
@@ -34,10 +35,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.not;
+import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Damian Jansen enabledLocaleList = versionLanguagesTab
.getEnabledLocaleList();
- assertThat("The enabled list contains three languages",
- enabledLocaleList,
- contains("French[fr]", "Hindi[hi]", "Polish[pl]"));
+ assertThat(enabledLocaleList)
+ .contains("French[fr]", "Hindi[hi]", "Polish[pl]")
+ .as("The enabled list contains three languages");
- assertThat("The enabled list does not contain " +
- "'English (United States)[en-US]'",
- enabledLocaleList,
- not(hasItem("English (United States)[en-US]")));
+ assertThat(enabledLocaleList)
+ .doesNotContain("English (United States)[en-US]")
+ .as("The enabled list does not contain " +
+ "'English (United States)[en-US]'");
versionLanguagesTab = versionLanguagesTab.removeLocale("pl");
versionLanguagesTab.waitForLanguagesNotContains(
@@ -84,13 +85,10 @@ public void changeVersionLanguages() {
versionLanguagesTab.waitForLanguagesNotContains("Polish[pl]");
enabledLocaleList = versionLanguagesTab.getEnabledLocaleList();
- assertThat("The enabled list does not contain 'US English'",
- enabledLocaleList,
- not(hasItem("English (United States)[en-US]")));
-
- assertThat("The enabled list does not contain 'Polish'",
- enabledLocaleList,
- not(hasItem("Polish[pl]")));
+ assertThat(enabledLocaleList)
+ .doesNotContain("English (United States)[en-US]")
+ .doesNotContain("Polish[pl]")
+ .as("The enabled list does not contain 'US English' or Polish");
versionLanguagesTab = versionLanguagesTab
.gotoSettingsTab()
@@ -102,10 +100,10 @@ public void changeVersionLanguages() {
"English (United States)[en-US]");
enabledLocaleList = versionLanguagesTab.getEnabledLocaleList();
- assertThat("Three languages are available to translate",
- enabledLocaleList,
- contains("English (United States)[en-US]",
+ assertThat(enabledLocaleList)
+ .contains("English (United States)[en-US]",
"French[fr]",
- "Hindi[hi]"));
+ "Hindi[hi]")
+ .as("Three languages are available to translate");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/projectversion/EditVersionValidationsTest.java b/functional-test/src/test/java/org/zanata/feature/projectversion/EditVersionValidationsTest.java
index d915103d5f..a1798b1278 100644
--- a/functional-test/src/test/java/org/zanata/feature/projectversion/EditVersionValidationsTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/projectversion/EditVersionValidationsTest.java
@@ -20,10 +20,10 @@
*/
package org.zanata.feature.projectversion;
-import org.hamcrest.Matchers;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.projectversion.versionsettings.VersionTranslationTab;
@@ -32,8 +32,7 @@
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeTrue;
/**
@@ -46,8 +45,11 @@ public class EditVersionValidationsTest extends ZanataTestCase {
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void setValidationOptions() {
+ @Feature(summary = "The administrator can set validation options for " +
+ "a project version",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void setValidationOptions() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -56,8 +58,10 @@ public void setValidationOptions() {
.gotoSettingsTab()
.gotoSettingsTranslationTab();
- assertThat("The level is currently Warning", versionTranslationTab
- .isValidationLevel("Tab characters (\\t)", "Warning"));
+ assertThat(versionTranslationTab
+ .isValidationLevel("Tab characters (\\t)", "Warning"))
+ .isTrue()
+ .as("The level is currently Warning");
versionTranslationTab = versionTranslationTab
.setValidationLevel("Tab characters (\\t)", "Error");
@@ -72,13 +76,16 @@ public void setValidationOptions() {
.gotoSettingsTab()
.gotoSettingsTranslationTab();
- assertThat("The changes were saved", versionTranslationTab
- .isValidationLevel("Tab characters (\\t)", "Error"));
+ assertThat(versionTranslationTab
+ .isValidationLevel("Tab characters (\\t)", "Error"))
+ .as("The changes were saved");
}
-
- @Test
- public void verifyValidationsAreErrors() {
+ @Feature(summary = "The system recognises validation errors options in " +
+ "translation targets and displays them to the user",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void verifyValidationsAreErrors() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -93,36 +100,31 @@ public void verifyValidationsAreErrors() {
EditorPage editorPage = new ProjectWorkFlow()
.goToProjectByName("about fedora")
.gotoVersion("master")
- .translate("fr", "About_Fedora")
- .setSyntaxHighlighting(false);
-
- assertThat("The text in the translation target is blank",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- equalTo(""));
-
- editorPage.pasteIntoRowAtIndex(0, "\t");
+ .translate("fr", "About_Fedora");
- assertThat("The text in the translation target is now a tab",
- editorPage.getBasicTranslationTargetAtRowIndex(0),
- equalTo("\t"));
+ assertThat(editorPage.getBasicTranslationTargetAtRowIndex(0))
+ .isEqualTo("")
+ .as("The text in the translation target is blank");
- editorPage.defocus();
+ editorPage.pasteIntoRowAtIndex(0, "\t").saveAsFuzzyAtRow(0);
editorPage.waitForValidationErrorsVisible();
- assertThat("The notification area shows there's an error",
- editorPage.getValidationMessageCurrentTarget(),
- equalTo("Warning: none, Errors: 1"));
+ assertThat(editorPage.getValidationMessageCurrentTarget())
+ .isEqualTo("Warning: none, Errors: 1")
+ .as("The notification area shows there's an error");
editorPage = editorPage.openValidationBox();
- assertThat("The correct error is shown for the validation",
- editorPage.getValidationMessageCurrentTarget(),
- Matchers.containsString("Target has more tabs (\\t) than source "
- + "(source: 0, target: 1)"));
+ assertThat(editorPage.getValidationMessageCurrentTarget())
+ .contains("Target has more tabs (\\t) than source "
+ + "(source: 0, target: 1)")
+ .as("The correct error is shown for the validation");
}
- @Test
- public void userCannotTurnOffEnforcedValidations() {
+ @Feature(summary = "The user cannot disable enforced validations",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void userCannotTurnOffEnforcedValidations() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -140,17 +142,22 @@ public void userCannotTurnOffEnforcedValidations() {
.translate("fr", "About_Fedora")
.openValidationOptions();
- assertThat("The option is selected",
- editorPage.isValidationOptionSelected(
- EditorPage.Validations.TABS));
+ assertThat(editorPage.isValidationOptionSelected(
+ EditorPage.Validations.TABS))
+ .isTrue()
+ .as("The option is selected");
- assertThat("The option is unavailable",
- !editorPage.isValidationOptionAvailable(
- EditorPage.Validations.TABS));
+ assertThat(editorPage.isValidationOptionAvailable(
+ EditorPage.Validations.TABS))
+ .isFalse()
+ .as("The option is unavailable");
}
- @Test
- public void printfAndPositionalPrintfAreExclusive() {
+ @Feature(summary = "The user cannot select both printf formats for " +
+ "validation options",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void printfAndPositionalPrintfAreExclusive() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -160,24 +167,36 @@ public void printfAndPositionalPrintfAreExclusive() {
.gotoSettingsTranslationTab()
.setValidationLevel(
"Positional printf (XSI extension)", "Error");
-
- assertThat("The Positional printf level is Error",
- versionTranslationTab.isValidationLevel(
- "Positional printf (XSI extension)", "Error"));
- assertThat("The Printf level is Off",
- versionTranslationTab.isValidationLevel("Printf variables", "Off"));
+ versionTranslationTab.expectNotification(
+ "Updated validation Positional printf (XSI extension) to Error.");
+
+ assertThat(versionTranslationTab
+ .isValidationLevel("Positional printf (XSI extension)", "Error"))
+ .isTrue()
+ .as("The Positional printf level is Error");
+ assertThat(versionTranslationTab
+ .isValidationLevel("Printf variables", "Off"))
+ .isTrue()
+ .as("The Printf level is Off");
versionTranslationTab.setValidationLevel("Printf variables", "Error");
-
- assertThat("The Printf level is Error",
- versionTranslationTab.isValidationLevel("Printf variables", "Error"));
- assertThat("The Positional printf level is Off",
- versionTranslationTab.isValidationLevel(
- "Positional printf (XSI extension)", "Off"));
+ versionTranslationTab.expectNotification(
+ "Updated validation Printf variables to Error.");
+
+ assertThat(versionTranslationTab
+ .isValidationLevel("Printf variables", "Error"))
+ .isTrue()
+ .as("The Printf level is Error");
+ assertThat(versionTranslationTab
+ .isValidationLevel("Positional printf (XSI extension)", "Off"))
+ .isTrue()
+ .as("The Positional printf level is Off");
}
- @Test
- public void userCanEnableADisabledValidation() {
+ @Feature(summary = "The user can turn on a disabled validation option",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void userCanEnableADisabledValidation() throws Exception {
VersionTranslationTab versionTranslationTab = new LoginWorkFlow()
.signIn("admin", "admin")
.goToProjects()
@@ -193,20 +212,21 @@ public void userCanEnableADisabledValidation() {
.goToProjectByName("about fedora")
.gotoVersion("master")
.translate("fr", "About_Fedora")
- .setSyntaxHighlighting(false)
- .pasteIntoRowAtIndex(0, "\t");
+ .pasteIntoRowAtIndex(0, "\t")
+ .saveAsFuzzyAtRow(0);
- assertThat("The validation errors are not shown",
- !editorPage.isValidationMessageCurrentTargetVisible());
+ assertThat(editorPage.isValidationMessageCurrentTargetVisible())
+ .isFalse()
+ .as("The validation errors are not shown");
editorPage = editorPage
.openValidationOptions()
.clickValidationCheckbox(EditorPage.Validations.TABS);
-
editorPage.waitForValidationErrorsVisible();
- assertThat("The validation errors are shown",
- editorPage.isValidationMessageCurrentTargetVisible());
+ assertThat(editorPage.isValidationMessageCurrentTargetVisible())
+ .isTrue()
+ .as("The validation errors are shown");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/projectversion/VersionFilteringTest.java b/functional-test/src/test/java/org/zanata/feature/projectversion/VersionFilteringTest.java
index fc947e2e39..e99e17a30d 100644
--- a/functional-test/src/test/java/org/zanata/feature/projectversion/VersionFilteringTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/projectversion/VersionFilteringTest.java
@@ -23,15 +23,14 @@
import org.junit.ClassRule;
import org.junit.Test;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.page.projects.ProjectVersionsPage;
import org.zanata.util.SampleProjectRule;
import org.zanata.workflow.LoginWorkFlow;
import org.zanata.workflow.ProjectWorkFlow;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.contains;
-import static org.hamcrest.Matchers.equalTo;
+import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Damian Jansen
@@ -42,106 +41,84 @@ public class VersionFilteringTest extends ZanataTestCase {
@ClassRule
public static SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void versionSearchFiltering() {
-
+ @Feature(summary = "The user can filter project versions by name",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void versionSearchFiltering() throws Exception {
String projectName = "versionsearchnums";
- assertThat("Login as translator",
- new LoginWorkFlow().signIn("translator", "translator")
- .loggedInAs(),
- equalTo("translator"));
-
- assertThat("The project is created",
- new ProjectWorkFlow()
- .createNewSimpleProject("version-search", projectName)
- .getProjectName(),
- equalTo(projectName));
-
- assertThat("The version alpha is created",
- new ProjectWorkFlow()
- .createNewProjectVersion(projectName, "alpha")
- .getProjectVersionName(),
- equalTo("alpha"));
-
- assertThat("The version bravo is created",
- new ProjectWorkFlow()
- .createNewProjectVersion(projectName, "bravo")
- .getProjectVersionName(),
- equalTo("bravo"));
+ assertThat(new LoginWorkFlow()
+ .signIn("translator", "translator")
+ .loggedInAs())
+ .isEqualTo("translator")
+ .as("Login as translator");
+
+ assertThat(new ProjectWorkFlow()
+ .createNewSimpleProject("version-search", projectName)
+ .getProjectName())
+ .isEqualTo(projectName)
+ .as("The project is created");
+
+ assertThat(new ProjectWorkFlow()
+ .createNewProjectVersion(projectName, "alpha")
+ .getProjectVersionName())
+ .isEqualTo("alpha")
+ .as("The version alpha is created");
+
+ assertThat(new ProjectWorkFlow()
+ .createNewProjectVersion(projectName, "bravo")
+ .getProjectVersionName())
+ .isEqualTo("bravo")
+ .as("The version bravo is created");
ProjectVersionsPage projectVersionsPage = new ProjectWorkFlow()
.goToProjectByName(projectName)
.waitForDisplayedVersions(2);
- assertThat("The version count is 2",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(2));
-
- assertThat("The versions are correct",
- projectVersionsPage.getVersions(),
- contains("bravo", "alpha"));
+ assertVersions(projectVersionsPage, 2, new String[]{"bravo", "alpha"});
projectVersionsPage = projectVersionsPage
.clickSearchIcon()
.enterVersionSearch("alpha")
.waitForDisplayedVersions(1);
- assertThat("The version count is 1",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(1));
-
- assertThat("The versions are correct",
- projectVersionsPage.getVersions(),
- contains("alpha"));
+ assertVersions(projectVersionsPage, 1, new String[]{"alpha"});
projectVersionsPage = projectVersionsPage
.clearVersionSearch()
.waitForDisplayedVersions(2);
- assertThat("The version count is 2 again",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(2));
-
- assertThat("The versions are correct",
- projectVersionsPage.getVersions(),
- contains("bravo", "alpha"));
+ assertVersions(projectVersionsPage, 2, new String[]{"bravo", "alpha"});
projectVersionsPage = projectVersionsPage
.enterVersionSearch("bravo")
.waitForDisplayedVersions(1);
- assertThat("The version count is 1",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(1));
-
- assertThat("The versions are correct",
- projectVersionsPage.getVersions(),
- contains("bravo"));
+ assertVersions(projectVersionsPage, 1, new String[]{"bravo"});
projectVersionsPage = projectVersionsPage
.clearVersionSearch()
.enterVersionSearch("charlie")
.waitForDisplayedVersions(0);
- assertThat("The version count is 0",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(0));
-
- assertThat("The versions are correct",
- projectVersionsPage.getVersions().size(),
- equalTo(0));
+ assertVersions(projectVersionsPage, 0, new String[]{});
projectVersionsPage = projectVersionsPage
.clearVersionSearch()
.waitForDisplayedVersions(2);
- assertThat("The version count is 2 again",
- projectVersionsPage.getNumberOfDisplayedVersions(),
- equalTo(2));
+ assertVersions(projectVersionsPage, 2, new String[]{"bravo", "alpha"});
+ }
+
+ private void assertVersions(ProjectVersionsPage page,
+ int versionsCount,
+ String[] versionNames) {
+ assertThat(page.getNumberOfDisplayedVersions())
+ .isEqualTo(versionsCount)
+ .as("The version count is " + versionsCount);
- assertThat("The versions are correct",
- projectVersionsPage.getVersions(),
- contains("bravo", "alpha"));
+ assertThat(page.getVersions())
+ .contains(versionNames)
+ .as("The versions are correct");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/search/ProjectSearchTest.java b/functional-test/src/test/java/org/zanata/feature/search/ProjectSearchTest.java
index dcecd5034e..5be1855567 100644
--- a/functional-test/src/test/java/org/zanata/feature/search/ProjectSearchTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/search/ProjectSearchTest.java
@@ -21,14 +21,12 @@
package org.zanata.feature.search;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasItem;
-import static org.hamcrest.Matchers.not;
+import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
import org.zanata.page.BasePage;
@@ -48,52 +46,63 @@ public class ProjectSearchTest extends ZanataTestCase {
@Rule
public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- @Test
- public void successfulProjectSearchAndDisplay() {
+ @Feature(summary = "The user can search for a project",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void successfulProjectSearchAndDisplay() throws Exception {
BasePage basePage = new BasicWorkFlow()
.goToHome()
.enterSearch("about")
.waitForSearchListContains("about fedora");
- assertThat("Normal user can see the project",
- basePage.getProjectSearchAutocompleteItems(),
- hasItem("about fedora"));
+ assertThat(basePage.getProjectSearchAutocompleteItems())
+ .contains("about fedora")
+ .as("Normal user can see the project");
ProjectBasePage projectPage =
basePage.clickSearchEntry("about fedora");
- assertThat("The project page is the correct one", projectPage
- .getProjectName().trim(), // UI adds a space
- equalTo("about fedora"));
+ assertThat(projectPage.getProjectName().trim())
+ .isEqualTo("about fedora")
+ .as("The project page is the correct one");
}
- @Test
- public void unsuccessfulProjectSearch() {
+ @Feature(summary = "The system will provide no results on an " +
+ "unsuccessful search",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void unsuccessfulProjectSearch() throws Exception {
ProjectsPage projectsPage = new BasicWorkFlow()
.goToHome()
.enterSearch("arodef")
.waitForSearchListContains("Search Zanata for 'arodef'")
.submitSearch();
- assertThat("No projects are displayed", projectsPage
- .getProjectNamesOnCurrentPage().isEmpty());
+ assertThat(projectsPage.getProjectNamesOnCurrentPage().isEmpty())
+ .isTrue()
+ .as("No projects are displayed");
}
- @Test
- public void normalUserCannotSearchObsolete() {
- new LoginWorkFlow().signIn("admin", "admin").goToProjects()
- .goToProject("about fedora").gotoSettingsTab()
- .gotoSettingsGeneral().archiveProject().logout();
+ @Feature(summary = "The user cannot search for Obsolete projects",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void normalUserCannotSearchObsolete() throws Exception {
+ new LoginWorkFlow().signIn("admin", "admin")
+ .goToProjects()
+ .goToProject("about fedora")
+ .gotoSettingsTab()
+ .gotoSettingsGeneral()
+ .archiveProject()
+ .logout();
BasePage basePage = new BasicWorkFlow()
.goToHome()
.enterSearch("about")
.waitForSearchListContains("Search Zanata for 'about'");
- assertThat("User cannot see the obsolete project",
- basePage.getProjectSearchAutocompleteItems(),
- not(hasItem("About Fedora")));
-
+ assertThat(basePage.getProjectSearchAutocompleteItems())
+ .doesNotContain("About Fedora")
+ .as("User cannot see the obsolete project");
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/security/SecurityFullTest.java b/functional-test/src/test/java/org/zanata/feature/security/SecurityFullTest.java
deleted file mode 100644
index 67f781fa28..0000000000
--- a/functional-test/src/test/java/org/zanata/feature/security/SecurityFullTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2013, Red Hat, Inc. and individual contributors as indicated by the
- * @author tags. See the copyright.txt file in the distribution for a full
- * listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.zanata.feature.security;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
-
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.zanata.feature.testharness.ZanataTestCase;
-import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
-import org.zanata.feature.testharness.TestPlan.DetailedTest;
-import org.zanata.page.account.ResetPasswordPage;
-import org.zanata.page.account.SignInPage;
-import org.zanata.page.dashboard.DashboardBasePage;
-import org.zanata.util.AddUsersRule;
-import org.zanata.workflow.BasicWorkFlow;
-import org.zanata.workflow.LoginWorkFlow;
-
-/**
- * @author Damian Jansen djansen@redhat.com
- */
-@Category(DetailedTest.class)
-public class SecurityFullTest extends ZanataTestCase {
-
- @Rule
- public AddUsersRule addUsersRule = new AddUsersRule();
-
- @Before
- public void before() {
- // Remove all cookies, no previous login is allowed
- new BasicWorkFlow().goToHome().deleteCookiesAndRefresh();
- }
-
- @Test
- @Category(BasicAcceptanceTest.class)
- public void signInSuccessful() {
- DashboardBasePage dashboardPage =
- new LoginWorkFlow().signIn("admin", "admin");
- assertThat("User is logged in", dashboardPage.loggedInAs(),
- equalTo("admin"));
- }
-
- @Test
- @Category(BasicAcceptanceTest.class)
- public void signInFailure() {
- SignInPage signInPage = new LoginWorkFlow()
- .signInFailure("nosuchuser", "password");
-
- assertThat("Error message is shown",
- signInPage.waitForFieldErrors(),
- Matchers.hasItem("Login failed"));
- }
-
- @Test
- @Ignore("RHBZ-987707 | Cannot intercept email yet")
- public void resetPasswordSuccessful() {
- SignInPage signInPage =
- new BasicWorkFlow().goToHome().clickSignInLink();
- ResetPasswordPage resetPasswordPage = signInPage.goToResetPassword();
- resetPasswordPage =
- resetPasswordPage.enterUserName("nosuchuser").enterEmail(
- "nosuchuser@nosuchdomain.com");
- resetPasswordPage = resetPasswordPage.resetPassword();
- // TODO: Reset Success page
- }
-
- @Test
- public void resetPasswordFailureForInvalidAccount() {
- SignInPage signInPage =
- new BasicWorkFlow().goToHome().clickSignInLink();
- ResetPasswordPage resetPasswordPage = signInPage.goToResetPassword();
- resetPasswordPage =
- resetPasswordPage.enterUserName("nosuchuser").enterEmail(
- "nosuchuser@nosuchdomain.com");
- resetPasswordPage = resetPasswordPage.resetFailure();
- assertThat("A no such account message is displayed",
- resetPasswordPage.getNotificationMessage(),
- equalTo("No such account found"));
- }
-
- @Test
- public void invalidResetPasswordFieldEntries() {
- SignInPage signInPage =
- new BasicWorkFlow().goToHome().clickSignInLink();
- ResetPasswordPage resetPasswordPage = signInPage.goToResetPassword();
- resetPasswordPage =
- resetPasswordPage.enterUserName("b").enterEmail("b");
- resetPasswordPage = resetPasswordPage.resetFailure();
-
- assertThat("Invalid email error is displayed",
- resetPasswordPage.waitForErrors(),
- hasItem("not a well-formed email address"));
-
- // Both are valid, but show seemingly at random
- assertThat(
- resetPasswordPage.getErrors().get(0),
- either(equalTo("size must be between 3 and 20")).or(
- equalTo("must match ^[a-z\\d_]{3,20}$")));
-
- }
-
- @Test
- public void emptyResetPasswordFieldEntries() {
- SignInPage signInPage =
- new BasicWorkFlow().goToHome().clickSignInLink();
- ResetPasswordPage resetPasswordPage = signInPage.goToResetPassword();
- resetPasswordPage = resetPasswordPage.clearFields();
- resetPasswordPage = resetPasswordPage.resetFailure();
-
- assertThat("Empty email error is displayed",
- resetPasswordPage.waitForErrors(), hasItem("may not be empty"));
-
- // All are valid, but may show at random
- assertThat(
- resetPasswordPage.getErrors().get(0),
- either(equalTo("size must be between 3 and 20")).or(
- equalTo("may not be empty")).or(
- equalTo("must match ^[a-z\\d_]{3,20}$")));
-
- }
-
-}
diff --git a/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java
new file mode 100644
index 0000000000..d00cbe34cb
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/feature/security/SecurityTest.java
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2013, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.feature.security;
+
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.subethamail.wiser.WiserMessage;
+import org.zanata.feature.Feature;
+import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
+import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.page.account.ResetPasswordPage;
+import org.zanata.util.AddUsersRule;
+import org.zanata.util.EnsureLogoutRule;
+import org.zanata.util.HasEmailRule;
+import org.zanata.util.RetryRule;
+import org.zanata.workflow.BasicWorkFlow;
+import org.zanata.workflow.LoginWorkFlow;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Damian Jansen djansen@redhat.com
+ */
+@Category(DetailedTest.class)
+public class SecurityTest extends ZanataTestCase {
+
+ @Rule
+ public HasEmailRule hasEmailRule = new HasEmailRule();
+
+ @Rule
+ public EnsureLogoutRule ensureLogoutRule = new EnsureLogoutRule();
+
+ @Rule
+ public AddUsersRule addUsersRule = new AddUsersRule();
+
+ @Feature(summary = "The user can log in",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 86815)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ @Category(BasicAcceptanceTest.class)
+ public void signInSuccessful() {
+ assertThat(new LoginWorkFlow()
+ .signIn("admin", "admin")
+ .loggedInAs())
+ .isEqualTo("admin")
+ .as("User can log in");
+ }
+
+ @Feature(summary = "The user must enter a correct username and " +
+ "password to log in",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 86815)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ @Category(BasicAcceptanceTest.class)
+ public void signInFailure() {
+ assertThat(new LoginWorkFlow()
+ .signInFailure("nosuchuser", "password")
+ .waitForFieldErrors())
+ .contains("Login failed")
+ .as("Log in error message is shown");
+ }
+
+ @Feature(summary = "The user may reset their password via email",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void resetPasswordSuccessful() {
+ ResetPasswordPage resetPasswordPage = new BasicWorkFlow()
+ .goToHome()
+ .clickSignInLink()
+ .goToResetPassword()
+ .enterUserName("admin")
+ .enterEmail("admin@example.com")
+ .resetPassword();
+
+ assertThat(resetPasswordPage.getNotificationMessage())
+ .isEqualTo("You will soon receive an email with a link to " +
+ "reset your password.");
+
+ WiserMessage message = hasEmailRule.getMessages().get(0);
+ String emailContent = HasEmailRule.getEmailContent(message);
+
+ assertThat(message.getEnvelopeReceiver())
+ .isEqualTo("admin@example.com")
+ .as("Zanata has sent an email to the user");
+ assertThat(emailContent)
+ .contains("Please follow the link below to reset the " +
+ "password for your account.")
+ .as("The system has sent a reset password email to the user");
+ }
+
+ @Feature(summary = "The user must enter a known account and email pair " +
+ "to reset their password",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void resetPasswordFailureForInvalidAccount() {
+ ResetPasswordPage resetPasswordPage = new BasicWorkFlow()
+ .goToHome()
+ .clickSignInLink()
+ .goToResetPassword()
+ .enterUserName("nosuchuser")
+ .enterEmail("nosuchuser@nosuchdomain.com")
+ .resetFailure();
+
+ assertThat(resetPasswordPage.getNotificationMessage())
+ .isEqualTo("No such account found")
+ .as("A no such account message is displayed");
+ }
+
+ @Feature(summary = "The user must enter a valid account and email pair " +
+ "to reset their password",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void invalidResetPasswordFieldEntries() {
+ ResetPasswordPage resetPasswordPage = new BasicWorkFlow()
+ .goToHome()
+ .clickSignInLink()
+ .goToResetPassword()
+ .enterUserName("b")
+ .enterEmail("b")
+ .resetFailure();
+
+ assertThat(resetPasswordPage.waitForErrors())
+ .contains("not a well-formed email address")
+ .as("Invalid email error is displayed");
+
+ String error = resetPasswordPage.getErrors().get(0);
+ // Both are valid, but show seemingly at random
+ assertThat(error.equals("size must be between 3 and 20") ||
+ error.equals("must match ^[a-z\\d_]{3,20}$"))
+ .isTrue()
+ .as("Invalid email error is displayed");
+ }
+
+ @Feature(summary = "The user must enter both an account name and email " +
+ "address to reset their password",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 0)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void emptyResetPasswordFieldEntries() {
+ ResetPasswordPage resetPasswordPage = new BasicWorkFlow()
+ .goToHome()
+ .clickSignInLink()
+ .goToResetPassword()
+ .clearFields()
+ .resetFailure();
+
+ assertThat(resetPasswordPage.waitForErrors())
+ .contains("may not be empty")
+ .as("Empty email error is displayed");
+
+ // All are valid, but may show at random
+ String error = resetPasswordPage.getErrors().get(0);
+ assertThat(error.equals("size must be between 3 and 20") ||
+ error.equals("may not be empty") ||
+ error.equals("must match ^[a-z\\d_]{3,20}$"))
+ .as("The regex match for the reset password field has failed");
+ }
+
+}
diff --git a/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java b/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java
index 21c53d1ff0..f382958770 100644
--- a/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java
+++ b/functional-test/src/test/java/org/zanata/feature/testharness/TestPlan.java
@@ -37,7 +37,7 @@
import org.zanata.feature.project.*;
import org.zanata.feature.projectversion.*;
import org.zanata.feature.search.ProjectSearchTest;
-import org.zanata.feature.security.SecurityFullTest;
+import org.zanata.feature.security.SecurityTest;
import org.zanata.feature.versionGroup.*;
/**
@@ -72,11 +72,12 @@
* The actions of an administrator, such as editing users and
* translation memory sets
*/
+ AutoRoleAssignmentTest.class,
EditHomePageTest.class,
EditTranslationMemoryTest.class,
EditTranslationMemoryTest.class,
ManageSearchTest.class,
- ManageUsersFullTest.class,
+ ManageUsersTest.class,
/* Client-Server
* Usage of the mvn client
@@ -166,13 +167,13 @@
* Security
* Login/logout and access rights
*/
- SecurityFullTest.class,
+ SecurityTest.class,
/*
* Version Groups
* Creation and management of Version Groups
*/
- VersionGroupFullTest.class,
+ VersionGroupTest.class,
VersionGroupIDValidationTest.class,
VersionGroupUrlTest.class
})
diff --git a/functional-test/src/test/java/org/zanata/feature/testharness/ZanataTestCase.java b/functional-test/src/test/java/org/zanata/feature/testharness/ZanataTestCase.java
index 59060d8613..1044ef01a3 100644
--- a/functional-test/src/test/java/org/zanata/feature/testharness/ZanataTestCase.java
+++ b/functional-test/src/test/java/org/zanata/feature/testharness/ZanataTestCase.java
@@ -30,7 +30,6 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TestName;
-import org.junit.rules.Timeout;
import org.zanata.util.RetryRule;
/**
@@ -42,8 +41,8 @@
@Slf4j
public class ZanataTestCase {
- /* Maximum five minute test duration */
- private static int MAX_TEST_DURATION = 300000;
+ public final static int MAX_SHORT_TEST_DURATION = 120000;
+ public final static int MAX_LONG_TEST_DURATION = 300000;
@Rule
public RetryRule retryRule = new RetryRule(1);
diff --git a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupFullTest.java b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupFullTest.java
deleted file mode 100644
index 98a1995391..0000000000
--- a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupFullTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2013, Red Hat, Inc. and individual contributors as indicated by the
- * @author tags. See the copyright.txt file in the distribution for a full
- * listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- *
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.zanata.feature.versionGroup;
-
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.zanata.feature.testharness.ZanataTestCase;
-import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
-import org.zanata.feature.testharness.TestPlan.DetailedTest;
-import org.zanata.page.dashboard.DashboardBasePage;
-import org.zanata.page.groups.CreateVersionGroupPage;
-import org.zanata.page.groups.VersionGroupPage;
-import org.zanata.page.groups.VersionGroupsPage;
-import org.zanata.util.SampleProjectRule;
-import org.zanata.workflow.LoginWorkFlow;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-
-/**
- * @author Damian Jansen djansen@redhat.com
- */
-@Category(DetailedTest.class)
-public class VersionGroupFullTest extends ZanataTestCase {
-
- @Rule
- public SampleProjectRule sampleProjectRule = new SampleProjectRule();
- private DashboardBasePage dashboardPage;
-
- @Before
- public void before() {
- dashboardPage = new LoginWorkFlow().signIn("admin", "admin");
- }
-
- @Test
- @Category(BasicAcceptanceTest.class)
- public void createABasicGroup() {
- String groupID = "basic-group";
- String groupName = "A Basic Group";
-
- CreateVersionGroupPage createVersionGroupPage =
- dashboardPage.goToGroups().createNewGroup();
- createVersionGroupPage.inputGroupId(groupID);
- createVersionGroupPage.inputGroupName(groupName);
- createVersionGroupPage
- .inputGroupDescription("A basic group can be saved");
- VersionGroupsPage versionGroupsPage =
- createVersionGroupPage.saveGroup();
- assertThat("Group was created", versionGroupsPage.getGroupNames()
- .contains(groupName));
- VersionGroupPage groupView = versionGroupsPage.goToGroup(groupName);
- assertThat("The group is displayed", groupView.getTitle(),
- Matchers.equalTo("Groups - ".concat(groupName)));
- }
-
- @Test
- public void requiredFields() {
- String errorMsg = "value is required";
- String groupID = "verifyRequiredFieldsGroupID";
- String groupName = "verifyRequiredFieldsGroupName";
-
- CreateVersionGroupPage groupPage =
- dashboardPage.goToGroups().createNewGroup().saveGroupFailure();
- assertThat("The two errors are value is required",
- groupPage.getFieldValidationErrors(), Matchers.contains(errorMsg, errorMsg));
-
- groupPage =
- groupPage.clearFields().inputGroupName(groupName)
- .saveGroupFailure();
- assertThat("The value required error shown", groupPage.getFieldValidationErrors(),
- Matchers.contains(errorMsg));
-
- groupPage =
- groupPage.clearFields().inputGroupId(groupID)
- .saveGroupFailure();
- assertThat("The value required error shown", groupPage.getFieldValidationErrors(),
- Matchers.contains(errorMsg));
- }
-
- @Test
- public void groupIDFieldSize() {
- String groupID = "abcdefghijklmnopqrstuvwxyzabcdefghijklmn";
- String groupIDExtra = "xyz";
- String groupName = "verifyIDFieldSizeName";
-
- CreateVersionGroupPage groupPage = dashboardPage
- .goToGroups()
- .createNewGroup()
- .inputGroupId(groupID + groupIDExtra)
- .inputGroupName(groupName)
- .saveGroupFailure();
-
- assertThat("User cannot enter more than 40 characters",
- groupPage.getGroupIdValue(),
- Matchers.equalTo(groupID));
- }
-
- @Test
- public void groupDescriptionFieldSize() {
- String errorMsg = "value must be shorter than or equal to 100 characters";
- String groupID = "verifyDescriptionFieldSizeID";
- String groupName = "verifyDescriptionFieldSizeName";
- String groupDescription =
- "This text is to test that the description field takes no more than exactly 100 characters - actually.";
-
- assertThat("Description length is greater than 100 characters",
- groupDescription.length(), Matchers.equalTo(101));
- CreateVersionGroupPage groupPage =
- dashboardPage.goToGroups().createNewGroup();
- groupPage.inputGroupId(groupID).inputGroupName(groupName)
- .inputGroupDescription(groupDescription);
- groupPage.saveGroupFailure();
- assertThat("Invalid length error is shown",
- groupPage.getFieldValidationErrors(),
- Matchers.contains(errorMsg));
-
- groupPage.clearFields();
- groupDescription = groupDescription.substring(0, 100);
- assertThat("Description length is now 100 characters",
- groupDescription.length(), Matchers.equalTo(100));
- groupPage.inputGroupId("verifyDescriptionFieldSizeID").inputGroupName(
- groupName);
- VersionGroupsPage verGroupsPage =
- groupPage.inputGroupDescription(groupDescription).saveGroup();
- assertThat("A group description of 100 chars is valid",
- verGroupsPage.getGroupNames(), Matchers.hasItem(groupName));
-
- }
-
- @Test
- public void addANewProjectVersionToAnEmptyGroup()
- throws InterruptedException {
- String groupID = "add-version-to-empty-group";
- String groupName = "AddVersionToEmptyGroup";
- VersionGroupPage versionGroupPage = dashboardPage
- .goToGroups()
- .createNewGroup()
- .inputGroupId(groupID)
- .inputGroupName(groupName)
- .saveGroup()
- .goToGroup(groupName)
- .clickProjectsTab()
- .clickAddProjectVersionsButton();
-
- versionGroupPage = versionGroupPage
- .enterProjectVersion("about-fedora")
- .selectProjectVersion("about-fedora master")
- .clickProjectsTab();
-
- assertThat("The version group shows in the list",
- versionGroupPage.getProjectVersionsInGroup(),
- Matchers.hasItem("about fedora\nmaster"));
-
- }
-
-}
diff --git a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupIDValidationTest.java b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupIDValidationTest.java
index cb7b92ecdc..f16ea66bb0 100644
--- a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupIDValidationTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupIDValidationTest.java
@@ -20,15 +20,15 @@
*/
package org.zanata.feature.versionGroup;
-import static org.hamcrest.MatcherAssert.assertThat;
+import static org.assertj.core.api.Assertions.assertThat;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.experimental.categories.Category;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
+import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.zanata.feature.testharness.ZanataTestCase;
import org.zanata.feature.testharness.TestPlan.DetailedTest;
@@ -44,6 +44,9 @@
@Category(DetailedTest.class)
public class VersionGroupIDValidationTest extends ZanataTestCase {
+ @Rule
+ public Timeout timeout = new Timeout(ZanataTestCase.MAX_LONG_TEST_DURATION);
+
@Rule
public AddUsersRule addUsersRule = new AddUsersRule();
@@ -107,10 +110,6 @@ public void goToGroupPage() {
@Theory
public void inputValidationForID(String inputText) {
- String errorMsg =
- "must start and end with letter or number, and "
- + "contain only letters, numbers, underscores and hyphens.";
-
// Yes reassign groupPage is necessary since JSF re-renders itself after
// each field input and selenium is not happy with it
groupPage = groupPage
@@ -119,7 +118,8 @@ public void inputValidationForID(String inputText) {
.inputGroupName(inputText)
.saveGroupFailure();
- assertThat("Validation error is displayed for input:" + inputText,
- groupPage.getFieldErrors(), Matchers.hasItem(errorMsg));
+ assertThat(groupPage.getFieldErrors())
+ .contains(CreateVersionGroupPage.VALIDATION_ERROR)
+ .as("Validation error is displayed for input:" + inputText);
}
}
diff --git a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupTest.java b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupTest.java
new file mode 100644
index 0000000000..579ae4a1e4
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupTest.java
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2013, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.feature.versionGroup;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.zanata.feature.Feature;
+import org.zanata.feature.testharness.ZanataTestCase;
+import org.zanata.feature.testharness.TestPlan.BasicAcceptanceTest;
+import org.zanata.feature.testharness.TestPlan.DetailedTest;
+import org.zanata.page.dashboard.DashboardBasePage;
+import org.zanata.page.groups.CreateVersionGroupPage;
+import org.zanata.page.groups.VersionGroupPage;
+import org.zanata.page.groups.VersionGroupsPage;
+import org.zanata.util.SampleProjectRule;
+import org.zanata.workflow.LoginWorkFlow;
+import static org.zanata.util.FunctionalTestHelper.assumeTrue;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * @author Damian Jansen djansen@redhat.com
+ */
+@Category(DetailedTest.class)
+public class VersionGroupTest extends ZanataTestCase {
+
+ @Rule
+ public SampleProjectRule sampleProjectRule = new SampleProjectRule();
+ private DashboardBasePage dashboardPage;
+
+ @Before
+ public void before() {
+ dashboardPage = new LoginWorkFlow().signIn("admin", "admin");
+ }
+
+ @Feature(summary = "The administrator can create a basic group",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 170109)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ @Category(BasicAcceptanceTest.class)
+ public void createABasicGroup() throws Exception {
+ String groupID = "basic-group";
+ String groupName = "A Basic Group";
+ VersionGroupsPage versionGroupsPage = dashboardPage
+ .goToGroups()
+ .createNewGroup()
+ .inputGroupId(groupID)
+ .inputGroupName(groupName)
+ .inputGroupDescription("A basic group can be saved")
+ .saveGroup();
+ assertThat(versionGroupsPage.getGroupNames())
+ .contains(groupName)
+ .as("The version group was created");
+ VersionGroupPage groupView = versionGroupsPage.goToGroup(groupName);
+ assertThat(groupView.getTitle())
+ .isEqualTo("Groups - ".concat(groupName))
+ .as("The group is displayed");
+ }
+
+ @Feature(summary = "The administrator must fill in the required fields " +
+ "to create a group",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 170109)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void requiredFields() throws Exception {
+ String errorMsg = "value is required";
+ String groupID = "verifyRequiredFieldsGroupID";
+ String groupName = "verifyRequiredFieldsGroupName";
+
+ CreateVersionGroupPage groupPage = dashboardPage
+ .goToGroups()
+ .createNewGroup()
+ .saveGroupFailure();
+
+ assertThat(groupPage.getFieldValidationErrors())
+ .contains(errorMsg, errorMsg)
+ .as("The two errors are value is required");
+
+ groupPage = groupPage.clearFields()
+ .inputGroupName(groupName)
+ .saveGroupFailure();
+
+ assertThat(groupPage.getFieldValidationErrors())
+ .contains(errorMsg)
+ .as("The value required error shown");
+
+ groupPage = groupPage.clearFields()
+ .inputGroupId(groupID)
+ .saveGroupFailure();
+
+ assertThat(groupPage.getFieldValidationErrors())
+ .contains(errorMsg)
+ .as("The value required error shown");
+ }
+
+ @Feature(summary = "The administrator must enter valid data into the " +
+ "required fields to create a group",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 170109)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void groupDescriptionFieldSize() throws Exception {
+ String groupID = "verifyDescriptionFieldSizeID";
+ String groupName = "verifyDescriptionFieldSizeName";
+ String groupDescription ="This text is to test that the description " +
+ "field takes no more than exactly 100 characters - actually.";
+
+ assumeTrue("Description length is greater than 100 characters",
+ groupDescription.length() == 101);
+
+ CreateVersionGroupPage groupPage = dashboardPage
+ .goToGroups()
+ .createNewGroup()
+ .inputGroupId(groupID)
+ .inputGroupName(groupName)
+ .inputGroupDescription(groupDescription)
+ .saveGroupFailure();
+
+ assertThat(groupPage.getFieldValidationErrors())
+ .contains(CreateVersionGroupPage.LENGTH_ERROR)
+ .as("Invalid length error is shown");
+
+ groupDescription = groupDescription.substring(0, 100);
+ VersionGroupsPage verGroupsPage = groupPage
+ .clearFields()
+ .inputGroupId("verifyDescriptionFieldSizeID")
+ .inputGroupName(groupName)
+ .inputGroupDescription(groupDescription)
+ .saveGroup();
+
+ assertThat(verGroupsPage.getGroupNames())
+ .contains(groupName)
+ .as("A group description of 100 chars is valid");
+ }
+
+ @Feature(summary = "The administrator can add a project version to " +
+ "a newly created group",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 170109)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void addANewProjectVersionToAnEmptyGroup() throws Exception {
+ String groupID = "add-version-to-empty-group";
+ String groupName = "AddVersionToEmptyGroup";
+ VersionGroupPage versionGroupPage = dashboardPage
+ .goToGroups()
+ .createNewGroup()
+ .inputGroupId(groupID)
+ .inputGroupName(groupName)
+ .saveGroup()
+ .goToGroup(groupName)
+ .clickProjectsTab()
+ .clickAddProjectVersionsButton()
+ .enterProjectVersion("about-fedora")
+ .selectProjectVersion("about-fedora master")
+ .clickProjectsTab();
+
+ assertThat(versionGroupPage.getProjectVersionsInGroup())
+ .contains("about fedora\nmaster")
+ .as("The version group shows in the list");
+ }
+
+ @Feature(summary = "The administrator can use numbers, letters, periods, " +
+ "underscores and hyphens to create a group",
+ tcmsTestPlanIds = 5316, tcmsTestCaseIds = 396261)
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
+ public void groupIdCharactersAreAcceptable() throws Exception {
+ String groupID = "test-_.1";
+ String groupName = "TestValidIdCharacters";
+ VersionGroupPage versionGroupPage = dashboardPage
+ .goToGroups()
+ .createNewGroup()
+ .inputGroupId(groupID)
+ .inputGroupName(groupName)
+ .saveGroup()
+ .goToGroup(groupName);
+
+ assertThat(versionGroupPage.getGroupName())
+ .isEqualTo(groupName)
+ .as("The group was created");
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupUrlTest.java b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupUrlTest.java
index 067dc6231f..baa96dd02a 100644
--- a/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupUrlTest.java
+++ b/functional-test/src/test/java/org/zanata/feature/versionGroup/VersionGroupUrlTest.java
@@ -64,7 +64,7 @@ public void setUp() {
dashboardPage = new LoginWorkFlow().signIn("admin", "admin");
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void testUrlChangeUpdatesActiveElements() {
VersionGroupPage versionGroupPage = createVersionGroup();
testBasicGroupUrl(versionGroupPage);
@@ -74,7 +74,7 @@ private void testBasicGroupUrl(VersionGroupPage versionGroupPage) {
assertThat(versionGroupPage.isLanguagesTabActive(), is(true));
}
- @Test
+ @Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void testTabClicksChangeUrl() {
VersionGroupPage versionGroupPage = createVersionGroup();
diff --git a/functional-test/src/test/java/org/zanata/util/AddUsersRule.java b/functional-test/src/test/java/org/zanata/util/AddUsersRule.java
index 6abbccc77b..c534a57a99 100644
--- a/functional-test/src/test/java/org/zanata/util/AddUsersRule.java
+++ b/functional-test/src/test/java/org/zanata/util/AddUsersRule.java
@@ -23,9 +23,7 @@ protected void before() throws Exception {
deleteExceptEssentialData();
makeSampleUsers();
makeSampleLanguages();
- userJoinsLanguageTeam("translator",
- Sets.newHashSet(LocaleId.FR, new LocaleId("hi"),
- new LocaleId("pl")));
+ userJoinsLanguageTeam("translator", "fr,hi,pl");
}
@Override
diff --git a/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java b/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java
new file mode 100644
index 0000000000..ab92d4e635
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/util/EnsureLogoutRule.java
@@ -0,0 +1,39 @@
+package org.zanata.util;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+import org.zanata.page.utility.HomePage;
+import org.zanata.workflow.BasicWorkFlow;
+
+/**
+ * A test rule that will ensure tests have a clean browser session before and
+ * after.
+ *
+ * @author Patrick Huang pahuang@redhat.com
+ */
+public class EnsureLogoutRule implements TestRule {
+ @Override
+ public Statement apply(final Statement base, Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ logoutIfLoggedIn();
+ try {
+ base.evaluate();
+ } finally {
+ logoutIfLoggedIn();
+ }
+ }
+ };
+ }
+
+ private static HomePage logoutIfLoggedIn() {
+ HomePage homePage = new BasicWorkFlow().goToHome();
+ if (homePage.hasLoggedIn()) {
+ homePage.logout();
+ }
+ return homePage;
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/util/FeatureEntry.java b/functional-test/src/test/java/org/zanata/util/FeatureEntry.java
new file mode 100644
index 0000000000..019f603048
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/util/FeatureEntry.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2014, Red Hat, Inc. and individual contributors as indicated by the
+ * @author tags. See the copyright.txt file in the distribution for a full
+ * listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.zanata.util;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.zanata.feature.Feature;
+
+import com.google.common.primitives.Ints;
+
+/**
+ * This object will be converted to JSON.
+ * @see org.zanata.util.FeatureInventoryRecorder
+ *
+ * @author Patrick Huang pahuang@redhat.com
+ */
+@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY,
+ getterVisibility = JsonAutoDetect.Visibility.NONE,
+ setterVisibility = JsonAutoDetect.Visibility.NONE)
+public class FeatureEntry {
+ private String testName;
+ private String category;
+ private String summary;
+ private String testResult;
+ private int bugzilla;
+ private List testIds;
+ private List planIds;
+
+ @SuppressWarnings("unused")
+ FeatureEntry() {
+ // used by JSON serializer/deserializer
+ }
+
+ public FeatureEntry(Feature feature, String displayName,
+ TestResult result) {
+ testName = displayName;
+ category = getLastPackageName(displayName);
+ summary = feature.summary();
+ bugzilla = feature.bugzilla();
+ testIds = toList(feature.tcmsTestCaseIds());
+ planIds = toList(feature.tcmsTestPlanIds());
+ testResult = result.name();
+ }
+
+ private static List toList(int[] ints) {
+ if (ints == null) {
+ return Collections.emptyList();
+ }
+ return Ints.asList(ints);
+ }
+
+ /**
+ * quick and dirty way to generate category. Currently it assumes last
+ * package name is category. i.e. if the test name is
+ * changePasswordAreOfRequiredLength
+ * (org.zanata.feature.account.ChangePasswordTest), the category will be
+ * considered as account.
+ *
+ * @param testDisplayName
+ * JUnit test display name
+ * @return category name
+ */
+ private static String getLastPackageName(String testDisplayName) {
+ try {
+ int lastDot = testDisplayName.lastIndexOf(".");
+ String strippedClassName = testDisplayName.substring(0, lastDot);
+ int secondLastDot = strippedClassName.lastIndexOf(".");
+ String lastPackageName = strippedClassName
+ .substring(secondLastDot + 1, strippedClassName.length());
+ return lastPackageName;
+ } catch (Exception e) {
+ // in case something goes wrong
+ return "None";
+ }
+ }
+
+ public static enum TestResult {
+ Passed, Failed, Ignored
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java b/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java
new file mode 100644
index 0000000000..3e98bc2d43
--- /dev/null
+++ b/functional-test/src/test/java/org/zanata/util/FeatureInventoryRecorder.java
@@ -0,0 +1,124 @@
+package org.zanata.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.junit.runner.Description;
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+import org.junit.runner.notification.RunListener;
+import org.zanata.feature.Feature;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
+
+/**
+ * @author Patrick Huang pahuang@redhat.com
+ */
+public class FeatureInventoryRecorder extends RunListener {
+
+ private boolean fileReport;
+ private ThreadLocal currentFeature = new ThreadLocal();
+ private File report;
+ private ObjectMapper objectMapper = new ObjectMapper();
+ private List entries = Lists.newArrayList();
+
+ @Override
+ public void testRunStarted(Description description) throws Exception {
+ super.testRunStarted(description);
+ String locationPath =
+ System.getProperty("featureInventoryLocation",
+ "./target/feature-inventory");
+ File location = new File(locationPath);
+ report = new File(location, "features.json");
+ location.mkdirs();
+ fileReport = report.createNewFile();
+ }
+
+ @Override
+ public void testRunFinished(Result result) throws Exception {
+ super.testRunFinished(result);
+ objectMapper.writerWithDefaultPrettyPrinter()
+ .writeValue(report, entries);
+ }
+
+ @Override
+ public void testStarted(Description description) throws Exception {
+ super.testStarted(description);
+ Optional featureOptional = getFeature(description);
+ if (featureOptional.isPresent()) {
+ currentFeature.set(featureOptional.get());
+ }
+ }
+
+ /**
+ * annotation on method takes precedence over annotation on class. At the
+ * moment class level annotation will cause multiple entries in the result
+ * if there are more than one test methods.
+ */
+ private static Optional getFeature(Description description) {
+ Feature testClassFeature =
+ description.getTestClass().getAnnotation(Feature.class);
+ Feature testMethodFeature = description.getAnnotation(Feature.class);
+ return Optional.fromNullable(testMethodFeature).or(
+ Optional.fromNullable(testClassFeature));
+ }
+
+ @Override
+ public void testFinished(Description description) throws Exception {
+ super.testFinished(description);
+ reportFeature(FeatureEntry.TestResult.Passed,
+ description.getDisplayName());
+ }
+
+ @Override
+ public void testFailure(Failure failure) throws Exception {
+ super.testFailure(failure);
+ reportFeature(FeatureEntry.TestResult.Failed, failure
+ .getDescription()
+ .getDisplayName());
+ }
+
+ @Override
+ public void testIgnored(Description description) throws Exception {
+ super.testIgnored(description);
+ Optional featureOptional = getFeature(description);
+ if (featureOptional.isPresent()) {
+ currentFeature.set(featureOptional.get());
+ }
+ reportFeature(FeatureEntry.TestResult.Ignored,
+ description.getDisplayName());
+ }
+
+ private void reportFeature(FeatureEntry.TestResult result,
+ String displayName) {
+ if (currentFeature.get() == null) {
+ return;
+ }
+ Feature feature = currentFeature.get();
+ FeatureEntry entry = new FeatureEntry(feature, displayName, result);
+ if (fileReport) {
+ entries.add(entry);
+
+ } else {
+ // display to console
+ try {
+ Object json =
+ objectMapper.readValue(
+ objectMapper.writeValueAsString(entry),
+ FeatureEntry.class);
+ System.out.println(objectMapper
+ .writerWithDefaultPrettyPrinter()
+ .writeValueAsString(json));
+ } catch (IOException e) {
+ System.out.println("Error writing as JSON");
+ e.printStackTrace();
+ }
+
+ }
+ currentFeature.remove();
+ }
+}
diff --git a/functional-test/src/test/java/org/zanata/util/HasEmailRule.java b/functional-test/src/test/java/org/zanata/util/HasEmailRule.java
index 3605f51a74..b4792bd2ef 100644
--- a/functional-test/src/test/java/org/zanata/util/HasEmailRule.java
+++ b/functional-test/src/test/java/org/zanata/util/HasEmailRule.java
@@ -32,6 +32,7 @@ public void evaluate() throws Throwable {
try {
base.evaluate();
} finally {
+ wiser.getMessages().clear();
wiser.stop();
}
}
diff --git a/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java b/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java
index 4676830f73..4d0eee3b7c 100644
--- a/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java
+++ b/functional-test/src/test/java/org/zanata/util/SampleDataResourceClient.java
@@ -44,12 +44,18 @@ public static void makeSampleUsers() throws Exception {
checkAndReleaseConnection(createRequest("/users").put());
}
+ /**
+ * @param username
+ * username to join language team
+ * @param localesCSV
+ * locale ids separated by comma
+ */
public static void userJoinsLanguageTeam(String username,
- Set locales) throws Exception {
+ String localesCSV) throws Exception {
ClientRequest request =
createRequest("/accounts/u/" + username + "/languages");
- checkAndReleaseConnection(request.queryParameter("locales", locales)
+ checkAndReleaseConnection(request.queryParameter("locales", localesCSV)
.put());
}
diff --git a/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java b/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java
index acd5f328ee..a7c03f03c6 100644
--- a/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java
+++ b/functional-test/src/test/java/org/zanata/util/SampleProjectRule.java
@@ -42,9 +42,7 @@ public void before() throws Throwable {
deleteExceptEssentialData();
makeSampleUsers();
makeSampleLanguages();
- Set locales =
- Sets.newHashSet(LocaleId.FR, new LocaleId("hi"),
- new LocaleId("pl"));
+ String locales = "fr,hi,pl";
userJoinsLanguageTeam("translator", locales);
userJoinsLanguageTeam("glossarist", locales);
makeSampleProject();
diff --git a/functional-test/src/test/resources/conf/standalone.xml b/functional-test/src/test/resources/conf/standalone.xml
index 46e6a92db4..497e138b1b 100644
--- a/functional-test/src/test/resources/conf/standalone.xml
+++ b/functional-test/src/test/resources/conf/standalone.xml
@@ -23,7 +23,7 @@
-
+
@@ -329,7 +329,7 @@
-
+
diff --git a/functional-test/src/test/resources/feature-inventory/app.js b/functional-test/src/test/resources/feature-inventory/app.js
new file mode 100644
index 0000000000..14625f74a9
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/app.js
@@ -0,0 +1,21 @@
+var featureApp = angular.module('featureApp', [
+ 'ngRoute',
+ 'featureControllers',
+ 'featureFilters'
+]);
+
+featureApp.config(['$routeProvider',
+ function($routeProvider) {
+ $routeProvider.
+ when('/features', {
+ templateUrl: 'partials/list.html',
+ controller: 'FeatureListCtrl'
+ }).
+ when('/features/:testName', {
+ templateUrl: 'partials/detail.html',
+ controller: 'FeatureDetailCtrl'
+ }).
+ otherwise({
+ redirectTo: '/features'
+ });
+ }]);
diff --git a/functional-test/src/test/resources/feature-inventory/controllers.js b/functional-test/src/test/resources/feature-inventory/controllers.js
new file mode 100644
index 0000000000..0b3c161784
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/controllers.js
@@ -0,0 +1,30 @@
+var featureControllers = angular.module('featureControllers', []);
+
+var FeatureListCtrl = function($scope, $http, $location, $filter) {
+ $http.get('features.json').success(function(data) {
+ $scope.features = data;
+ });
+
+ $scope.orderProp = 'category';
+ $scope.featureDetail = function(index) {
+ $location.path("/features/" + index);
+ };
+};
+
+var FeatureDetailCtrl = function($scope, $http, $routeParams, filterFilter) {
+ $http.get('features.json').success(function(data) {
+ var filtered = filterFilter(data, {testName: $routeParams.testName});
+ if (filtered.length == 1) {
+ $scope.feature = filtered[0];
+ } else {
+ $scope.warning =
+ "Something wrong with the URL. Can't find test name in features.";
+ }
+ });
+};
+
+featureControllers.controller('FeatureListCtrl', [ '$scope', '$http',
+ '$location', '$filter', FeatureListCtrl ]);
+
+featureControllers.controller('FeatureDetailCtrl', [ '$scope', '$http',
+ '$routeParams', 'filterFilter', FeatureDetailCtrl ]);
diff --git a/functional-test/src/test/resources/feature-inventory/filter.js b/functional-test/src/test/resources/feature-inventory/filter.js
new file mode 100644
index 0000000000..e989cd7561
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/filter.js
@@ -0,0 +1,12 @@
+var resultStyle = function () {
+ return function(result) {
+ if (result == 'Passed') {
+ return "label--success";
+ } else if (result == 'Ignored') {
+ return "label--unsure";
+ } else {
+ return "label--danger";
+ }
+ };
+};
+angular.module('featureFilters', []).filter('resultStyle', resultStyle);
\ No newline at end of file
diff --git a/functional-test/src/test/resources/feature-inventory/index.html b/functional-test/src/test/resources/feature-inventory/index.html
new file mode 100644
index 0000000000..ec3063f7d3
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/index.html
@@ -0,0 +1,18 @@
+
+
+ Zanata Features
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/functional-test/src/test/resources/feature-inventory/partials/detail.html b/functional-test/src/test/resources/feature-inventory/partials/detail.html
new file mode 100644
index 0000000000..0ef919e806
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/partials/detail.html
@@ -0,0 +1,18 @@
+
diff --git a/functional-test/src/test/resources/feature-inventory/partials/list.html b/functional-test/src/test/resources/feature-inventory/partials/list.html
new file mode 100644
index 0000000000..1cc1e424d1
--- /dev/null
+++ b/functional-test/src/test/resources/feature-inventory/partials/list.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/functional-test/src/test/resources/test-tmx.xml b/functional-test/src/test/resources/test-tmx.xml
new file mode 100644
index 0000000000..21c5650218
--- /dev/null
+++ b/functional-test/src/test/resources/test-tmx.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ Fedora is an open, innovative, forward looking operating system and platform, based on Linux, that is always free for anyone to use, modify and distribute, now and forever. It is developed by a large community of people who strive to provide and maintain the very best in free, open source software and standards. Fedora is part of the Fedora Project, sponsored by Red Hat, Inc.
+
+
+ This is a TM Import Test
+
+
+
+
diff --git a/pom.xml b/pom.xml
index d2ab13b5c7..9f55b7362a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,13 +2,13 @@
4.0.0
server
- 3.4.3-SNAPSHOT
+ 3.5.0-SNAPSHOT
Zanata server modules
pom
org.zanata
zanata-parent
- 19
+ 20-SNAPSHOT
../parent
@@ -16,34 +16,40 @@
scm:git:git://github.com/zanata/zanata-server.git
scm:git:git@github.com:zanata/zanata-server.git
https://github.com/zanata/zanata-server
- HEAD
+ 2.1.2
50
30
false
${project.build.directory}/delombok/org/zanata
- 2.5.0
- 4.8
+ 14.0.1
+ 2.5.1
+ 50.1.1
${project.build.sourceDirectory}/org/zanata
3.6.2
2.3.1.Final
1.2.1
0.22
- 3.3.1
+ 3.4.0-SNAPSHOT
- 3.3.0
+ 3.3.1
3.3.1
3.3.0
4.3.4.Final
+ 2.0.0-alpha-5
provided
- 4.2.7.SP1
+
+ 4.2.8.Final
compile
org.jboss.resteasy
@@ -112,7 +132,16 @@
pom
+
+ org.jboss.as
+ jboss-as-parent
+ ${jboss.as.version}
+ pom
+ import
+
+
org.jboss.seam
bom
@@ -122,11 +151,39 @@
- org.jboss.as
- jboss-as-parent
- ${jboss.as.version}
- pom
- import
+ commons-beanutils
+ commons-beanutils
+ 1.9.2
+
+
+ commons-logging
+ commons-logging
+
+
+
+
+
+ org.apache.httpcomponents
+ httpcore
+ 4.2.3
+
+
+
+ org.apache.maven
+ maven-aether-provider
+ 3.0.5
+
+
+
+ org.apache.maven.wagon
+ wagon-provider-api
+ 2.4
+
+
+
+ org.apache.maven.wagon
+ wagon-http-lightweight
+ 2.4
@@ -136,6 +193,78 @@
test
+
+ org.jboss.byteman
+ byteman
+ ${byteman.version}
+
+
+
+ org.jboss.byteman
+ byteman-bmunit
+ ${byteman.version}
+
+
+
+ org.jboss.byteman
+ byteman-install
+ ${byteman.version}
+
+
+
+ org.jboss.byteman
+ byteman-submit
+ ${byteman.version}
+
+
+
+ org.jboss.com.sun.httpserver
+ httpserver
+ 1.0.1.Final
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-api-base
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-api-javaee
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-api-jboss
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-impl-base
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-impl-javaee
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-impl-jboss
+ ${shrinkwrap.desc.version}
+
+
+
+ org.jboss.shrinkwrap.descriptors
+ shrinkwrap-descriptors-spi
+ ${shrinkwrap.desc.version}
+
+
org.opensymphony.quartz
quartz
@@ -147,6 +276,16 @@
org.zanata
zanata-common-api
${zanata.api.version}
+
+
+ javax.servlet
+ servlet-api
+
+
+ javax.annotation
+ jsr250-api
+
+
@@ -172,6 +311,17 @@
zanata-rest-client
${zanata.client.version}
test
+
+
+
+ org.jboss.resteasy
+ resteasy-jaxrs
+
+
+ org.jboss.resteasy
+ jaxrs-api
+
+