diff --git a/src/test/java/org/olat/selenium/page/graphene/Position.java b/src/test/java/org/olat/selenium/page/graphene/Position.java index 2582fb253d784ec49e45eae3b3d5ae25269a52d8..4a03366c1ffbfab5273f411354a3afc843e65e35 100644 --- a/src/test/java/org/olat/selenium/page/graphene/Position.java +++ b/src/test/java/org/olat/selenium/page/graphene/Position.java @@ -24,7 +24,6 @@ import java.util.List; import org.olat.ims.qti21.model.xml.AssessmentItemFactory; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; -import org.openqa.selenium.firefox.FirefoxDriver; /** * @@ -67,36 +66,28 @@ public class Position { y = (y2 + y1) / 2; } - if(browser instanceof FirefoxDriver) { - x = x - Math.round(dimension.getWidth() / 2.0f); - y = y - Math.round(dimension.getHeight() / 2.0f); - } + x = x - Math.round(dimension.getWidth() / 2.0f); + y = y - Math.round(dimension.getHeight() / 2.0f); return new Position(x, y); } public static Position valueOf(int x, int y, Dimension dimension, WebDriver browser) { - if(browser instanceof FirefoxDriver) { - x = x - Math.round(dimension.getWidth() / 2.0f); - y = y - Math.round(dimension.getHeight() / 2.0f); - } + x = x - Math.round(dimension.getWidth() / 2.0f); + y = y - Math.round(dimension.getHeight() / 2.0f); return new Position(x, y); } public static Position valueOf(int x, int y, int firefoxCorrection, Dimension dimension, WebDriver browser) { - if(browser instanceof FirefoxDriver) { - x = x - Math.round(dimension.getWidth() / 2.0f); - y = y - Math.round(dimension.getHeight() / 2.0f); - x += firefoxCorrection; - y += firefoxCorrection; - } + x = x - Math.round(dimension.getWidth() / 2.0f); + y = y - Math.round(dimension.getHeight() / 2.0f); + x += firefoxCorrection; + y += firefoxCorrection; return new Position(x, y); } public static Position valueOf(int x, int y, int width, int height, WebDriver browser) { - if(browser instanceof FirefoxDriver) { - x = x - Math.round(width / 2.0f); - y = y - Math.round(height / 2.0f); - } + x = x - Math.round(width / 2.0f); + y = y - Math.round(height / 2.0f); return new Position(x, y); } diff --git a/src/test/java/org/olat/selenium/page/qti/QTI21HotspotEditorPage.java b/src/test/java/org/olat/selenium/page/qti/QTI21HotspotEditorPage.java index beb294e84680f532531b6be856c8363abab7dec1..51ff28fa92986b0567bb16148d0efebc682dcd59 100644 --- a/src/test/java/org/olat/selenium/page/qti/QTI21HotspotEditorPage.java +++ b/src/test/java/org/olat/selenium/page/qti/QTI21HotspotEditorPage.java @@ -27,7 +27,6 @@ import org.openqa.selenium.By; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; -import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import uk.ac.ed.ph.jqtiplus.value.Cardinality; @@ -82,10 +81,7 @@ public class QTI21HotspotEditorPage extends QTI21AssessmentItemEditorPage { public QTI21HotspotEditorPage moveToHotspotEditor() { By editorBy = By.id("o_qti_hotspots_edit"); OOGraphene.waitElement(editorBy, browser); - - if(browser instanceof FirefoxDriver) { - OOGraphene.scrollTo(editorBy, browser); - } + OOGraphene.scrollTo(editorBy, browser); return this; }