2026-02-17 23:07:12 -05:00
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
|
from selenium.webdriver.common.keys import Keys
|
|
|
|
|
|
|
|
|
|
from .base import wait
|
|
|
|
|
|
|
|
|
|
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
class PostPage:
|
2026-02-17 23:07:12 -05:00
|
|
|
def __init__(self, test):
|
|
|
|
|
self.test = test
|
|
|
|
|
|
|
|
|
|
def get_table_rows(self):
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
return self.test.browser.find_elements(By.CSS_SELECTOR, "#id_post_table tr")
|
2026-02-17 23:07:12 -05:00
|
|
|
|
|
|
|
|
@wait
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
def wait_for_row_in_post_table(self, line_text, line_number):
|
|
|
|
|
expected_row_text = f"{line_number}. {line_text}"
|
2026-02-17 23:07:12 -05:00
|
|
|
rows = self.get_table_rows()
|
|
|
|
|
self.test.assertIn(expected_row_text, [row.text for row in rows])
|
2026-03-11 13:59:43 -04:00
|
|
|
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
def get_line_input_box(self):
|
2026-02-17 23:07:12 -05:00
|
|
|
return self.test.browser.find_element(By.ID, "id_text")
|
|
|
|
|
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
def add_post_line(self, line_text):
|
|
|
|
|
new_line_no = len(self.get_table_rows()) + 1
|
|
|
|
|
self.get_line_input_box().send_keys(line_text)
|
|
|
|
|
self.get_line_input_box().send_keys(Keys.ENTER)
|
|
|
|
|
self.wait_for_row_in_post_table(line_text, new_line_no)
|
2026-02-17 23:07:12 -05:00
|
|
|
return self
|
2026-03-11 13:59:43 -04:00
|
|
|
|
2026-02-17 23:07:12 -05:00
|
|
|
def get_share_box(self):
|
|
|
|
|
return self.test.browser.find_element(
|
|
|
|
|
By.CSS_SELECTOR,
|
2026-02-17 23:27:54 -05:00
|
|
|
'input[name="recipient"]',
|
2026-02-17 23:07:12 -05:00
|
|
|
)
|
2026-03-11 13:59:43 -04:00
|
|
|
|
2026-02-17 23:07:12 -05:00
|
|
|
def get_shared_with_list(self):
|
|
|
|
|
return self.test.browser.find_elements(
|
|
|
|
|
By.CSS_SELECTOR,
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
".post-recipient"
|
2026-02-17 23:07:12 -05:00
|
|
|
)
|
2026-03-11 13:59:43 -04:00
|
|
|
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
def share_post_with(self, email):
|
2026-05-08 19:14:50 -04:00
|
|
|
# Buddy-btn flow (post-Brief sprint): click bottom-left handshake,
|
|
|
|
|
# type the email in the slide-out, click the .btn-confirm OK, wait
|
|
|
|
|
# for the recipient chip.
|
|
|
|
|
buddy_btn = self.test.browser.find_element(By.ID, "id_buddy_btn")
|
|
|
|
|
buddy_btn.click()
|
|
|
|
|
recipient = self.test.wait_for(
|
|
|
|
|
lambda: self.test.browser.find_element(By.ID, "id_recipient")
|
|
|
|
|
)
|
|
|
|
|
recipient.send_keys(email)
|
|
|
|
|
ok = self.test.browser.find_element(
|
|
|
|
|
By.CSS_SELECTOR, "#id_buddy_panel .btn.btn-confirm"
|
|
|
|
|
)
|
|
|
|
|
ok.click()
|
2026-02-17 23:07:12 -05:00
|
|
|
self.test.wait_for(
|
|
|
|
|
lambda: self.test.assertIn(
|
|
|
|
|
email, [item.text for item in self.get_shared_with_list()]
|
|
|
|
|
)
|
|
|
|
|
)
|
2026-02-17 23:27:54 -05:00
|
|
|
|
rename: Note→Post/Line (dashboard); Recognition→Note (drama); new-post/my-posts to billboard
- dashboard: Note→Post, Item→Line across models, forms, views, API, urls & tests
- new-post (9×3) & my-posts (3×3) applets migrate from dashboard→billboard context; billboard view passes form & recent_posts
- drama: Recognition→Note, related_name notes; billboard URL /recognition/→/my-notes/, set-palette at /note/<slug>/set-palette
- recognition.js→note.js (module Note, data.note key); recognition-page.js→note-page.js; .recog-*→.note-*
- _recognition.scss→_note.scss; BillNotes page header; applet slug billboard-recognition→billboard-notes (My Notes)
- NoteSpec.js replaces RecognitionSpec.js; test_recognition.py→test_applet_my_notes.py
- 4 migrations applied: dashboard 0004, applets 0011+0012, drama 0005; 683 ITs green
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 22:32:34 -04:00
|
|
|
def get_post_owner(self):
|
|
|
|
|
return self.test.browser.find_element(By.ID, "id_post_owner").text
|