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

no-jira: changes to LTI selenium test

parent 9711077a
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,12 @@ public class LTIPage { ...@@ -44,6 +44,12 @@ public class LTIPage {
this.browser = browser; this.browser = browser;
} }
/**
* A successful start will switch the browser to the iframe. If you need
* to go back to the LMS, you need to switch back to the default content.
*
* @return Itself
*/
public LTIPage start() { public LTIPage start() {
try { try {
By startBy = By.xpath("//div[contains(@class,'o_button_group')]/a[contains(@onclick,'start')]"); By startBy = By.xpath("//div[contains(@class,'o_button_group')]/a[contains(@onclick,'start')]");
...@@ -55,12 +61,10 @@ public class LTIPage { ...@@ -55,12 +61,10 @@ public class LTIPage {
OOGraphene.waitingALittleLonger(); OOGraphene.waitingALittleLonger();
WebElement iframe = browser.findElement(iframeBy); WebElement iframe = browser.findElement(iframeBy);
WebDriver iframeBrowser = browser.switchTo().frame(iframe); browser = browser.switchTo().frame(iframe);
By launchedBy = By.xpath("//p[contains(text(),'Launch Validated.')]"); By launchedBy = By.xpath("//p[contains(text(),'Launch Validated.')]");
OOGraphene.waitElement(launchedBy, browser); OOGraphene.waitElement(launchedBy, browser);
iframeBrowser.switchTo().defaultContent();
} catch (Exception e) { } catch (Exception e) {
OOGraphene.takeScreenshot("LTIPage_start", browser); OOGraphene.takeScreenshot("LTIPage_start", browser);
throw e; throw e;
...@@ -96,5 +100,10 @@ public class LTIPage { ...@@ -96,5 +100,10 @@ public class LTIPage {
Assert.assertTrue(success); Assert.assertTrue(success);
return this; return this;
} }
public LTIPage backToOpenOLAT() {
browser = browser.switchTo().defaultContent();
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