112 def test_case_7(self):
113 """Login and test almost all the grid with the previous project."""
114 thedriver=self.driver
115 finddriver=self.finddriver
118 thedriver.get(self.URL)
120 button=finddriver.find_element_by_xpath("//button[@name='buttonLogin']")
123 elem=finddriver.find_element_by_xpath("//input[@id='username']")
125 elem.send_keys("ddurandi")
127 elem=finddriver.find_element_by_xpath("//input[@id='password']")
129 elem.send_keys("OtherP@ssw/31d")
131 remember_me=finddriver.find_element_by_id("remember_me")
134 button=finddriver.find_element_by_id('submit')
137 elem=finddriver.find_element_by_id("filter_chosen_project_session")
138 elem.send_keys("TestSelenium")
140 button=finddriver.find_element_by_id('Valid_chosen_project_session')
143 if (SaveScreenshotBool):
144 thedriver.save_screenshot('/tmp/tests/test7-which_session.png')
147 button=finddriver.find_element_by_id('submit')
152 if (SaveScreenshotBool):
153 thedriver.save_screenshot('/tmp/tests/test7-Grid_screenshot.png')
155 thedriver.execute_script("document.body.style.webkitTransformOriginX=document.body.style.mstransformOriginX=document.body.style.transformOriginX=0;"+
156 "document.body.style.webkitTransformOriginY=document.body.style.mstransformOriginY=document.body.style.transformOriginY=0;"+
157 "document.body.style.webkitTransformOriginZ=document.body.style.mstransformOriginZ=document.body.style.transformOriginZ=0;"+
158 "document.body.style.webkitTransform = document.body.style.msTransform = document.body.style.transform = 'scale(.25)';"+
159 "document.body.style.width='7680px';")
160 thedriver.execute_script("document.body.style.margintop='-1220px'")
161 thedriver.execute_script("document.body.style.marginleft='-2880px';")
162 #thedriver.set_window_size(7680, 4320)
163 thedriver.set_window_size(1920, 1080)
164 thedriver.maximize_window()
166 if (SaveScreenshotBool):
167 thedriver.save_screenshot('/tmp/tests/test7-Grid_unzoomed_screenshot.png')
170 # logging.debug(" Console :")
171 # for entry in thedriver.get_log('browser'):
173 # logging.debug(entry)
176 # if (SaveScreenshotBool):
177 # thedriver.save_screenshot('/tmp/tests/test7-TileMenu.png')
179 wait = WebDriverWait(thedriver, 20)
180 button = wait.until(EC.visibility_of_element_located((By.ID, 'Globaloption8')))
181 button = wait.until(EC.element_to_be_clickable((By.ID, 'Globaloption8')))
184 # if (SaveScreenshotBool):
185 # thedriver.save_screenshot('/tmp/tests/test7-TileMenu.png')
187 wait = WebDriverWait(thedriver, 2)
188 button = wait.until(EC.element_to_be_clickable((By.ID, '0option1')))
191 wait = WebDriverWait(thedriver, 6)
192 postit0 = wait.until(EC.visibility_of_element_located((By.ID,'postit0')))
194 if (SaveScreenshotBool):
195 thedriver.save_screenshot('/tmp/tests/test7-postIt.png')
199 button=finddriver.find_element_by_id("1option0")
202 wait = WebDriverWait(thedriver, 3)
203 button = wait.until(EC.element_to_be_clickable((By.ID,'tile-opacity-1')))
206 slider=finddriver.find_element_by_id('tileOpacitySlider1')
207 if (SaveScreenshotBool):
208 thedriver.save_screenshot('/tmp/tests/test7-opacity_before_screenshot.png')
210 # #Using Action Class
211 # move = ActionChains(finddriver);
212 # move.move_to_element(slider);
213 # move.move_by_offset(20, 0);
215 # # Actions act=new Actions(driver);
216 # # act.moveToElement(element).click().perform();
218 button=finddriver.find_element_by_id('tileOpacitySlider1')
221 if (SaveScreenshotBool):
222 thedriver.save_screenshot('/tmp/tests/test7-opacity_after_screenshot.png')
224 button=finddriver.find_element_by_id('tile-opacity-1')
228 button=finddriver.find_element_by_id("4option2")
231 if (SaveScreenshotBool):
232 thedriver.save_screenshot('/tmp/tests/test7-draw_mode_screenshot.png')
234 colorButton=finddriver.find_element_by_id('Drawoption0')
237 # colorChoose=finddriver.find_element_by_id('colorChoose')
238 # colorChoose.click()
239 # colorChoose.send_keys("#ea1d1d")
241 colorButton=finddriver.find_element_by_id('Drawoption0')
244 canvas=finddriver.find_element_by_id('drawCanvas4')
246 # #Using Action Class
247 # move = ActionChains(thedriver)
248 # move.move_to_element_with_offset(canvas,200,200);
249 # move.click_and_hold(canvas[0])
250 # move.move_by_offset(70, -55)
251 # move.release(canvas)
254 if (SaveScreenshotBool):
255 thedriver.save_screenshot('/tmp/tests/test7-draw_screenshot.png')
257 saveOnTileButton=finddriver.find_element_by_id('Drawoption4')
258 saveOnTileButton.click()
261 if (SaveScreenshotBool):
262 thedriver.save_screenshot('/tmp/tests/test7-back_from_draw_screenshot.png')
264 wait = WebDriverWait(thedriver, 4)
265 button = wait.until(EC.element_to_be_clickable((By.ID,"Globaloption6")))
268 wait = WebDriverWait(thedriver, 4)
269 button = wait.until(EC.element_to_be_clickable((By.ID,"managementGlobaloption0")))
272 if (SaveScreenshotBool):
273 thedriver.save_screenshot('/tmp/tests/test7-draw_management_screenshot.png')
275 button=finddriver.find_element_by_id("Globaloption6")
278 button=finddriver.find_element_by_id("6option4")
281 wait = WebDriverWait(thedriver, 3)
282 button = wait.until(EC.element_to_be_clickable((By.ID,"12option4")))
285 button=finddriver.find_element_by_id("3option3")
288 button=finddriver.find_element_by_id("5option3")
291 if (SaveScreenshotBool):
292 thedriver.save_screenshot('/tmp/tests/test7-lines_columns_exchange_screenshot.png')
294 button=finddriver.find_element_by_id("Globaloption8")
297 button=finddriver.find_element_by_id("Globaloption5")
300 button=finddriver.find_element_by_id("zoomGlobaloption0")
303 hitbox0=finddriver.find_element_by_id('hitbox0')
305 # move = ActionChains(thedriver)
306 # move.move_to_element(hitbox0)
307 # move.click(hitbox0)
312 hitbox1=finddriver.find_element_by_id('hitbox1')
314 # move = ActionChains(thedriver)
315 # move.move_to_element(hitbox1)
316 # move.click(hitbox1)
320 hitbox5=finddriver.find_element_by_id('hitbox5')
322 # move = ActionChains(thedriver)
323 # move.move_to_element(hitbox5)
324 # move.click(hitbox5)
329 hitbox4=finddriver.find_element_by_id('hitbox4')
331 # move = ActionChains(thedriver)
332 # move.move_to_element(hitbox4)
333 # move.click(hitbox4)
337 if (SaveScreenshotBool):
338 thedriver.save_screenshot('/tmp/tests/test7-select_0_1_4_5_screenshot.png')
340 button=finddriver.find_element_by_id("Zoomoption0")
343 wait = WebDriverWait(thedriver, 3)
344 button = wait.until(EC.element_to_be_clickable((By.ID,'Zclose2')))
346 if (SaveScreenshotBool):
347 thedriver.save_screenshot('/tmp/tests/test7-Zoom_screenshot.png')
352 button=finddriver.find_element_by_id('Zclose0')
355 if (SaveScreenshotBool):
356 thedriver.save_screenshot('/tmp/tests/test7-zclose_screenshot.png')
358 button=finddriver.find_element_by_id('buttonUnzoom')
362 button=finddriver.find_element_by_id("Globaloption5")
365 # button=finddriver.find_element_by_xpath("//div[3]/div[5][@id='option4']")
368 # button=finddriver.find_element_by_xpath("//div[8][@id='option7']")
371 # button=finddriver.find_element_by_id('onoff11')
375 # button=finddriver.find_element_by_id('onoff13')
379 # button=finddriver.find_element_by_id('onoff8')
383 # button=finddriver.find_element_by_xpath("//div[3]/div[4][@id='option3']")
386 # button=finddriver.find_element_by_xpath("//div[4]/div")
391 # button=finddriver.find_element_by_id('Off')
394 # # if (SaveScreenshotBool):
395 # # thedriver.save_screenshot('/tmp/tests/test7-select_Off_tag_screenshot.png')
397 # button=finddriver.find_element_by_xpath("//div[3]/div[5][@id='option4']")
400 # button=finddriver.find_element_by_xpath("//div[6]/div")
403 # # if (SaveScreenshotBool):
404 # # thedriver.save_screenshot('/tmp/tests/test7-Zoom_tag_Off_screenshot.png')
406 # button=finddriver.find_element_by_id('buttonUnzoom')
411 # button=finddriver.find_element_by_xpath("//div[4]/div")
414 # button=finddriver.find_element_by_xpath("//div[3]/div[5][@id='option4']")
417 # button=finddriver.find_element_by_xpath("//div[4]/div[2]")
420 # button=finddriver.find_element_by_id('Off')
423 # # if (SaveScreenshotBool):
424 # # thedriver.save_screenshot('/tmp/tests/test7-sort_Off_screenshot.png')
427 # button=finddriver.find_element_by_xpath("//div[4]/div[2]")
430 # button=finddriver.find_element_by_xpath("//div[10][@id='option9']")
433 # # if (SaveScreenshotBool):
434 # # thedriver.save_screenshot('/tmp/tests/test7-QRcodes_screenshot.png')
436 # button=finddriver.find_element_by_xpath("//div[10][@id='option9']")
439 # button=finddriver.find_element_by_xpath("//div[9][@id='option8']")
444 # button=finddriver.find_element_by_id('zoomNode9')
447 # # if (SaveScreenshotBool):
448 # # thedriver.save_screenshot('/tmp/tests/test7-Zoom_on_node9_screenshot.png')
450 # button=finddriver.find_element_by_id('buttonUnzoom')
455 # button=finddriver.find_element_by_xpath("//div[3]/div[4]")
458 # button=finddriver.find_element_by_xpath("//div[@id='menu999']/div[11]")
459 # move = ActionChains(thedriver)
460 # move.move_to_element(button)
464 # # if (SaveScreenshotBool):
465 # # thedriver.save_screenshot('/tmp/tests/test7-info_node_always_show_screenshot.png')
467 # button=finddriver.find_element_by_xpath("//div[@id='menu999']/div[11]")
468 # move = ActionChains(thedriver)
469 # move.move_to_element(button)
472 # # button=finddriver.find_element_by_xpath("//div[@id='menu999']/div[11]")
475 # # button=finddriver.find_element_by_xpath("//div[15][@id='option14']")
476 # # move = ActionChains(thedriver)
477 # # move.move_to_element(button)
478 # # move.click(button)
481 # # # if (SaveScreenshotBool):
482 # # # thedriver.save_screenshot('/tmp/tests/test7-save_Session_screenshot.png')
484 # # button=finddriver.find_element_by_id('submitSave')
487 # # # if (SaveScreenshotBool):
488 # # # thedriver.save_screenshot('/tmp/tests/test7-validate_save_screenshot.png')
490 # # button=finddriver.find_element_by_id('gGsubmit')
493 # # # if (SaveScreenshotBool):
494 # # # thedriver.save_screenshot('/tmp/tests/test7-change_new_Session_screenshot.png')
496 # # button=finddriver.find_element_by_id('ChangeRoomYes')
499 # # # if (SaveScreenshotBool):
500 # # # thedriver.save_screenshot('/tmp/tests/test7-validate_new_room_screenshot.png')
503 # button=finddriver.find_element_by_xpath("//div[16][@id='option15']")
505 # move = ActionChains(thedriver)
506 # move.move_to_element(button)
511 # # # if (SaveScreenshotBool):
512 # # # thedriver.save_screenshot('/tmp/tests/test7-options_screenshot.png')
514 # button=finddriver.find_element_by_id('colNumber')
518 # elem=finddriver.find_element_by_xpath("//input[@id='colNumber']")
520 # elem.send_keys("4")
521 # elem.send_keys(Keys.TAB)
524 # button=finddriver.find_element_by_id('spreadX')
528 # elem=finddriver.find_element_by_xpath("//input[@id='spreadX']")
530 # elem.send_keys("1758.4")
531 # elem.send_keys(Keys.TAB)
534 # button=finddriver.find_element_by_id('spreadY')
538 # elem=finddriver.find_element_by_xpath("//input[@id='spreadY']")
540 # elem.send_keys("880")
541 # elem.send_keys(Keys.TAB)
544 # button=finddriver.find_element_by_xpath("//div/div/input[@name='color-theme-radio']")
547 # button=finddriver.find_element_by_id('showinfo-cb')
550 # # if (SaveScreenshotBool):
551 # # thedriver.save_screenshot('/tmp/tests/test7-save_options_screenshot.png')
553 # button=finddriver.find_element_by_id('buttonSave')
556 # button=finddriver.find_element_by_xpath("//div[11][@id='option10']")
559 # # if (SaveScreenshotBool):
560 # # thedriver.save_screenshot('/tmp/tests/test7-info_screenshot.png')
562 # button=finddriver.find_element_by_xpath("//div[12][@id='option11']")
565 # # if (SaveScreenshotBool):
566 # # thedriver.save_screenshot('/tmp/tests/test7-refrash_screenshot.png')
568 # button=finddriver.find_element_by_xpath("//div[17][@id='option16']")
571 # # if (SaveScreenshotBool):
572 # # thedriver.save_screenshot('/tmp/tests/test7-help_TiledViz_screenshot.png')
574 # slider=finddriver.find_element_by_xpath("//input[@id='helpSlider']")
575 # #Using Action Class
576 # move = ActionChains(thedriver);
577 # move.move_to_element(slider);
578 # move.move_by_offset(80, 0);
583 # # if (SaveScreenshotBool):
584 # # thedriver.save_screenshot('/tmp/tests/test7-help_TiledViz_screenshot.png')
586 # button=finddriver.find_element_by_id('buttonClosehelp')
589 # # if (SaveScreenshotBool):
590 # # thedriver.save_screenshot('/tmp/tests/test7_final_screenshot.png')
592 except NoSuchElementException as ex:
593 self.fail(ex.msg+": \n"+thedriver.title)