summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/att/ecomp/dcae/ci/ui/rule_editor/components/actions/from/SimpleFromComponent.java
blob: a7cba3d18ae7eb2a21bdc25cbf8be04c7b06c114 (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
package com.att.ecomp.dcae.ci.ui.rule_editor.components.actions.from;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;

import com.att.ecomp.dcae.ci.ui.rule_editor.components.BaseComponenet;
import com.att.ecomp.dcae.ci.ui.utils.ByTest;
import com.att.ecomp.dcae.ci.ui.utils.Locator;
import com.att.ecomp.dcae.ci.utilities.Report;
import com.aventstack.extentreports.Status;

public class SimpleFromComponent extends BaseComponenet {

	public SimpleFromComponent(WebDriverWait timeout, WebElement element) {
		super(timeout, element);
	}
	
	public String getValue() {
		Report.log(Status.INFO, "Getting input from...");
		return getFromValueElement().getAttribute("value");
	}
	
	public void setValue(String value) {
		Report.log(Status.INFO, "Setting input from...");
		getFromValueElement().clear();
		getFromValueElement().sendKeys(value);
	}
	
	/* Private Methods */

	private WebElement getFromValueElement() {
		return wait.until(Locator.from(root).findVisible(ByTest.id("valueInput"), 0));
	}
}