com.atlassian.crowd.acceptance.tests
Class ApplicationAcceptanceTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sourceforge.jwebunit.junit.WebTestCase
              extended by com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
                  extended by com.atlassian.crowd.acceptance.tests.ApplicationAcceptanceTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
CrowdIDClientAcceptanceTestCase, CrowdIDServerAcceptanceTestCase, DemoAcceptanceTestCase

public abstract class ApplicationAcceptanceTestCase
extends CrowdWebTestCase

Generic ApplicationAcceptanceTestCase base class for all web acceptance tests. This class loads up the required properties from localtest.properties.


Field Summary
protected static String ADMIN_PW
           
protected  String baseUrl
           
protected static String CROWD_ADMIN_EMAIL_ADDRESS
           
protected static String CROWD_ADMIN_FULLNAME
           
protected static String CROWD_ADMIN_USER
           
protected static String CROWD_ADMINISTRATORS_GROUP
           
protected  String crowdBaseUrl
           
protected  CrowdAcceptanceTestCase crowdConsole
           
protected  String crowdResourceBundle
           
protected  Properties specProperties
           
 
Fields inherited from class net.sourceforge.jwebunit.junit.WebTestCase
customTester, tester
 
Constructor Summary
ApplicationAcceptanceTestCase()
           
 
Method Summary
protected abstract  String getApplicationName()
           
 String getBaseUrl()
           
 String getCrowdHome()
           
protected  String getCurrentlyLoggedInCrowdUserFullName()
           
protected abstract  String getLocalTestPropertiesFileName()
           
protected abstract  String getResourceBundleName()
           
protected  String getTestProperty(String propName)
           
 void intendToModifyData()
           
protected  void loginToCrowd()
           
protected  String loginToCrowd(String username, String password)
          Login to the Crowd Console.
protected  void logoutFromCrowd()
           
 void restoreBaseSetup()
           
 void restoreCrowdFromXML(String xmlFilename)
           
protected  void setUp()
           
protected  void tearDown()
           
protected  void useApp()
           
protected  void useCrowd()
           
protected  void verifyGroupDoesNotExistInCrowd(String groupName)
           
protected  void verifyGroupDoesNotExistInCrowdWithCaseSensitiveName(String groupName)
          Either the group doesn't exist or its name has a different case.
protected  void verifyGroupExistsInCrowd(String groupName, String... memberNames)
           
protected  void verifyUserDoesNotExistInCrowd(String username, String firstname, String lastname, String email, String... groupNames)
           
protected  void verifyUserExistsInCrowd(String username, String firstname, String lastname, String email, String... groupNames)
           
 
Methods inherited from class com.atlassian.crowd.acceptance.utils.CrowdWebTestCase
addRequestHeader, assertErrorNotPresent, assertErrorPresent, assertErrorPresentWithKey, assertKeyInElement, assertKeyPresent, assertKeyPresent, assertKeyPresent, assertKeyPresentOnce, assertLinkPresentWithKey, assertServerResponseContains, assertServerResponseDoesNotContain, assertSuccessPresent, assertTextPresent, assertWarningAndErrorNotPresent, assertWarningNotPresent, assertWarningPresent, clickLinkWithKey, getElementTextById, getPageText, isTextPresent, log, scrapeTable, scrapeTable, setRadioButton, setTester, waitFor, waitForElementById, waitForElementByXPath, waitForText, waitForText
 
