diff options
author | Ofir Sonsino <os0695@att.com> | 2018-01-31 17:19:00 +0200 |
---|---|---|
committer | Ofir Sonsino <os0695@att.com> | 2018-01-31 17:19:00 +0200 |
commit | 1cfb08779ea0e00be69e072a940b3063e049fe6b (patch) | |
tree | 6602a900387c8393ed0dcd81c0539381632903c6 /vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java | |
parent | 2f20b001b9243e0f8b44aecc768ec265fd538732 (diff) |
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d
Issue-ID: VID-86
Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java')
-rw-r--r-- | vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java b/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java new file mode 100644 index 000000000..ff7dc3441 --- /dev/null +++ b/vid-automation/src/main/java/vid/automation/test/test/CreateInstanceDialogBaseTest.java @@ -0,0 +1,35 @@ +package vid.automation.test.test; + +import org.junit.Assert; +import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils; +import org.openqa.selenium.WebElement; +import vid.automation.test.Constants; +import vid.automation.test.model.Service; + +public class CreateInstanceDialogBaseTest extends VidBaseTestCase { + void assertServiceMetadata(String expectedMetadata, String actualMetadata) { + WebElement serviceNameElem = GeneralUIUtils.getWebElementByTestID(actualMetadata); + String actualServiceName = serviceNameElem.getText(); + Assert.assertEquals(expectedMetadata, actualServiceName); + } + + void validateServiceCreationDialog(Service expectedService) { + assertThatServiceCreationDialogIsVisible(); + assertServiceMetadata(expectedService.name, Constants.SERVICE_NAME); + assertServiceMetadata(expectedService.uuid, Constants.SERVICE_UUID); + assertServiceMetadata(expectedService.invariantUuid, Constants.SERVICE_INVARIANT_UUID); + assertServiceMetadata(expectedService.category, Constants.SERVICE_CATEGORY); + assertServiceMetadata(expectedService.version, Constants.SERVICE_VERSION); + assertServiceMetadata(expectedService.description, Constants.SERVICE_DESCRIPTION); + } + + void assertThatServiceCreationDialogIsVisible() { + boolean byText = GeneralUIUtils.findAndWaitByText(Constants.BrowseASDC.CREATE_SERVICE_INSTANCE, 15); + Assert.assertTrue(byText); + } + + void assertSuccessfulServiceInstanceCreation() { + boolean byText = GeneralUIUtils.findAndWaitByText(Constants.BrowseASDC.SERVICE_INSTANCE_CREATED_SUCCESSFULLY_TEXT, 100); + Assert.assertTrue(Constants.BrowseASDC.SERVICE_INSTANCE_CREATION_FAILED_MESSAGE, byText); + } +} |