summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/att/ecomp/dcae/ci/ui/pages/SDCCreateVFPage.java
blob: d7a30ba9f5751ec127ee731a101ecea5973dbfae (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package com.att.ecomp.dcae.ci.ui.pages;

import java.util.UUID;

import org.openecomp.d2.ci.report.ExtentTestActions;
import org.openecomp.d2.ci.utilities.GeneralUIUtils;
import org.openqa.selenium.WebElement;

import com.aventstack.extentreports.Status;

public class SDCCreateVFPage 
{
	public static String addVFName()
	{
		GeneralUIUtils.waitForElementInVisibilityByTestId("name");
		WebElement vfNameTextbox = GeneralUIUtils.getWebElementByTestID("name");
		vfNameTextbox.clear();
		String vfName = "VF" + UUID.randomUUID();
		vfNameTextbox.sendKeys(vfName);
		ExtentTestActions.log(Status.INFO, String.format("Add VF Name: %s",vfName));
		GeneralUIUtils.ultimateWait();
		return vfName;
	}
	
	public static void addVFCategory(String category)
	{
		ExtentTestActions.log(Status.INFO, String.format("Add %s Category", category));
		GeneralUIUtils.waitForElementInVisibilityByTestId("selectGeneralCategory");
		GeneralUIUtils.getSelectList(category, "selectGeneralCategory");
		GeneralUIUtils.ultimateWait();
	}
	
	public static void addVFDescription()
	{
		ExtentTestActions.log(Status.INFO,"Add VF Desc");
		GeneralUIUtils.waitForElementInVisibilityByTestId("description");
		WebElement vfdescTextbox = GeneralUIUtils.getWebElementByTestID("description");
		vfdescTextbox.clear();
		String vfDesc = "Desc";
		vfdescTextbox.sendKeys(vfDesc);
		GeneralUIUtils.ultimateWait();
	}
	
	public static void addVFVendorName()
	{
		ExtentTestActions.log(Status.INFO,"Add VF Vendor Name");
		GeneralUIUtils.waitForElementInVisibilityByTestId("vendorName");
		WebElement vendorTextbox = GeneralUIUtils.getWebElementByTestID("vendorName");
		vendorTextbox.clear();
		String vfVendorName = "Vendor";
		vendorTextbox.sendKeys(vfVendorName);
		GeneralUIUtils.ultimateWait();
	}
	
	public static void addVFVendorRelease()
	{
		ExtentTestActions.log(Status.INFO,"Add VF Vendor Release");
		GeneralUIUtils.waitForElementInVisibilityByTestId("vendorRelease");
		WebElement vendorReleaseTextbox = GeneralUIUtils.getWebElementByTestID("vendorRelease");
		vendorReleaseTextbox.clear();
		String vfVendorRelease = "1";
		vendorReleaseTextbox.sendKeys(vfVendorRelease);
		GeneralUIUtils.ultimateWait();
	}
	
	public static String addAllVFMandtoryFields(String category)
	{
		String vfName = addVFName();
		addVFCategory(category);
		addVFDescription();
		addVFVendorName();
		addVFVendorRelease();
		
		return vfName;
	}
	
	public static void clickOnCreateVFButton()
	{
		ExtentTestActions.log(Status.INFO,"Click on Create VF Button");
		GeneralUIUtils.waitForElementInVisibilityByTestId("create/save");
		GeneralUIUtils.clickOnElementByTestId("create/save");	
		GeneralUIUtils.ultimateWait();
	}
	
	public static void clickOnCheckInVFButton()
	{
		ExtentTestActions.log(Status.INFO,"Click on Check In VF Button");
		GeneralUIUtils.waitForElementInVisibilityByTestId("check_in");
		GeneralUIUtils.clickOnElementByTestId("check_in");	
		GeneralUIUtils.ultimateWait();		
	}
	
	public static void addCheckInMessage()
	{
		ExtentTestActions.log(Status.INFO,"Add check in message in pop window");
		GeneralUIUtils.waitForElementInVisibilityByTestId("checkindialog");
		WebElement checkInDialogTextbox = GeneralUIUtils.getWebElementByTestID("checkindialog");
		checkInDialogTextbox.clear();
		String vfCheckInDialog = "Text";
		checkInDialogTextbox.sendKeys(vfCheckInDialog);
		GeneralUIUtils.ultimateWait();		
	}
	
	public static void clickOnCheckInOKFButton()
	{
		ExtentTestActions.log(Status.INFO,"Click OK in check in pop up window");
	    GeneralUIUtils.waitForElementInVisibilityByTestId("OK");
		GeneralUIUtils.clickOnElementByTestId("OK");	
		GeneralUIUtils.ultimateWait();
	}
	
	public static void checkInVF()
	{
		clickOnCheckInVFButton();
		addCheckInMessage();
		clickOnCheckInOKFButton();		
	}
	
	
	
	

}