Skip to content

Commit

Permalink
add manual scroll (#128)
Browse files Browse the repository at this point in the history
* bootstrap5

* update ci py version

* update tox python version

* update tox python version

* use , sperator in tox passenv

* use allowlist_externals

* add './' in allowlist_externals

* pin selenium version

* fix select2 test

* fix select2 test

* fix select2 multiple test

* fix select2 multiple test

* fix select2 X test

* fix selenium tests

* fix linting && use new python, pypy version

* fix flake8

* fix restructured text https://stackoverflow.com/a/39720161/1154966 does not work

* fix unofficial-deformdemo (it never worked)

* removed six; reactivated validation (do we still need it?)

* make isort happy

* update python version in docs, setup.py; added me to contributors

* list specific python versions; update ci python setup

* fix multi select test

* scroll into view

* scroll into view add sleep and perform; add firefox local

* add manual scroll to be in viewport
  • Loading branch information
delijati authored Nov 15, 2023
1 parent e337f80 commit ca6e28e
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 ca6e28e

Please sign in to comment.