本文整理汇总了Java中org.openqa.selenium.support.Color.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java Color.fromString方法的具体用法?Java Color.fromString怎么用?Java Color.fromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.support.Color
的用法示例。
在下文中一共展示了Color.fromString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSeriesColorAtXAxisPosition
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
protected Color getSeriesColorAtXAxisPosition(int series,
String xAxisLabelValue) {
// The series can vary depending on the structure of the chart, by
// default it is fine but if this doesn't work you may need to tweak the
// series
int barNumber = getXAxisLabelsText().indexOf(xAxisLabelValue);
// The below varies depending on the structure of the chart, by default
// we need to multiply by 4
barNumber = barNumber * 4;
return Color.fromString(chart.findElement(
By.cssSelector(".highcharts-series-group > g:nth-of-type("
+ series + ") > rect:nth-of-type(" + barNumber + ")"))
.getAttribute("fill"));
}
示例2: matchesSafely
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
protected boolean matchesSafely(WebElement item,
Description mismatchDescription) {
Color actualColor = Color.fromString(item.getCssValue(attributeName));
if (actualColor.equals(expectedColor))
return true;
else {
mismatchDescription.appendText(attributeName + " was " + toString(actualColor));
return false;
}
}
示例3: getAttributeAsColor
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
/**
* Return the given attribute as a color or null if the attribute is not
* specified.
*
* @param attributeName
* @return
*/
public Color getAttributeAsColor(String attributeName) {
try {
return Color.fromString(element.getAttribute(attributeName));
} catch (Exception e) {
return null;
}
}
示例4: getMarkingsColorUsedBackground
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorUsedBackground() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_USED_BACKGROUND), "#ffd2a5"));
}
示例5: getMarkingsColorUsedOutline
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorUsedOutline() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_USED_OUTLINE), "#916f22"));
}
示例6: getMarkingsColorReadBackground
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorReadBackground() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_READ_BACKGROUND), "#90ee90"));
}
示例7: getMarkingsColorReadOutline
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorReadOutline() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_READ_OUTLINE), "#008000"));
}
示例8: getMarkingsColorUsedBackground
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorUsedBackground() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_COLOR_USED_BACKGROUND), "#ffd2a5"));
}
示例9: getMarkingsColorUsedOutline
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorUsedOutline() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_COLOR_USED_OUTLINE), "#916f22"));
}
示例10: getMarkingsColorReadBackground
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorReadBackground() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_COLOR_READ_BACKGROUND), "#90ee90"));
}
示例11: getMarkingsColorReadOutline
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public Color getMarkingsColorReadOutline() {
return Color.fromString(getStringProperty(key(NamedProperties.MARKINGS_COLOR_READ_OUTLINE), "#008000"));
}
示例12: hasColor
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
public static Matcher<WebElement> hasColor(String colorAsString) {
return new ColorMatcher("color", Color.fromString(colorAsString));
}
示例13: hasBackgroundColor
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
public static Matcher<WebElement> hasBackgroundColor(String colorAsString) {
return new ColorMatcher("background-color", Color.fromString(colorAsString));
}
示例14: match
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
@Override
public boolean match(final String actualValue) {
Color actualColor = Color.fromString(actualValue);
Color expectedColor = Color.fromString(this.expectedColor);
return actualColor.equals(expectedColor);
}
示例15: isEqualTo
import org.openqa.selenium.support.Color; //导入方法依赖的package包/类
public ColorAssert isEqualTo(String expected) {
return super.isEqualTo(Color.fromString(expected));
}