|
@@ -1,3 +1,5 @@
|
|
|
+from selenium.webdriver.common.by import By
|
|
|
+
|
|
|
from nicegui import ui
|
|
|
|
|
|
from .screen import Screen
|
|
@@ -11,7 +13,14 @@ def test_log(screen: Screen):
|
|
|
log.push('D')
|
|
|
|
|
|
screen.open('/')
|
|
|
- screen.should_not_contain('A')
|
|
|
- screen.should_contain('B')
|
|
|
- screen.should_contain('C')
|
|
|
- screen.should_contain('D')
|
|
|
+ assert screen.selenium.find_element(By.ID, log.id).text == 'B\nC\nD'
|
|
|
+
|
|
|
+
|
|
|
+def test_log_with_newlines(screen: Screen):
|
|
|
+ log = ui.log(max_lines=3)
|
|
|
+ log.push('A')
|
|
|
+ log.push('B')
|
|
|
+ log.push('C\nD')
|
|
|
+
|
|
|
+ screen.open('/')
|
|
|
+ assert screen.selenium.find_element(By.ID, log.id).text == 'B\nC\nD'
|