Methods inherited from class net.sourceforge.jwebunit.junit.WebTestCase
assertButtonNotPresent, assertButtonNotPresentWithText, assertButtonPresent, assertButtonPresentWithText, assertCheckboxNotPresent, assertCheckboxNotPresent, assertCheckboxNotSelected, assertCheckboxNotSelected, assertCheckboxPresent, assertCheckboxPresent, assertCheckboxSelected, assertCheckboxSelected, assertCommentNotPresent, assertCommentPresent, assertCookiePresent, assertCookieValueEquals, assertCookieValueMatch, assertDownloadedFileEquals, assertElementNotPresent, assertElementNotPresentByXPath, assertElementPresent, assertElementPresentByXPath, assertFormElementEmpty, assertFormElementEquals, assertFormElementMatch, assertFormElementNotPresent, assertFormElementPresent, assertFormNotPresent, assertFormNotPresent, assertFormPresent, assertFormPresent, assertFramePresent, assertHeaderEquals, assertHeaderMatches, assertHeaderNotPresent, assertHeaderPresent, assertHiddenFieldPresent, assertImagePresent, assertImagePresentPartial, assertImageValid, assertImageValidAndStore, assertKeyInTable, assertKeyInTable, assertKeyNotInTable, assertKeyNotPresent, assertKeyNotPresent, assertKeyPresent, assertKeysInTable, assertKeysInTable, assertLabeledFieldEquals, assertLabelMatches, assertLabelPresent, assertLinkNotPresent, assertLinkNotPresentWithExactText, assertLinkNotPresentWithExactText, assertLinkNotPresentWithImage, assertLinkNotPresentWithImage, assertLinkNotPresentWithText, assertLinkNotPresentWithText, assertLinkPresent, assertLinkPresentWithExactText, assertLinkPresentWithExactText, assertLinkPresentWithImage, assertLinkPresentWithImage, assertLinkPresentWithText, assertLinkPresentWithText, assertMatch, assertMatch, assertMatch, assertMatchInElement, assertMatchInTable, assertMatchInTable, assertNoMatch, assertNoMatchInElement, assertNoMatchInTable, assertNoMatchInTable, assertNotMatch, assertNotMatch, assertRadioOptionNotPresent, assertRadioOptionNotSelected, assertRadioOptionPresent, assertRadioOptionSelected, assertResetButtonNotPresent, assertResetButtonNotPresent, assertResetButtonPresent, assertResetButtonPresent, assertResponseCode, assertResponseCodeBetween, assertSelectedOptionEquals, assertSelectedOptionEquals, assertSelectedOptionMatches, assertSelectedOptionMatches, assertSelectedOptionsEqual, assertSelectedOptionsEqual, assertSelectedOptionsMatch, assertSelectedOptionsMatch, assertSelectedOptionValueEquals, assertSelectedOptionValueEquals, assertSelectedOptionValuesEqual, assertSelectedOptionValuesEqual, assertSelectOptionNotPresent, assertSelectOptionNotPresent, assertSelectOptionPresent, assertSelectOptionPresent, assertSelectOptionsEqual, assertSelectOptionsEqual, assertSelectOptionsNotEqual, assertSelectOptionsNotEqual, assertSelectOptionsPresent, assertSelectOptionsPresent, assertSelectOptionValueNotPresent, assertSelectOptionValueNotPresent, assertSelectOptionValuePresent, assertSelectOptionValuePresent, assertSelectOptionValuesEqual, assertSelectOptionValuesEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesNotEqual, assertSelectOptionValuesPresent, assertSelectOptionValuesPresent, assertSubmitButtonNotPresent, assertSubmitButtonNotPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertSubmitButtonPresent, assertTableEquals, assertTableEquals, assertTableMatch, assertTableMatch, assertTableNotPresent, assertTablePresent, assertTableRowCountEquals, assertTableRowsEqual, assertTableRowsEqual, assertTableRowsMatch, assertTableRowsMatch, assertTextFieldEquals, assertTextInElement, assertTextInTable, assertTextInTable, assertTextNotInElement, assertTextNotInTable, assertTextNotInTable, assertTextNotPresent, assertTextPresent, assertTitleEquals, assertTitleEqualsKey, assertTitleEqualsKey, assertTitleMatch, assertTitleNotEquals, assertTitleNotSame, assertWindowCountEquals, assertWindowPresent, assertWindowPresent, assertWindowPresentWithTitle, beginAt, checkCheckbox, checkCheckbox, clickButton, clickButtonWithText, clickElementByXPath, clickLink, clickLinkWithExactText, clickLinkWithExactText, clickLinkWithImage, clickLinkWithImage, clickLinkWithText, clickLinkWithText, clickRadioOption, closeBrowser, closeWindow, dumpCookies, dumpHtml, dumpHtml, dumpTable, dumpTable, getAllHeaders, getComments, getDialog, getElementAttributByXPath, getElementAttributeByXPath, getElementById, getElementByXPath, getElementsByXPath, getElementTextByXPath, getFieldsForLabel, getFormElementValue, getHeader, getImage, getLabeledFieldValue, getMessage, getMessage, getPageSource, getResponseHeaders, getServerResponse, getServeurResponse, getTable, getTestContext, getTester, getTestingEngine, getTestingEngineKey, gotoFrame, gotoPage, gotoRootWindow, gotoWindow, gotoWindow, gotoWindowByTitle, reset, runBare, saveAs, selectOption, selectOption, selectOptionByValue, selectOptionByValue, selectOptions, selectOptions, selectOptionsByValues, selectOptionsByValues, setBaseUrl, setBaseUrl, setDialog, setExpectedJavaScriptAlert, setExpectedJavaScriptAlert, setExpectedJavaScriptConfirm, setExpectedJavaScriptConfirm, setExpectedJavaScriptPrompt, setExpectedJavaScriptPrompt, setFormElement, setHiddenField, setIgnoreFailingStatusCodes, setLabeledFormElementField, setScriptingEnabled, setTestContext, setTestingEngineKey, setTextField, setTimeout, setWorkingForm, setWorkingForm, setWorkingForm, submit, submit, submit, uncheckCheckbox, uncheckCheckbox
 
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CROWD_ADMIN_USER

