Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
map project types to option text in functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Jul 5, 2013
1 parent 483bbb0 commit 65689d4
Showing 1 changed file with 16 additions and 1 deletion.
Expand Up @@ -20,6 +20,9 @@
*/
package org.zanata.page.projects;

import java.util.HashMap;
import java.util.Map;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
Expand All @@ -40,6 +43,18 @@ public class CreateVersionPage extends AbstractPage
@FindBy(id = "iterationForm:save")
private WebElement saveButton;

private static final Map<String, String> projectTypeOptions = new HashMap<String, String>();
static
{
projectTypeOptions.put("File", "File. For plain text, LibreOffice, InDesign.");
projectTypeOptions.put("Gettext", "Gettext. For gettext software strings.");
projectTypeOptions.put("Podir", "Podir. For publican/docbook strings.");
projectTypeOptions.put("Properties", "Properties. For Java properties files.");
projectTypeOptions.put("Utf8Properties", "Utf8Properties. For UTF8-encoded Java properties.");
projectTypeOptions.put("Xliff", "Xliff. For supported XLIFF files.");
projectTypeOptions.put("Xml", "Xml. For XML from the Zanata REST API.");
}

public CreateVersionPage(final WebDriver driver)
{
super(driver);
Expand All @@ -53,7 +68,7 @@ public CreateVersionPage inputVersionId(String versionId)

public CreateVersionPage selectProjectType(String projectType)
{
new Select(projectTypeSelection).selectByVisibleText(projectType);
new Select(projectTypeSelection).selectByVisibleText(projectTypeOptions.get(projectType));
return this;
}

Expand Down

0 comments on commit 65689d4

Please sign in to comment.