16.path_deploy.py 739 B

1234567891011121314151617181920212223242526272829
  1. import os
  2. import subprocess
  3. from percy import percySnapshot
  4. from selenium.webdriver import Chrome
  5. import util
  6. from pywebio.platform import path_deploy
  7. from pywebio.utils import *
  8. def test(server_proc: subprocess.Popen, browser: Chrome):
  9. time.sleep(10)
  10. percySnapshot(browser, name='path_deploy_1')
  11. time.sleep(2)
  12. browser.get('http://localhost:8080/')
  13. time.sleep(2)
  14. percySnapshot(browser, name='path_deploy_index')
  15. time.sleep(2)
  16. def start_test_server():
  17. here_dir = os.path.dirname(os.path.abspath(__file__))
  18. path_deploy(here_dir + '/../demos', port=8080, host='127.0.0.1', cdn=False)
  19. if __name__ == '__main__':
  20. util.run_test(start_test_server, test, address='http://localhost:8080/bokeh_app')