blob: b7f2441f5e04f1a228c03881929d5fb014e729e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
package com.att.ecomp.dcae.ci.ui.tests;
import org.openecomp.d2.ci.datatypes.UserRoleEnum;
import org.openecomp.d2.ci.report.ExtentTestActions;
import org.openecomp.d2.ci.utilities.GeneralUIUtils;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import com.att.ecomp.dcae.ci.ui.pages.DCAECompositionPage;
import com.att.ecomp.dcae.ci.ui.pages.DCAEGeneralPage;
import com.att.ecomp.dcae.ci.ui.pages.DCAEHomePage;
import com.att.ecomp.dcae.ci.ui.pages.DCAELeftPanel;
import com.att.ecomp.dcae.ci.ui.pages.DCAEServicesPage;
import com.att.ecomp.dcae.ci.ui.pages.SDCCreateServicePage;
import com.att.ecomp.dcae.ci.ui.pages.SDCCreateVFPage;
import com.att.ecomp.dcae.ci.ui.pages.SDCHomePage;
import com.att.ecomp.dcae.ci.ui.setup.ConfigTest;
import com.att.ecomp.dcae.ci.ui.tests.verificator.ServiceVerificator;
import com.aventstack.extentreports.Status;
public class DCAESanity extends ConfigTest{
@Override
protected UserRoleEnum getUserRole() {
// TODO Auto-generated method stub
return UserRoleEnum.DESIGNER;
}
@Test (description = "DCAE Main scenario", groups={"Sanity"})
public void sanityTestSDCSection() throws Exception
{
String vfName;
String serviceName;
// ------------------ SDC-Side: Create VF --------------------------
System.out.println("Start Test");
SDCHomePage.clickOnAddVf();
vfName = SDCCreateVFPage.addAllVFMandtoryFields("Utility"); //Creates VF, need to send only the desired category name
SDCCreateVFPage.clickOnCreateVFButton();
SDCCreateVFPage.checkInVF();
// ------------------ SDC-Side: Create Service ---------------------
SDCHomePage.clickOnAddsService();
serviceName = SDCCreateServicePage.addAllServiceMandtoryFields("Network L1-3");
SDCCreateServicePage.clickOnCreateServiceButton();
SDCCreateServicePage.clickOnServiceCompsitionTab();
SDCCreateServicePage.addAssetToCanvas(vfName);
SDCCreateServicePage.checkInService();
// ------------------ DCAE-Side: Create Asset -------------------
DCAEHomePage.clickOnDcaeTab();
DCAEHomePage.clickOnCreateNewAsset();
String assetName = DCAEGeneralPage.addAssetName("Asset Name");
DCAEGeneralPage.addAssetDescription("Asset Description");
DCAEGeneralPage.clickSaveAsset();
DCAELeftPanel.navigateToServices();
DCAEServicesPage.selectService(serviceName);
DCAEServicesPage.selectVNFI(vfName);
DCAEServicesPage.clickAttach(vfName);
DCAELeftPanel.navigateToComposition();
WebElement item = DCAECompositionPage.expandList("Microservice");
DCAECompositionPage.addItemFromList(item);
DCAECompositionPage.SelectFlowType("Syslog");
DCAECompositionPage.clickSave();
DCAECompositionPage.clickSubmit();
//------------------ Verify Blue Print
SDCHomePage.clickOnHomeTab();
SDCHomePage.searchForElement(serviceName);
SDCHomePage.clickOnElement(serviceName);
try
{
SDCCreateServicePage.clickOnServiceCompsitionTab();
}
catch(Exception e)
{
GeneralUIUtils.getDriver().navigate().refresh();
SDCCreateServicePage.clickOnServiceCompsitionTab();
ExtentTestActions.log(Status.WARNING,"SDC UI known Bug - Blank page with text: {{getStatus()}}, the browser was refreshed to bypass this bug.");
}
SDCCreateServicePage.clickOnElementInCanavs();
SDCCreateServicePage.clickOnArtifactTab();
ServiceVerificator.verifyBluePrintArtifactExist(assetName);
ExtentTestActions.log(Status.INFO, "Test Ended.");
System.out.println("End Test");
}
}
|