Created
March 5, 2014 11:06
-
-
Save skleinei/9365235 to your computer and use it in GitHub Desktop.
Install a license in a JWebUnit test case.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this in a com.atlassian.confluence.plugin.functest.AbstractConfluencePluginWebTestCase to install a license in Confluence: | |
static boolean isLicenseInstalled = false; | |
private void installLicense() { | |
if (!isLicenseInstalled) { | |
gotoPage("/admin/license.action"); | |
setWorkingForm("updateLicenseForm"); | |
setTextField("licenseString", LICENSE); | |
submit("update"); | |
String maxUserString = getElementTextByXPath("//table[@class='confluenceTable']//tr[4]/td[2]/strong"); | |
int maxUsers = NumberUtils.toInt(maxUserString, -1); | |
if (maxUsers != 10) { | |
fail("License could not be installed successfully"); | |
} | |
isLicenseInstalled = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment