author | Edouard Tisserant <edouard.tisserant@gmail.com> |
Fri, 11 Mar 2022 14:43:37 +0100 | |
branch | wxPython4 |
changeset 3438 | 24fbd4d1fe80 |
parent 3436 | ccaabb9da623 |
child 3446 | de8cc85b688a |
permissions | -rw-r--r-- |
3436
ccaabb9da623
Tests: add an IDE test that relies on image matching.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3432
diff
changeset
|
1 |
""" This test opens, builds and runs a new project. |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
2 |
Test succeeds if runtime's stdout behaves as expected |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
3 |
""" |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
4 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
5 |
import os |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
6 |
import time |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
7 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
8 |
# allow module import from current test directory's parent |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
9 |
addImportPath(os.path.dirname(getBundlePath())) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
10 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
11 |
# common test definitions module |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
12 |
from sikuliberemiz import * |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
13 |
|
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
14 |
# Start the app without any project given |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
15 |
proc,app = StartBeremizApp() |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
16 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
17 |
new_project_path = os.path.join(os.path.abspath(os.path.curdir), "new_test_project") |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
18 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
19 |
# New project path must exist (usually created in directory selection dialog) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
20 |
os.mkdir(new_project_path) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
21 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
22 |
# To detect when actions did finish because IDE content isn't changing |
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
23 |
idle = IDEIdleObserver(app) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
24 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
25 |
# To send keyboard shortuts |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
26 |
k = KBDShortcut(app) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
27 |
|
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
28 |
idle.Wait(1,15) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
29 |
|
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
30 |
# Create new project (opens new project directory selection dialog) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
31 |
k.New() |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
32 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
33 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
34 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
35 |
# Move to "Home" section of file selecor, otherwise address is |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
36 |
# "file ignored" at first run |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
37 |
type("f", Key.CTRL) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
38 |
type(Key.ESC) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
39 |
type(Key.TAB) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
40 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
41 |
# Enter directory by name |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
42 |
k.Address() |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
43 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
44 |
# Fill address bar |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
45 |
type(new_project_path + Key.ENTER) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
46 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
47 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
48 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
49 |
# When prompted for creating first program select type ST |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
50 |
type(Key.TAB*4) # go to lang dropdown |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
51 |
type(Key.DOWN*2) # change selected language |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
52 |
type(Key.ENTER) # validate |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
53 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
54 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
55 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
56 |
# Name created program |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
57 |
type("Test program") |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
58 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
59 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
60 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
61 |
# Focus on Variable grid |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
62 |
type(Key.TAB*4) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
63 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
64 |
# Add 2 variables |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
65 |
type(Key.ADD*2) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
66 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
67 |
# Focus on ST text |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
68 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
69 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
70 |
type(Key.TAB*8) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
71 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
72 |
type("""\ |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
73 |
LocalVar0 := LocalVar1; |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
74 |
{printf("Test OK\\n");fflush(stdout);} |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
75 |
""") |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
76 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
77 |
k.Save() |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
78 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
79 |
# Close ST POU |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
80 |
type("w", Key.CTRL) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
81 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
82 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
83 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
84 |
# Focus project tree and select root item |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
85 |
type(Key.TAB) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
86 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
87 |
type(Key.LEFT) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
88 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
89 |
type(Key.UP) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
90 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
91 |
# Edit root item |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
92 |
type(Key.ENTER) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
93 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
94 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
95 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
96 |
# Switch to config tab |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
97 |
type(Key.RIGHT*2) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
98 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
99 |
# Focus on URI |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
100 |
type(Key.TAB) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
101 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
102 |
# Set URI |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
103 |
type("LOCAL://") |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
104 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
105 |
# FIXME: Select other field to ensure URI is validated |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
106 |
type(Key.TAB) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
107 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
108 |
k.Save() |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
109 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
110 |
# Close project config editor |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
111 |
type("w", Key.CTRL) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
112 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
113 |
idle.Wait(1,15) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
114 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
115 |
# Focus seems undefined at that time (FIXME) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
116 |
# Force focussing on "something" so that next shortcut is taken |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
117 |
type(Key.TAB) |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
118 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
119 |
del idle |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
120 |
|
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
121 |
stdoutIdle = stdoutIdleObserver(proc) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
122 |
stdoutIdle.Wait(2,15) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
123 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
124 |
k.Build() |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
125 |
|
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
126 |
stdoutIdle.Wait(5,15) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
127 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
128 |
k.Connect() |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
129 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
130 |
stdoutIdle.Wait(2,15) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
131 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
132 |
k.Transfer() |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
133 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
134 |
stdoutIdle.Wait(2,15) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
135 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
136 |
del stdoutIdle |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
137 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
138 |
k.Run() |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
139 |
|
3432
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
140 |
# wait 10 seconds |
40b8b2ffb3fd
Tests: Various enhancements in Makefile and sikuli common python code.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
3424
diff
changeset
|
141 |
found = waitPatternInStdout(proc, "Test OK", 10) |
3424
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
142 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
143 |
app.close() |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
144 |
|
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
145 |
if found: |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
146 |
exit(0) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
147 |
else: |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
148 |
exit(1) |
7db96e011fe7
Tests: added tests/Makefile and a first test in tests/ide_tests. Test requires sikuli and Xvfb or Xnest.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff
changeset
|
149 |