Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Dec 4, 2024
1 parent cd0554b commit 8ad3a89
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: echo "JUPYTER_TOKEN=$(openssl rand -hex 32)" >> $GITHUB_ENV

- name: Run pytest
run: pytest -v --driver ${{ matrix.browser }} tests_notebooks
run: pytest -v --driver ${{ matrix.browser }} tests_notebooks -k test_notification
env:
TAG: edge

Expand Down
7 changes: 7 additions & 0 deletions tests_notebooks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ def execute(command, user=None, **kwargs):
return execute


@pytest.fixture
def create_warning_file(aiidalab_exec):
aiidalab_exec(
"mkdir -p /home/jovyan/.aiidalab && echo 'This is a test warning' > /home/jovyan/.aiidalab/home_app_warning.md"
)


@pytest.fixture(scope="session", autouse=True)
def notebook_service(docker_ip, docker_services, aiidalab_exec):
"""Ensure that HTTP service is up and responsive."""
Expand Down
11 changes: 11 additions & 0 deletions tests_notebooks/test_notification.py
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 == "This is a test warning"

0 comments on commit 8ad3a89

Please sign in to comment.