Hi all,

I am writing UI test cases for UES/Dashboard Server(DS).I have tried to
write a test class for adding and deleting dashboard for the Dashboard
Server.Here I need to check the resource is existing or not at the
registry.You can have a look for the class[1] I have wrote for adding and
deleting dashboard.
[1] -
https://github.com/rajeenthini/product-ues/commit/e642d50edf08cc21d2b0a2b21463e4b3aadc587a

BTW I have modified my code in some ways .Those are I have included below
- Deleted deleteResource method from here
resourceAdminServiceClient.deleteResource(resourcePath);

@AfterClass(alwaysRun = true)
public void tearDown() throws MalformedURLException,
XPathExpressionException, RemoteException,
ResourceAdminServiceExceptionException {
    try{
        UESUIIntegrationTest.logout(getDriver(), getBaseUrl(),
getCurrentUsername());
    }finally {
        getDriver().quit();
    }
}

- Added some code segment to the method deleteDashboard

@Test(groups = "wso2.ues.dashboard", description = "Deleting added
dashboard", dependsOnMethods = "testAddDashboardNew")
public void testDeleteDashboardNew() throws MalformedURLException,
XPathExpressionException, RemoteException,
ResourceAdminServiceExceptionException {
    webElement = getDriver().findElement(By.id(dashboardTitle));
    webElement.findElement(By.cssSelector("i.fw-delete")).click();
    getDriver().findElement(By.cssSelector("span.ladda-label")).click();
    assertFalse(getDriver().isElementPresent(By.id(dashboardTitle)),
"Error occurred while deleting dashboard" + dashboardTitle);
    ResourceData[] resourceData =
resourceAdminServiceClient.getResourceData(resourcePath);
    assertTrue(resourceData.length == 0,"Registry resource could not
be deleted due to some errors");
}

Now it's giving me exception when there is no such registry resource after
dashboard was deleted by UI testcase.

org.apache.axis2.AxisFault: Resource does not exist at path
/_system/config/ues/dashboards/sampledashboard1

So can anyone give some suggestions on $subject? Thanks in advance.
-- 

*Thank You.*

*Rajeenthini Satkunam*

*Associate Software Engineer | WSO2*


*E:[email protected] <[email protected]>*

*M :+94770832823   *
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to