|
1 | 1 | import time
|
2 | 2 |
|
| 3 | +from crystal_toolkit.apps.examples.basic_hello_structure import ( |
| 4 | + app as hello_structure_app, |
| 5 | +) |
3 | 6 | from crystal_toolkit.apps.examples.basic_hello_structure_interactive import (
|
4 | 7 | app as hello_structure_interactive_app,
|
5 | 8 | )
|
| 9 | +from crystal_toolkit.apps.examples.basic_hello_world import app as hello_world_app |
6 | 10 |
|
7 |
| -# |
8 |
| -# def test_hello_scientist(dash_duo): |
9 |
| -# |
10 |
| -# dash_duo.start_server(hello_world_app) |
11 |
| -# dash_duo.clear_storage() |
12 |
| -# |
13 |
| -# time.sleep(1) |
14 |
| -# dash_duo.percy_snapshot("hello_scientist") |
15 |
| -# |
16 |
| -# logs = dash_duo.get_logs() |
17 |
| -# assert bool(logs) is False, f"Browser console contains an error: {logs}" |
18 |
| -# |
19 |
| -# |
20 |
| -# def test_hello_structure(dash_duo): |
21 |
| -# dash_duo.start_server(hello_structure_app) |
22 |
| -# dash_duo.clear_storage() |
23 |
| -# |
24 |
| -# time.sleep(1) |
25 |
| -# dash_duo.percy_snapshot("hello_structure") |
26 |
| -# |
27 |
| -# logs = dash_duo.get_logs() |
28 |
| -# assert bool(logs) is False, f"Browser console contains an error: {logs}" |
29 |
| - |
30 |
| - |
31 |
| -def test_hello_structure_interactive(dash_duo): |
32 |
| - dash_duo.start_server(hello_structure_interactive_app) |
| 11 | +from .typing import DashDuo |
| 12 | + |
| 13 | + |
| 14 | +def test_hello_scientist(dash_duo: DashDuo): |
| 15 | + |
| 16 | + dash_duo.start_server(hello_world_app) |
| 17 | + dash_duo.clear_storage() |
| 18 | + |
| 19 | + dash_duo.percy_snapshot("hello_scientist") |
| 20 | + |
| 21 | + logs = dash_duo.get_logs() |
| 22 | + assert bool(logs) is False, f"Browser console contains an error: {logs}" |
| 23 | + |
| 24 | + |
| 25 | +def test_hello_structure(dash_duo): |
| 26 | + dash_duo.start_server(hello_structure_app) |
33 | 27 | dash_duo.clear_storage()
|
34 | 28 |
|
35 | 29 | time.sleep(1)
|
| 30 | + dash_duo.percy_snapshot("hello_structure") |
| 31 | + |
| 32 | + logs = dash_duo.get_logs() |
| 33 | + assert bool(logs) is False, f"Browser console contains an error: {logs}" |
| 34 | + |
| 35 | + |
| 36 | +def test_hello_structure_interactive(dash_duo: DashDuo) -> None: |
| 37 | + dash_duo.start_server(hello_structure_interactive_app) |
| 38 | + dash_duo.clear_storage() |
| 39 | + |
36 | 40 | dash_duo.percy_snapshot("hello_structure_interactive_on_load")
|
37 | 41 |
|
38 | 42 | dash_duo.multiple_click("#change_structure_button", 1)
|
39 | 43 |
|
40 |
| - time.sleep(1) |
41 | 44 | dash_duo.percy_snapshot("hello_structure_interactive_on_click")
|
42 | 45 |
|
43 | 46 | logs = dash_duo.get_logs()
|
44 |
| - assert bool(logs) is False, f"Browser console contains an error: {logs}" |
| 47 | + assert logs == [], f"Browser console should not contain errors: {logs}" |
0 commit comments