-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-detected home warning message mechanism (#183)
This PR adds a hard-coded path for displaying a notification widget between the home controls and the app accordion. The mechanism detects if `/home/jovyan/.aiidalab/home_app_warning.md` is present, and if so, displays its contents in a `Markdown` widget. As mentioned, the present mechanism is hard-coded in this implementation. However, a more flexible system (see #54) is soon to be discussed to expand the concept of user notifications beyond the home app and with a more general scope. Thanks to @danielhollas for assisting with authoring a test :) --------- Co-authored-by: Daniel Hollas <[email protected]>
- Loading branch information
1 parent
e05a322
commit cdc403a
Showing
5 changed files
with
92 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from selenium.webdriver.common.by import By | ||
|
||
|
||
def test_home_notification(selenium_driver, create_warning_file, final_screenshot): | ||
selenium = selenium_driver("start.ipynb") | ||
selenium.set_window_size(1000, 941) | ||
notifications = selenium.find_elements(By.CLASS_NAME, "home-notification") | ||
assert len(notifications) == 1 | ||
home_warning = notifications[0] | ||
content_element = home_warning.find_element(By.TAG_NAME, "p") | ||
assert content_element.text == "Warning!" |