Skip to content

Commit

Permalink
add manual scroll to be in viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
delijati committed Nov 15, 2023
1 parent abc8fbe commit fc45fff
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions deformdemo/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,11 @@ def setUpModule():
from selenium.webdriver import Chrome

browser = Chrome()
return browser

elif driver_name == "selenium_local_firefox":
from selenium.webdriver import Firefox

browser = Firefox()
return browser

elif driver_name == "selenium_container_chrome":
from selenium_containers import start_chrome
Expand All @@ -285,9 +283,6 @@ def setUpModule():
desired_capabilities=capabilities,
)

browser.set_window_size(1920, 1080)
return browser

elif driver_name == "selenium_container_opera":
from selenium_containers import start_opera

Expand All @@ -305,9 +300,6 @@ def setUpModule():
desired_capabilities=capabilities,
)

browser.set_window_size(1920, 1080)
return browser

elif driver_name == "selenium_container_firefox":
from selenium_containers import start_firefox

Expand All @@ -325,21 +317,16 @@ def setUpModule():
desired_capabilities=capabilities,
)

browser.set_window_size(1920, 1080)
return browser

elif driver_name == "selenium_local_firefox":
from selenium import webdriver

try:
browser = webdriver.Firefox()
browser.set_window_size(1920, 1080)
except WebDriverException:
if os.path.exists(BROKEN_SELENIUM_LOG_FILE):
print("Selenium says no")
print(open(BROKEN_SELENIUM_LOG_FILE, "rt").read())
raise
return browser

else:
"""
Expand All @@ -361,8 +348,8 @@ def setUpModule():
desired_capabilities=capabilities,
)

browser.set_window_size(1920, 1080)
return browser
browser.set_window_size(1920, 1080)
return browser


def tearDownModule():
Expand Down Expand Up @@ -3323,6 +3310,7 @@ def test_render_default(self):
self.assertEqual(findid("deformField1-addtext").text, "Add Person")

def test_submit_complex_interaction(self):
button = findid("deformsubmit")
action_chains_on_id("deformField1-seqAdd").click().perform()

# A single item shouldn't have an active reorder button.
Expand Down Expand Up @@ -3377,7 +3365,9 @@ def test_submit_complex_interaction(self):
ActionChains(browser).drag_and_drop_by_offset(
persons[0], 0, seq_height * 1.5
).perform()


ActionChains(browser).scroll_by_amount(0, 200).perform()
time.sleep(0.2)
action_chains_on_id("deformsubmit").click().perform()
time.sleep(0.2)

Expand Down

0 comments on commit fc45fff

Please sign in to comment.