Skip to content

Commit

Permalink
test: update path_deploy test case
Browse files Browse the repository at this point in the history
  • Loading branch information
wang0618 committed Mar 25, 2021
1 parent 7bd09d5 commit 757e992
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/16.path_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@
import util
from pywebio.platform import path_deploy
from pywebio.utils import *
import template

here_dir = os.path.dirname(os.path.abspath(__file__))
demos_dir = os.path.join(here_dir, '..', 'demos')


def test(server_proc: subprocess.Popen, browser: Chrome):
time.sleep(10)
percySnapshot(browser, name='path_deploy_1')
time.sleep(2)
browser.get('http://localhost:8080/')
time.sleep(2)
percySnapshot(browser, name='path_deploy_index')
page_html = browser.find_element_by_tag_name('body').get_attribute('innerHTML')
for f in ['bmi', 'bokeh_app', 'chat_room', 'doc_demo', 'input_usage', 'output_usage', 'set_env_demo']:
assert f in page_html

time.sleep(2)


def start_test_server():
here_dir = os.path.dirname(os.path.abspath(__file__))

path_deploy(here_dir + '/../demos', port=8080, host='127.0.0.1', cdn=False)
path_deploy(demos_dir, port=8080, host='127.0.0.1', cdn=False)


if __name__ == '__main__':
Expand Down

0 comments on commit 757e992

Please sign in to comment.