use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.
the class CommonExpectedConditions method elementInViewPort.
public static ExpectedCondition<Boolean> elementInViewPort(final WebElement element) {
return new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver driver) {
Dimension size = element.getSize();
Point location = element.getLocation();
if (((size.height + location.y) > -1) && (size.width + location.x > -1)) {
return true;
}
return false;
}
@Override
public String toString() {
return String.format("Element ('%s') not in viewport!", element.getTagName());
}
};
}
use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.
the class VEVideoTests method resizeVideoWithSetting.
@Test(groups = { "VEVideo", "VEMediaResize" })
@Execute(asUser = User.USER_9)
public void resizeVideoWithSetting() {
int resizeNumber = 250;
String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditorPageObject ve = new VisualEditorPageObject().openVEOnArticle(wikiURL, articleName);
VisualEditorAddMediaDialog mediaDialog = ve.searchVideo("h");
ve = mediaDialog.addExistingMedia(1);
ve.verifyVideos(1);
Dimension source = ve.getVideoDimension();
ve.selectMedia();
ve.resizeMedia(resizeNumber, ImageSize.WIDTH);
ve.verifyVideoResized(source);
source = ve.getVideoDimension();
ve.resizeMedia(resizeNumber, ImageSize.HEIGHT);
ve.verifyVideoResized(source);
ve.publish();
}
use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.
the class VEVideoTests method resizeVideoWithHandle.
@Test(groups = { "VEVideo", "VEMediaResize" })
@Execute(asUser = User.USER_9)
public void resizeVideoWithHandle() {
String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
VisualEditorPageObject ve = new VisualEditorPageObject().openVEOnArticle(wikiURL, articleName);
VisualEditorAddMediaDialog mediaDialog = ve.searchVideo("h");
ve = mediaDialog.addExistingMedia(1);
ve.verifyVideos(1);
Dimension source = ve.getVideoDimension();
ve.randomResizeOnMedia();
ve.verifyVideoResized(source);
ve.publish();
}
use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.
the class TestUap method verifySlotsUnblocked.
private void verifySlotsUnblocked(AdsBaseObject ads, List<Map<String, Object>> slotsData) {
for (Map<String, Object> slotData : slotsData) {
String slotName = slotData.get("slotName").toString();
Dimension slotSize = (Dimension) slotData.get("slotSize");
ads.verifyLineItemId(slotName, Integer.valueOf(slotData.get("lineItemId").toString()));
ads.verifyIframeSize(slotName, slotData.get("src").toString(), slotSize.getWidth(), slotSize.getHeight());
}
}
use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.
the class AdsSkinHelper method getBackgroundColor.
public String getBackgroundColor() {
Point startPoint = new Point(1, articleBottomY);
File pixel = shooter.capturePageAndCrop(startPoint, new Dimension(1, 1), driver);
return toHex(new Color(imageEditor.fileToImage(pixel).getRGB(0, 0)));
}
Aggregations