Skip to content
Snippets Groups Projects
Commit e27e1ce3 authored by srosse's avatar srosse
Browse files

Merge remote-tracking branch 'origin/OpenOLAT_12.5' into OpenOLAT_13.2

parents 8c519a3b 69363f40
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,6 @@ import java.util.List; ...@@ -24,7 +24,6 @@ import java.util.List;
import org.olat.ims.qti21.model.xml.AssessmentItemFactory; import org.olat.ims.qti21.model.xml.AssessmentItemFactory;
import org.openqa.selenium.Dimension; import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
/** /**
* *
...@@ -67,36 +66,28 @@ public class Position { ...@@ -67,36 +66,28 @@ public class Position {
y = (y2 + y1) / 2; y = (y2 + y1) / 2;
} }
if(browser instanceof FirefoxDriver) { x = x - Math.round(dimension.getWidth() / 2.0f);
x = x - Math.round(dimension.getWidth() / 2.0f); y = y - Math.round(dimension.getHeight() / 2.0f);
y = y - Math.round(dimension.getHeight() / 2.0f);
}
return new Position(x, y); return new Position(x, y);
} }
public static Position valueOf(int x, int y, Dimension dimension, WebDriver browser) { public static Position valueOf(int x, int y, Dimension dimension, WebDriver browser) {
if(browser instanceof FirefoxDriver) { x = x - Math.round(dimension.getWidth() / 2.0f);
x = x - Math.round(dimension.getWidth() / 2.0f); y = y - Math.round(dimension.getHeight() / 2.0f);
y = y - Math.round(dimension.getHeight() / 2.0f);
}
return new Position(x, y); return new Position(x, y);
} }
public static Position valueOf(int x, int y, int firefoxCorrection, Dimension dimension, WebDriver browser) { 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);
x = x - Math.round(dimension.getWidth() / 2.0f); y = y - Math.round(dimension.getHeight() / 2.0f);
y = y - Math.round(dimension.getHeight() / 2.0f); x += firefoxCorrection;
x += firefoxCorrection; y += firefoxCorrection;
y += firefoxCorrection;
}
return new Position(x, y); return new Position(x, y);
} }
public static Position valueOf(int x, int y, int width, int height, WebDriver browser) { 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);
x = x - Math.round(width / 2.0f); y = y - Math.round(height / 2.0f);
y = y - Math.round(height / 2.0f);
}
return new Position(x, y); return new Position(x, y);
} }
......
...@@ -27,7 +27,6 @@ import org.openqa.selenium.By; ...@@ -27,7 +27,6 @@ import org.openqa.selenium.By;
import org.openqa.selenium.Dimension; import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement; import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.interactions.Actions;
import uk.ac.ed.ph.jqtiplus.value.Cardinality; import uk.ac.ed.ph.jqtiplus.value.Cardinality;
...@@ -82,10 +81,7 @@ public class QTI21HotspotEditorPage extends QTI21AssessmentItemEditorPage { ...@@ -82,10 +81,7 @@ public class QTI21HotspotEditorPage extends QTI21AssessmentItemEditorPage {
public QTI21HotspotEditorPage moveToHotspotEditor() { public QTI21HotspotEditorPage moveToHotspotEditor() {
By editorBy = By.id("o_qti_hotspots_edit"); By editorBy = By.id("o_qti_hotspots_edit");
OOGraphene.waitElement(editorBy, browser); OOGraphene.waitElement(editorBy, browser);
OOGraphene.scrollTo(editorBy, browser);
if(browser instanceof FirefoxDriver) {
OOGraphene.scrollTo(editorBy, browser);
}
return this; return this;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment