Package com.ibm.sbt.automation.core.test.pageobjects

Examples of com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage


    deleteActivity(activity.getActivityUuid());
  }

    @Test
    public void testGetCompletedActivities() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        // TODO create some activities
        //Assert.assertFalse("Get my activities returned no activities", jsonList.isEmpty());
    }
View Full Code Here


   
    static final String SNIPPET_ID = "Social_Profiles_API_ProfileFeedDataHandler";

    @Test
    public void testProfileFeedDataHandler() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertEquals(4, jsonList.size());
        JsonJavaObject json = (JsonJavaObject)jsonList.get(0);
        // TODO validate values
    }
View Full Code Here

    @Test
    public void testDeleteCommunityInvalidArg() {
        setAuthType(AuthType.NONE);
        addSnippetParam("CommunityService.communityUuid2", "");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(400, json.getInt("code"));
        Assert.assertEquals("Invalid argument, expected communityUuid.", json.getString("message"));
    }
View Full Code Here

   
    static final String SNIPPET_ID = "Social_Profiles_API_GetPeopleManaged";

    @Test
    public void testGetPeopleManaged() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertTrue(jsonList.size() > 0);
    }
View Full Code Here

 
    @Test
    public void DeleteProfileWithMissingArguments() {       
      addSnippetParam("sample.createProfileId", "");           
     
      JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();       
        Assert.assertEquals(400, json.getInt("code"));      
    }
View Full Code Here

    public void testCommunity() {
        AuthType authType = getEnvironment().isSmartCloud() ? AuthType.AUTO_DETECT : AuthType.NONE;
        setAuthType(authType);
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
       
        List jsonList = previewPage.getJsonList();
        for (int i=0; i<jsonList.size(); i++) {
            assertCommunityValid((JsonJavaObject)jsonList.get(i));
        }
    }
View Full Code Here

      }
        addMember(community, id, "member");
             
      addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
     
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertFalse("Get community members returned no members", jsonList.isEmpty());
        Assert.assertEquals(2, jsonList.size());
        assertMemberValid((JsonJavaObject)jsonList.get(0), community.getCommunityUuid(),
            name1, userid1, email1, "owner");
        assertMemberValid((JsonJavaObject)jsonList.get(1), community.getCommunityUuid(),
View Full Code Here

       
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", updatedTitle);
        addSnippetParam("sample.communityContent", updatedContent);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        Assert.assertEquals(community.getCommunityUuid(), json.getString("getCommunityUuid"));
        Assert.assertEquals(updatedTitle, json.getString("getTitle"));
        Assert.assertEquals(updatedContent, json.getString("getContent"));
View Full Code Here

       
        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", duplicateTitle);
        addSnippetParam("sample.communityContent", updatedContent);

        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(409, json.getInt("code"));
        Assert.assertEquals("A community with the requested name already exists, choose a different name and resubmit.", json.getString("message"));
       
    deleteCommunity(community2);
    }
View Full Code Here

    public void testUpdateCommunityError() {
        addSnippetParam("CommunityService.communityUuid", "Foo");
        addSnippetParam("sample.communityTitle", "Foo");
        addSnippetParam("sample.communityContent", "Foo");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertTrue("Invalid return code, expected 404 or 500", json.getInt("code") == 404 || json.getInt("code") == 500); // TODO 500 OK because of issue in SmartCloud
        String errorMessage  =  json.getString("message");
        boolean isMessageValid = errorMessage.contains("The referenced community does not exist.") || errorMessage.contains("Error generating atom document.");
        Assert.assertTrue("expected message different than "+errorMessage, isMessageValid);
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.automation.core.test.pageobjects.JavaScriptPreviewPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.