protected static final String CROWD_ADMIN_USER
See Also:
Constant Field Values

CROWD_ADMIN_EMAIL_ADDRESS

protected static final String CROWD_ADMIN_EMAIL_ADDRESS
See Also:
Constant Field Values

CROWD_ADMIN_FULLNAME

protected static final String CROWD_ADMIN_FULLNAME
See Also:
Constant Field Values

ADMIN_PW

protected static final String ADMIN_PW
See Also:
Constant Field Values

baseUrl

protected String baseUrl

specProperties

protected Properties specProperties

crowdConsole

protected CrowdAcceptanceTestCase crowdConsole

crowdBaseUrl

protected String crowdBaseUrl

crowdResourceBundle

protected String crowdResourceBundle

CROWD_ADMINISTRATORS_GROUP

protected static final String CROWD_ADMINISTRATORS_GROUP
See Also:
Constant Field Values
Constructor Detail

ApplicationAcceptanceTestCase

public ApplicationAcceptanceTestCase()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class net.sourceforge.jwebunit.junit.WebTestCase
Throws:
Exception

getTestProperty

protected String getTestProperty(String propName)

useCrowd

protected void useCrowd()

useApp

protected void useApp()

restoreBaseSetup

public void restoreBaseSetup()

intendToModifyData

public void intendToModifyData()

restoreCrowdFromXML

public void restoreCrowdFromXML(String xmlFilename)

logoutFromCrowd

protected void logoutFromCrowd()

loginToCrowd

protected void loginToCrowd()

getCrowdHome

public String getCrowdHome()

getResourceBundleName

protected abstract String getResourceBundleName()

getApplicationName

protected abstract String getApplicationName()

getLocalTestPropertiesFileName

protected abstract String getLocalTestPropertiesFileName()

verifyUserExistsInCrowd

protected void verifyUserExistsInCrowd(String username,
                                       String firstname,
                                       String lastname,
                                       String email,
                                       String... groupNames)
                                throws IOException,
                                       CrowdException,
                                       ApplicationPermissionException
Throws:
IOException
CrowdException
ApplicationPermissionException

verifyUserDoesNotExistInCrowd

protected void verifyUserDoesNotExistInCrowd(String username,
                                             String firstname,
                                             String lastname,
                                             String email,
                                             String... groupNames)
                                      throws IOException,
                                             CrowdException,
                                             ApplicationPermissionException
Throws:
IOException
CrowdException
ApplicationPermissionException

verifyGroupExistsInCrowd

protected void verifyGroupExistsInCrowd(String groupName,
                                        String... memberNames)
                                 throws IOException,
                                        CrowdException,
                                        ApplicationPermissionException
Throws:
IOException
CrowdException
ApplicationPermissionException

verifyGroupDoesNotExistInCrowd

protected void verifyGroupDoesNotExistInCrowd(String groupName)
                                       throws IOException,
                                              CrowdException,
                                              ApplicationPermissionException
Throws:
IOException
CrowdException
ApplicationPermissionException

verifyGroupDoesNotExistInCrowdWithCaseSensitiveName

protected void verifyGroupDoesNotExistInCrowdWithCaseSensitiveName(String groupName)
                                                            throws IOException,
                                                                   CrowdException,
                                                                   ApplicationPermissionException
Either the group doesn't exist or its name has a different case.

Throws:
IOException
CrowdException
ApplicationPermissionException

getCurrentlyLoggedInCrowdUserFullName

protected String getCurrentlyLoggedInCrowdUserFullName()

loginToCrowd

protected String loginToCrowd(String username,
                              String password)
Login to the Crowd Console.

Parameters:
username - Crowd Console username.
password - Crowd Console password.
Returns:
full name of the successfully logged in user or null if the authentication failed.

getBaseUrl

public String getBaseUrl()


Copyright © 2013 Atlassian. All Rights Reserved.