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

OO-1635: try to harden selenium tests against info blue box and other transition

parent 98510ba0
No related branches found
No related tags found
No related merge requests found
Showing
with 13 additions and 28 deletions
...@@ -52,7 +52,6 @@ import org.olat.selenium.page.course.PublisherPageFragment.Access; ...@@ -52,7 +52,6 @@ import org.olat.selenium.page.course.PublisherPageFragment.Access;
import org.olat.selenium.page.graphene.OOGraphene; import org.olat.selenium.page.graphene.OOGraphene;
import org.olat.selenium.page.group.GroupPage; import org.olat.selenium.page.group.GroupPage;
import org.olat.selenium.page.group.MembersWizardPage; import org.olat.selenium.page.group.MembersWizardPage;
import org.olat.selenium.page.user.UserToolsPage;
import org.olat.test.ArquillianDeployments; import org.olat.test.ArquillianDeployments;
import org.olat.test.rest.UserRestClient; import org.olat.test.rest.UserRestClient;
import org.olat.user.restapi.UserVO; import org.olat.user.restapi.UserVO;
...@@ -79,8 +78,6 @@ public class BusinessGroupTest { ...@@ -79,8 +78,6 @@ public class BusinessGroupTest {
@ArquillianResource @ArquillianResource
private URL deploymentUrl; private URL deploymentUrl;
@Page
private UserToolsPage userTools;
@Page @Page
private NavigationPage navBar; private NavigationPage navBar;
......
...@@ -643,7 +643,7 @@ public class CourseTest { ...@@ -643,7 +643,7 @@ public class CourseTest {
String post2Title = "Blog-RW-2-" + UUID.randomUUID(); String post2Title = "Blog-RW-2-" + UUID.randomUUID();
String post2Summary = "Some explantations as teaser"; String post2Summary = "Some explantations as teaser";
String post2Content = "Content of the post"; String post2Content = "Content of the post";
feed.addPost() feed.addBlogPost()
.fillPostForm(post2Title, post2Summary, post2Content) .fillPostForm(post2Title, post2Summary, post2Content)
.publishPost(); .publishPost();
......
...@@ -153,8 +153,6 @@ public class PortfolioTest { ...@@ -153,8 +153,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.closeBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -234,8 +232,6 @@ public class PortfolioTest { ...@@ -234,8 +232,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -333,8 +329,6 @@ public class PortfolioTest { ...@@ -333,8 +329,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.closeBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -403,8 +397,6 @@ public class PortfolioTest { ...@@ -403,8 +397,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -468,8 +460,6 @@ public class PortfolioTest { ...@@ -468,8 +460,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//reopen the portfolio //reopen the portfolio
portfolio = userTools portfolio = userTools
...@@ -534,8 +524,6 @@ public class PortfolioTest { ...@@ -534,8 +524,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -612,8 +600,6 @@ public class PortfolioTest { ...@@ -612,8 +600,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -699,8 +685,6 @@ public class PortfolioTest { ...@@ -699,8 +685,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.waitAndCloseBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
...@@ -773,8 +757,6 @@ public class PortfolioTest { ...@@ -773,8 +757,6 @@ public class PortfolioTest {
.next() .next()
.selectMap(mapTitle, pageTitle, structureElementTitle) .selectMap(mapTitle, pageTitle, structureElementTitle)
.finish(); .finish();
OOGraphene.closeBlueMessageWindow(browser);
//open the portfolio //open the portfolio
portfolio = userTools portfolio = userTools
......
...@@ -151,6 +151,7 @@ public class AssessmentToolPage { ...@@ -151,6 +151,7 @@ public class AssessmentToolPage {
By userLinksBy = By.className("o_sel_certificate_generate"); By userLinksBy = By.className("o_sel_certificate_generate");
browser.findElement(userLinksBy).click(); browser.findElement(userLinksBy).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.waitAndCloseBlueMessageWindow(browser);
boolean newCertificate = false; boolean newCertificate = false;
for(int i=0; i<50; i++) { for(int i=0; i<50; i++) {
......
...@@ -83,7 +83,7 @@ public class BulkAssessmentPage { ...@@ -83,7 +83,7 @@ public class BulkAssessmentPage {
Assert.assertTrue(finish.isEnabled()); Assert.assertTrue(finish.isEnabled());
finish.click(); finish.click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitAndCloseBlueMessageWindow(browser);
return this; return this;
} }
......
...@@ -378,7 +378,9 @@ public class CourseEditorPageFragment { ...@@ -378,7 +378,9 @@ public class CourseEditorPageFragment {
browser.findElement(chooseButton).click(); browser.findElement(chooseButton).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
//popup //popup
WebElement popup = browser.findElement(By.className("o_sel_search_referenceable_entries")); By referenceableEntriesBy = By.className("o_sel_search_referenceable_entries");
OOGraphene.waitElement(referenceableEntriesBy, 1, browser);
WebElement popup = browser.findElement(referenceableEntriesBy);
popup.findElement(By.cssSelector("a.o_sel_repo_popup_my_resources")).click(); popup.findElement(By.cssSelector("a.o_sel_repo_popup_my_resources")).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
......
...@@ -75,7 +75,7 @@ public class CourseWizardPage { ...@@ -75,7 +75,7 @@ public class CourseWizardPage {
Assert.assertTrue(finish.isEnabled()); Assert.assertTrue(finish.isEnabled());
finish.click(); finish.click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitAndCloseBlueMessageWindow(browser);
return this; return this;
} }
......
...@@ -67,7 +67,7 @@ public class ArtefactWizardPage { ...@@ -67,7 +67,7 @@ public class ArtefactWizardPage {
} }
/** /**
* Finish the wizard * Finish the wizard, wait and close the blue info box.
* @return this * @return this
*/ */
public ArtefactWizardPage finish() { public ArtefactWizardPage finish() {
...@@ -76,7 +76,7 @@ public class ArtefactWizardPage { ...@@ -76,7 +76,7 @@ public class ArtefactWizardPage {
Assert.assertTrue(finish.isEnabled()); Assert.assertTrue(finish.isEnabled());
finish.click(); finish.click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
OOGraphene.closeBlueMessageWindow(browser); OOGraphene.waitAndCloseBlueMessageWindow(browser);
return this; return this;
} }
......
...@@ -163,6 +163,7 @@ public class PortfolioPage { ...@@ -163,6 +163,7 @@ public class PortfolioPage {
//title //title
By titleBy = By.xpath("//div[contains(@class,'o_sel_add_map_window')]//form//input[@type='text']"); By titleBy = By.xpath("//div[contains(@class,'o_sel_add_map_window')]//form//input[@type='text']");
OOGraphene.waitElement(titleBy, 1, browser);
WebElement titleEl = browser.findElement(titleBy); WebElement titleEl = browser.findElement(titleBy);
titleEl.sendKeys(title); titleEl.sendKeys(title);
......
...@@ -121,10 +121,12 @@ public class FeedPage { ...@@ -121,10 +121,12 @@ public class FeedPage {
return this; return this;
} }
public FeedPage addPost() { public FeedPage addBlogPost() {
By newItemButton = By.className("o_sel_feed_item_new"); By newItemButton = By.className("o_sel_feed_item_new");
browser.findElement(newItemButton).click(); browser.findElement(newItemButton).click();
OOGraphene.waitBusy(browser); OOGraphene.waitBusy(browser);
By postForm = By.className("o_sel_blog_form");
OOGraphene.waitElement(postForm, 1, 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