You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Remove useless manual tests
This commit is contained in:
@@ -1,65 +0,0 @@
|
||||
"""
|
||||
Manual test for the "abc" button bug.
|
||||
|
||||
This test creates a keyboard and lets you manually switch modes to observe the bug.
|
||||
|
||||
Run with: ./scripts/run_desktop.sh tests/manual_test_abc_button.py
|
||||
|
||||
Steps to reproduce the bug:
|
||||
1. Keyboard starts in lowercase mode
|
||||
2. Click "?123" button to switch to numbers mode
|
||||
3. Click "abc" button to switch back to lowercase
|
||||
4. OBSERVE: Does it show "?123" (correct) or "1#" (wrong/default LVGL)?
|
||||
"""
|
||||
|
||||
import lvgl as lv
|
||||
from mpos.ui.keyboard import MposKeyboard
|
||||
|
||||
# Get active screen
|
||||
screen = lv.screen_active()
|
||||
screen.clean()
|
||||
|
||||
# Create title
|
||||
title = lv.label(screen)
|
||||
title.set_text("ABC Button Test")
|
||||
title.align(lv.ALIGN.TOP_MID, 0, 5)
|
||||
|
||||
# Create instructions
|
||||
instructions = lv.label(screen)
|
||||
instructions.set_text(
|
||||
"1. Start in lowercase (has ?123 button)\n"
|
||||
"2. Click '?123' to switch to numbers\n"
|
||||
"3. Click 'abc' to switch back\n"
|
||||
"4. CHECK: Do you see '?123' or '1#'?\n"
|
||||
" - '?123' = CORRECT (custom keyboard)\n"
|
||||
" - '1#' = BUG (default LVGL keyboard)"
|
||||
)
|
||||
instructions.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0)
|
||||
instructions.align(lv.ALIGN.TOP_LEFT, 10, 30)
|
||||
|
||||
# Create textarea
|
||||
textarea = lv.textarea(screen)
|
||||
textarea.set_size(280, 30)
|
||||
textarea.set_one_line(True)
|
||||
textarea.align(lv.ALIGN.TOP_MID, 0, 120)
|
||||
textarea.set_placeholder_text("Type here...")
|
||||
|
||||
# Create keyboard
|
||||
keyboard = MposKeyboard(screen)
|
||||
keyboard.set_textarea(textarea)
|
||||
keyboard.align(lv.ALIGN.BOTTOM_MID, 0, 0)
|
||||
|
||||
print("\n" + "="*60)
|
||||
print("ABC Button Bug Test")
|
||||
print("="*60)
|
||||
print("Instructions:")
|
||||
print("1. Keyboard starts in LOWERCASE mode")
|
||||
print(" - Look for '?123' button (bottom left area)")
|
||||
print("2. Click '?123' to switch to NUMBERS mode")
|
||||
print(" - Should show numbers 1,2,3, etc.")
|
||||
print(" - Should have 'abc' button (bottom left)")
|
||||
print("3. Click 'abc' to return to lowercase")
|
||||
print("4. CRITICAL CHECK:")
|
||||
print(" - If you see '?123' button → CORRECT (custom keyboard)")
|
||||
print(" - If you see '1#' button → BUG (default LVGL keyboard)")
|
||||
print("="*60 + "\n")
|
||||
@@ -1,58 +0,0 @@
|
||||
"""
|
||||
Manual test for the "abc" button bug with DEBUG OUTPUT.
|
||||
|
||||
Run with: ./scripts/run_desktop.sh tests/manual_test_abc_button_debug.py
|
||||
|
||||
This will show debug output when you click the "abc" button.
|
||||
Watch the terminal to see what's happening!
|
||||
"""
|
||||
|
||||
import lvgl as lv
|
||||
from mpos.ui.keyboard import MposKeyboard
|
||||
|
||||
# Get active screen
|
||||
screen = lv.screen_active()
|
||||
screen.clean()
|
||||
|
||||
# Create title
|
||||
title = lv.label(screen)
|
||||
title.set_text("ABC Button Debug Test")
|
||||
title.align(lv.ALIGN.TOP_MID, 0, 5)
|
||||
|
||||
# Create instructions
|
||||
instructions = lv.label(screen)
|
||||
instructions.set_text(
|
||||
"Watch the TERMINAL output!\n"
|
||||
"\n"
|
||||
"1. Click '?123' to go to numbers mode\n"
|
||||
"2. Click 'abc' to go back to lowercase\n"
|
||||
"3. Check terminal for debug output\n"
|
||||
"4. Check if comma appears in textarea"
|
||||
)
|
||||
instructions.set_style_text_align(lv.TEXT_ALIGN.LEFT, 0)
|
||||
instructions.align(lv.ALIGN.TOP_LEFT, 10, 30)
|
||||
|
||||
# Create textarea
|
||||
textarea = lv.textarea(screen)
|
||||
textarea.set_size(280, 30)
|
||||
textarea.set_one_line(True)
|
||||
textarea.align(lv.ALIGN.TOP_MID, 0, 120)
|
||||
textarea.set_placeholder_text("Type here...")
|
||||
|
||||
# Create keyboard
|
||||
keyboard = MposKeyboard(screen)
|
||||
keyboard.set_textarea(textarea)
|
||||
keyboard.align(lv.ALIGN.BOTTOM_MID, 0, 0)
|
||||
|
||||
print("\n" + "="*70)
|
||||
print("ABC BUTTON DEBUG TEST")
|
||||
print("="*70)
|
||||
print("Instructions:")
|
||||
print("1. The keyboard starts in LOWERCASE mode")
|
||||
print("2. Click the '?123' button (bottom left) to switch to NUMBERS mode")
|
||||
print("3. Click the 'abc' button (bottom left) to switch back to LOWERCASE")
|
||||
print("4. Watch this terminal for [KEYBOARD DEBUG] messages")
|
||||
print("5. Check if a comma appears in the textarea")
|
||||
print("="*70)
|
||||
print("\nWaiting for button clicks...")
|
||||
print()
|
||||
@@ -1,48 +0,0 @@
|
||||
"""
|
||||
Manual test for MposKeyboard typing behavior.
|
||||
|
||||
This test allows you to manually type on the keyboard and verify:
|
||||
1. Only one character is added per button press (not doubled)
|
||||
2. Mode switching works correctly
|
||||
3. Special characters work
|
||||
|
||||
Run with: ./scripts/run_desktop.sh tests/manual_test_keyboard_typing.py
|
||||
"""
|
||||
|
||||
import lvgl as lv
|
||||
from mpos.ui.keyboard import MposKeyboard
|
||||
|
||||
# Get active screen
|
||||
screen = lv.screen_active()
|
||||
screen.clean()
|
||||
|
||||
# Create a textarea to type into
|
||||
textarea = lv.textarea(screen)
|
||||
textarea.set_size(280, 60)
|
||||
textarea.align(lv.ALIGN.TOP_MID, 0, 20)
|
||||
textarea.set_placeholder_text("Type here to test keyboard...")
|
||||
|
||||
# Create instructions label
|
||||
label = lv.label(screen)
|
||||
label.set_text("Test keyboard typing:\n"
|
||||
"- Each key should add ONE character\n"
|
||||
"- Try mode switching (UP/DOWN, ?123)\n"
|
||||
"- Check backspace works\n"
|
||||
"- Press ESC to exit")
|
||||
label.set_size(280, 80)
|
||||
label.align(lv.ALIGN.TOP_MID, 0, 90)
|
||||
label.set_style_text_align(lv.TEXT_ALIGN.CENTER, 0)
|
||||
|
||||
# Create the keyboard
|
||||
keyboard = MposKeyboard(screen)
|
||||
keyboard.set_textarea(textarea)
|
||||
keyboard.align(lv.ALIGN.BOTTOM_MID, 0, 0)
|
||||
|
||||
print("\n" + "="*50)
|
||||
print("Manual Keyboard Test")
|
||||
print("="*50)
|
||||
print("Click on keyboard buttons and observe the textarea.")
|
||||
print("Each button should add exactly ONE character.")
|
||||
print("If you see double characters, the bug exists.")
|
||||
print("Press ESC or close window to exit.")
|
||||
print("="*50 + "\n")
|
||||
Reference in New Issue
Block a user