ipydrawio/atest/lite/Notebook.robot.j2

50 wiersze
1.9 KiB
Django/Jinja

# Copyright 2023 ipydrawio contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
*** Settings ***
Documentation Test some notebooks in lite
Resource ../_Keywords.robot
Resource ./_Keywords.robot
Library OperatingSystem
Force Tags component:notebook
Suite Setup Set Screenshot Directory ${OUTPUT DIR}${/}lite${/}notebooks
*** Variables ***
${PYOLITE BUSY} Pyolite | Busy
*** Test Cases ***
{% for p in P.ALL_DEMO_CONTENTS %}
{% if ".ipynb" in p.name %}
{{ p.name.replace(".ipynb", " ").title() }}
[Documentation] Does the {{ p.name.replace(".ipynb", "") }} example notebook work?
Notebook Should Run Without Error {{ p.name }}
{% endif %}
{% endfor %}
*** Keywords ***
Notebook Should Run Without Error
[Arguments] ${file}
[Documentation] Does one example notebook work?
Try to Close All Tabs
${stem} = Set Variable ${file.lower().replace(" ", "-").split(".")[0]}
Ensure File Browser is Open
Double Click Element css:[title*\="${file}"]
Lab Command Show Log Console
Lab Command Run All Cells
Capture Page Screenshot ${stem}-00-loaded.png
Wait Until Page Does Not Contain ${PYOLITE BUSY} timeout=120s
Page Should Not Contain Widget Model Not Found
Page Should Not Contain Traceback
Capture Page Screenshot ${stem}-01-run.png