-
-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to defer load until after page is rendered (#3882)
- Loading branch information
1 parent
4bcf011
commit e0e7db7
Showing
9 changed files
with
148 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import time | ||
|
||
import pytest | ||
|
||
pytestmark = pytest.mark.ui | ||
|
||
from panel.io.server import serve | ||
from panel.pane import panel | ||
|
||
|
||
def test_param_defer_load(page, port): | ||
def defer_load(): | ||
time.sleep(0.5) | ||
return 'I render after load!' | ||
|
||
component = panel(defer_load, defer_load=True) | ||
|
||
serve(component, port=port, threaded=True, show=False) | ||
|
||
time.sleep(0.2) | ||
|
||
page.goto(f"http://localhost:{port}") | ||
|
||
assert page.locator(".bk.pn-loading") | ||
assert page.locator('.bk.markdown').count() == 0 | ||
|
||
time.sleep(0.5) | ||
|
||
assert page.text_content('.bk.markdown') == 'I render after load!' |