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

OO-3179: fix selenium tests

parent 11f0f59a
No related branches found
No related tags found
No related merge requests found
......@@ -1851,7 +1851,7 @@ create table o_eva_form_response (
e_responseidentifier varchar(64) not null,
e_numericalresponse decimal default null,
e_stringuifiedresponse mediumtext,
e_file_response_path varchar(4000);
e_file_response_path varchar(4000),
fk_session bigint not null,
primary key (id)
);
......
......@@ -305,8 +305,9 @@ public class BinderPage {
}
public EntryPage pickAssignment(String assignmentTitle) {
By assignmentButton = By.xpath("//div[contains(@class,'o_assignment_2_instantiate ')]/a[span[contains(text(),'" + assignmentTitle + "')]]");
browser.findElement(assignmentButton).click();
By assignmentSelectBy = By.xpath("//div[contains(@class,'o_section_lead')]//select[contains(@id,'o_fioassignments')]");
OOGraphene.waitElement(assignmentSelectBy, browser);
new Select(browser.findElement(assignmentSelectBy)).selectByVisibleText(assignmentTitle);
OOGraphene.waitBusy(browser);
assertOnPage(assignmentTitle);
return new EntryPage(browser);
......
......@@ -103,8 +103,13 @@ public class EntryPage {
public EntryPage assertOnImage(File image) {
String filename = image.getName();
By titleBy = By.xpath("//figure[contains(@class,'o_image')]//img[contains(@src,'" + filename + "')]");
OOGraphene.waitElement(titleBy, 5, browser);
int typePos = filename.lastIndexOf('.');
if (typePos > 0) {
String ending = filename.substring(typePos + 1).toLowerCase();
filename = filename.substring(0, typePos + 1).concat(ending);
}
By titleBy = By.xpath("//figure[@class='o_image']/img[contains(@src,'" + filename + "')]");
OOGraphene.waitElement(titleBy, browser);
return this;
}
......@@ -127,8 +132,8 @@ public class EntryPage {
return this;
}
public EntryPage assertOnDocument(File image) {
String filename = image.getName();
public EntryPage assertOnDocument(File file) {
String filename = file.getName();
By downloadLinkBy = By.xpath("//div[contains(@class,'o_download')]//a[contains(text(),'" + filename + "')]");
OOGraphene.waitElement(downloadLinkBy, 5, browser);
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