File tree Expand file tree Collapse file tree 3 files changed +73
-16
lines changed Expand file tree Collapse file tree 3 files changed +73
-16
lines changed Original file line number Diff line number Diff line change 1
- name : Voila test
1
+ name : screenshot comparison
2
2
3
3
on :
4
4
push :
9
9
- ' *'
10
10
11
11
jobs :
12
- voila :
12
+ check-screenshot :
13
+ name : Check Screenshot
13
14
runs-on : ubuntu-latest
14
15
steps :
15
16
- name : Checkout
16
- uses : actions/checkout@v2
17
+ uses : actions/checkout@v4
17
18
- name : Install node
18
- uses : actions/setup-node@v1
19
+ uses : actions/setup-node@v4
19
20
with :
20
- node-version : ' 18 .x'
21
+ node-version : ' 21 .x'
21
22
- name : Install Python
22
- uses : actions/setup-python@v2
23
+ uses : actions/setup-python@v5
23
24
with :
24
- python-version : ' 3.9 '
25
+ python-version : ' 3.11 '
25
26
architecture : ' x64'
26
27
- name : Install dependencies
27
28
run :
28
29
pip install --upgrade pip
29
30
pip install --upgrade jupyterlab
30
31
pip install --upgrade voila
31
32
pip install --upgrade voila-osscar-template
32
- pip install --upgrade ase
33
33
pip install -e .
34
34
35
35
- name : Run the voila server
45
45
chromedriver --url-base=/wd/hub &
46
46
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
47
47
python3 $GITHUB_WORKSPACE/test/test.py
48
-
49
- - uses : actions/upload-artifact@v2
50
- with :
51
- name : quantum-screenshot
52
- path : ' ./*.png'
53
-
54
- - name : Run the figures test
55
- run : |
56
48
python3 $GITHUB_WORKSPACE/test/test_figures.py
57
49
Original file line number Diff line number Diff line change
1
+ name : widget test
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' *'
7
+ pull_request :
8
+ branches :
9
+ - ' *'
10
+
11
+ jobs :
12
+ check-elements :
13
+ name : Check Element
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v4
18
+ - name : Install node
19
+ uses : actions/setup-node@v4
20
+ with :
21
+ node-version : ' 21.x'
22
+ - name : Install Python
23
+ uses : actions/setup-python@v5
24
+ with :
25
+ python-version : ' 3.11'
26
+ architecture : ' x64'
27
+ - name : Install dependencies
28
+ run :
29
+ pip install --upgrade pip
30
+ pip install --upgrade jupyterlab
31
+ pip install --upgrade voila
32
+ pip install --upgrade voila-osscar-template
33
+ pip install -e .
34
+
35
+ - name : Run the voila server
36
+ run : |
37
+ voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser &
38
+ pip install --upgrade pytest
39
+ pip install --upgrade selenium
40
+ pip install --upgrade Pillow
41
+
42
+ - uses : nanasess/setup-chromedriver@master
43
+ - run : |
44
+ export DISPLAY=:99
45
+ chromedriver --url-base=/wd/hub &
46
+ sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
47
+ python3 $GITHUB_WORKSPACE/test/test.py
48
+
49
+ - uses : actions/upload-artifact@v4
50
+ with :
51
+ name : artifact
52
+ path : ' ./*.png'
53
+
Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ def setup_method(self, method):
23
23
def teardown_method (self , method ):
24
24
self .driver .quit ()
25
25
26
+ def test_elements (self ):
27
+ self .driver .get ("http://localhost:8383/voila/render/example.ipynb" )
28
+ self .driver .set_window_size (1280 , 1080 )
29
+ time .sleep (3 )
30
+
31
+ try :
32
+ self .driver .find_element (By .CLASS_NAME , 'bz-canvas3d' )
33
+ print ("Brillouin zone visualizer is fund!" )
34
+ except :
35
+ raise Exception ("The visualizer is NOT found!!!" )
36
+
26
37
def download_widget_image (self ):
27
38
self .driver .get ("http://localhost:8383/voila/render/example.ipynb" )
28
39
self .driver .set_window_size (1280 , 720 )
@@ -35,5 +46,6 @@ def download_widget_image(self):
35
46
test = test_widget ()
36
47
test .setup_method ('Chrome' )
37
48
test .download_widget_image ()
49
+ test .test_elements ()
38
50
test .teardown_method ('Chrome' )
39
51
You can’t perform that action at this time.
0 commit comments