org.sahagin.share.srctree.code.TestStepLabel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sahagin Show documentation
Show all versions of sahagin Show documentation
Sahagin makes your Selenium script more readable and maintainable.
package org.sahagin.share.srctree.code;
import java.util.Map;
import org.sahagin.share.yaml.YamlConvertException;
import org.sahagin.share.yaml.YamlUtils;
public class TestStepLabel extends Code {
public static final String TYPE = "stepLabel";
private String label;
private String text;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
@Override
protected String getType() {
return TYPE;
}
@Override
public Map toYamlObject() {
Map result = super.toYamlObject();
if (label != null) {
result.put("label", label);
}
if (text != null) {
result.put("text", text);
}
return result;
}
@Override
public void fromYamlObject(Map yamlObject)
throws YamlConvertException {
super.fromYamlObject(yamlObject);
label = YamlUtils.getStrValue(yamlObject, "label", true);
text = YamlUtils.getStrValue(yamlObject, "text", true);
}
}