Files
python-tdd/src/functional_tests/test_layout_and_styling.py
Disco DeDisco b86a4ddd73
Some checks failed
ci/woodpecker/push/pyswiss Pipeline was successful
ci/woodpecker/push/main Pipeline failed
fix FT note→post renames in test_sharing & test_layout_and_styling; note page layout polish
- test_sharing.py: NotePage→PostPage, MyNotesPage→MyPostsPage, add_note_item→add_post_line,
  share_note_with→share_post_with, get_note_owner→get_post_owner; navigate to /billboard/
- test_layout_and_styling.py: NotePage→PostPage, get_item_input_box→get_line_input_box,
  add_note_item→add_post_line; navigate to /billboard/
- my_notes.html: remove "My Notes" h2 heading
- _note.scss: .note-page padding 0.75rem 1.5rem; .note-don-doff top:-1rem (DON centers on
  corner), gap:0.4rem (tight like game kit); .note-item padding-left:1.25rem (left buffer)

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 01:55:12 -04:00

38 lines
1.5 KiB
Python

from .base import FunctionalTest
from .post_page import PostPage
class LayoutAndStylingTest(FunctionalTest):
def test_layout_and_styling(self):
self.create_pre_authenticated_session("disco@test.io")
self.browser.get(self.live_server_url + '/billboard/')
post_page = PostPage(self)
self.browser.set_window_size(1024, 768)
def section_center(el):
return self.browser.execute_script("""
var el = arguments[0];
var ancestor = el.parentElement;
while (ancestor && ancestor.tagName !== 'SECTION'
&& !ancestor.classList.contains('container')) {
ancestor = ancestor.parentElement;
}
var a = ancestor || document.body;
var s = a.getBoundingClientRect();
var cs = window.getComputedStyle(a);
var pl = parseFloat(cs.paddingLeft);
var pr = parseFloat(cs.paddingRight);
var r = el.getBoundingClientRect();
return [r.x + r.width / 2, s.x + pl + (s.width - pl - pr) / 2];
""", el)
inputbox = post_page.get_line_input_box()
input_c, section_c = section_center(inputbox)
self.assertAlmostEqual(input_c, section_c, delta=10)
post_page.add_post_line("testing")
inputbox = post_page.get_line_input_box()
input_c, section_c = section_center(inputbox)
self.assertAlmostEqual(input_c, section_c, delta=10)