Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ - Use htmx to async update messages. #342

Merged
merged 21 commits into from
Nov 28, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7fd80de
:sparkles: - Use htmx to async update messages.
svenvandescheur Nov 21, 2022
db8b272
:white_check_mark: - Add test for async_selector in messages.
svenvandescheur Nov 22, 2022
656db68
:shirt: - Black.
svenvandescheur Nov 22, 2022
2a180ab
:arrow_up: - Selenium.
svenvandescheur Nov 22, 2022
4e908cb
:green_heart: - Make selenium/Firefox run headless.
svenvandescheur Nov 23, 2022
a290762
:shirt: - isort
svenvandescheur Nov 23, 2022
a360f8e
:green_heart: - Attempt to fix the build.
svenvandescheur Nov 23, 2022
8233546
:white_check_mark: Uncomment commented out test.
svenvandescheur Nov 23, 2022
7bef0e4
:shirt: - prettier
svenvandescheur Nov 23, 2022
dadb55b
:heavy_plus_sign: bump certifi and add selenium
annashamray Nov 25, 2022
b9be15e
:ok_hand: - action variable is not documented in template tags.
svenvandescheur Nov 25, 2022
4f8073b
:ok_hand: - Should we also add polling for messages?
svenvandescheur Nov 25, 2022
6589347
:ok_hand: - Why to use this tag? I commented it and nothing changed.
svenvandescheur Nov 25, 2022
919567e
:ok_hand: - Nice! Perhaps in the future we can also test it for Chrome
svenvandescheur Nov 25, 2022
cd4a1d3
:shirt: - Black and isort.
svenvandescheur Nov 25, 2022
2f86b51
:ok_hand: - Should we make it 5 seconds?
svenvandescheur Nov 28, 2022
fff0694
:bug: - Fix bug in accessibility code.
svenvandescheur Nov 28, 2022
138e2c0
:memo - Fix documentation.
svenvandescheur Nov 28, 2022
0e34b07
:ok_hand: - Please add test for polling.
svenvandescheur Nov 28, 2022
7185ea7
:shirt - black
svenvandescheur Nov 28, 2022
bb1c0ff
:bug: - Fix incorrect argument name.
svenvandescheur Nov 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
👌 - Nice! Perhaps in the future we can also test it for Chrome
svenvandescheur committed Nov 25, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 919567e7fe0e77e6529c1d5c5c058eda2cb1f522
36 changes: 30 additions & 6 deletions src/open_inwoner/accounts/tests/test_inbox_page.py
Original file line number Diff line number Diff line change
@@ -4,8 +4,10 @@
from django_webtest import WebTest
from privates.test import temp_private_root
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.chrome.webdriver import WebDriver as ChromeDriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.firefox.webdriver import WebDriver as FirefoxDriver

from ..models import Message
from .factories import ContactFactory, MessageFactory, UserFactory
@@ -123,13 +125,13 @@ def test_mark_messages_as_seen(self):
self.assertTrue(message_received.seen)


class MySeleniumTests(StaticLiveServerTestCase):
class BaseInboxPageSeleniumTests:
options = None
driver = None

@classmethod
def setUpClass(cls):
super().setUpClass()
options = Options()
options.headless = True
cls.selenium = WebDriver(options=options)
cls.selenium.implicitly_wait(10)

@classmethod
@@ -177,3 +179,25 @@ def test_async_selector(self):
url = f"{self.live_server_url}{reverse_lazy('accounts:inbox')}?redirected=True"
self.assertEqual(url, self.selenium.current_url)
self.assertNotIn("#messages-last", self.selenium.current_url)


class InboxPageFirefoxSeleniumTests(BaseInboxPageSeleniumTests, StaticLiveServerTestCase):
options = FirefoxOptions()
driver_class = FirefoxDriver

@classmethod
def setUpClass(cls):
cls.options.headless = True
cls.selenium = cls.driver_class(options=cls.options)
super().setUpClass()


class InboxPageChromeSeleniumTests(BaseInboxPageSeleniumTests, StaticLiveServerTestCase):
options = ChromeOptions()
driver_class = ChromeDriver

@classmethod
def setUpClass(cls):
cls.options.headless = True
cls.selenium = cls.driver_class(options=cls.options)
super().setUpClass()