Commit b4494884 authored by Swergas's avatar Swergas

edit DOM of edition of question answers page, to better target the remove button

parent 3923c0f9
......@@ -85,6 +85,7 @@ let extractTemplate () =
let rec createAnswer a =
let container = Dom_html.createDiv document in
container##.className := Js.string "question_answer_item";
let t = document##createTextNode (Js.string "Answer: ") in
let u = Dom_html.createInput document in
u##.className := Js.string "question_answer";
......@@ -100,6 +101,7 @@ let rec createAnswer a =
return ()
in
btn##.onclick := handler f;
btn##.className := Js.string "btn_remove";
Dom.appendChild btn btn_text;
Dom.appendChild container btn;
let insert_text = document##createTextNode (Js.string "Insert") in
......@@ -111,6 +113,7 @@ let rec createAnswer a =
return ()
in
insert_btn##.onclick := handler f;
insert_btn##.className := Js.string "btn_insert";
Dom.appendChild insert_btn insert_text;
Dom.appendChild container insert_btn;
container
......
......@@ -475,7 +475,7 @@ def administrator_edits_election_questions(browser):
# She removes answer 3
question_to_remove = 3
remove_button_css_selector = ".question_answers > div:nth-child(" + str(question_to_remove) + ") button:nth-child(2)"
remove_button_css_selector = ".question_answer_item:nth-child(" + str(question_to_remove) + ") .btn_remove"
remove_button_element = browser.find_element_by_css_selector(remove_button_css_selector)
remove_button_element.click()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment