From 4286d98990869aded1e6dfba04d63189dddec649 Mon Sep 17 00:00:00 2001 From: Jeff Zohrab Date: Sun, 8 Sep 2024 16:42:44 -0700 Subject: [PATCH 1/3] Change html element ID. --- lute/templates/term/_form.html | 4 ++-- tests/acceptance/lute_test_client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lute/templates/term/_form.html b/lute/templates/term/_form.html index ad443833..4aaf2c7c 100644 --- a/lute/templates/term/_form.html +++ b/lute/templates/term/_form.html @@ -68,7 +68,7 @@ {% if term.id %} {% endif %} - + @@ -305,7 +305,7 @@ $(document).keydown(function(event) { console.log(event); if (event.ctrlKey && event.key === "Enter") { - $("#submit").click(); + $("#btnsubmit").click(); } }); diff --git a/tests/acceptance/lute_test_client.py b/tests/acceptance/lute_test_client.py index 1adc2b2b..0d1e6bed 100644 --- a/tests/acceptance/lute_test_client.py +++ b/tests/acceptance/lute_test_client.py @@ -209,7 +209,7 @@ def make_term(self, lang, updates): updates["language_id"] = self.language_ids[lang] b = self.browser self._fill_term_form(b, updates) - b.find_by_css("#submit").first.click() + b.find_by_css("#btnsubmit").first.click() def get_term_table_content(self): "Get term table content." @@ -332,7 +332,7 @@ def click_word_fill_form(self, word, updates=None): time.sleep(0.4) # Hack, test failing. self._fill_term_form(iframe, updates) time.sleep(0.4) # Hack, test failing. - iframe.find_by_css("#submit").first.click() + iframe.find_by_css("#btnsubmit").first.click() time.sleep(0.4) # Hack, test failing. # Only refresh the reading frame if everything was ok. From e49f130280745d4c5bb2ed7da66404dd17641672 Mon Sep 17 00:00:00 2001 From: Jeff Zohrab Date: Sun, 8 Sep 2024 16:43:51 -0700 Subject: [PATCH 2/3] Issue 324: convert pending term parent text to tag. --- lute/templates/term/_form.html | 48 +++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/lute/templates/term/_form.html b/lute/templates/term/_form.html index 4aaf2c7c..4227d96f 100644 --- a/lute/templates/term/_form.html +++ b/lute/templates/term/_form.html @@ -18,7 +18,8 @@
-
+ {{ form.hidden_tag() }}
Date: Sun, 8 Sep 2024 19:06:34 -0700 Subject: [PATCH 3/3] Add delay to fix (suddenly failing) tests. --- tests/acceptance/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/acceptance/conftest.py b/tests/acceptance/conftest.py index eb0fbc23..e458edc4 100644 --- a/tests/acceptance/conftest.py +++ b/tests/acceptance/conftest.py @@ -239,12 +239,14 @@ def given_book_from_file(luteclient, lang, title, filename): thisdir = os.path.dirname(os.path.realpath(__file__)) fullpath = os.path.join(thisdir, "sample_files", filename) luteclient.make_book_from_file(title, fullpath, lang) + _sleep(1) # Hack! @given(parsers.parse("a {lang} book from url {url}")) def given_book_from_url(luteclient, lang, url): "Book is made from url in dev_api." luteclient.make_book_from_url(url, lang) + _sleep(1) # Hack! @given(parsers.parse('the book table loads "{title}"'))