10 |
10 |
11 # common test definitions module |
11 # common test definitions module |
12 from sikuliberemiz import * |
12 from sikuliberemiz import * |
13 |
13 |
14 # Start the app |
14 # Start the app |
15 proc,app = StartBeremizApp(exemple="python") |
15 app = BeremizApp(exemple="python") |
16 |
16 |
17 # To detect when actions did finish because IDE content isn't changing |
17 app.doubleClick("1646062660770.png") |
18 idle = IDEIdleObserver(app) |
|
19 |
18 |
20 doubleClick("1646062660770.png") |
19 app.WaitIdleUI() |
21 |
20 |
22 idle.Wait(1,15) |
21 app.click("example") |
23 |
22 |
24 click("example") |
23 app.WaitIdleUI() |
25 |
24 |
26 idle.Wait(1,15) |
25 app.type(Key.DOWN * 10, Key.CTRL) |
27 |
26 |
28 type(Key.DOWN * 10, Key.CTRL) |
27 app.WaitIdleUI() |
29 |
28 |
30 idle.Wait(1,15) |
29 app.doubleClick("1646066996620.png") |
31 |
30 |
32 doubleClick("1646066996620.png") |
31 app.WaitIdleUI() |
33 |
32 |
34 idle.Wait(1,15) |
33 app.type(Key.TAB*3) # select text content |
35 |
34 |
36 type(Key.TAB*3) # select text content |
35 app.type("'sys.stdout.write(\"EDIT TEST OK\\n\")'") |
37 |
36 |
38 type("'sys.stdout.write(\"EDIT TEST OK\\n\")'") |
37 app.type(Key.ENTER) |
39 |
38 |
40 type(Key.ENTER) |
39 app.WaitIdleUI() |
41 |
40 |
42 idle.Wait(1,15) |
41 app.k.Save() |
43 |
42 |
44 k = KBDShortcut(app) |
43 app.k.Clean() |
45 |
44 |
46 k.Save() |
45 app.waitForChangeAndIdleStdout() |
47 |
46 |
48 del idle |
47 app.k.Build() |
49 |
48 |
50 stdoutIdle = stdoutIdleObserver(proc) |
49 app.waitForChangeAndIdleStdout() |
51 |
50 |
52 k.Clean() |
51 app.k.Connect() |
53 |
52 |
54 stdoutIdle.WaitForChangeAndIdle(2,15) |
53 app.waitForChangeAndIdleStdout() |
55 |
54 |
56 k.Build() |
55 app.k.Transfer() |
57 |
56 |
58 stdoutIdle.WaitForChangeAndIdle(2,15) |
57 app.waitForChangeAndIdleStdout() |
59 |
58 |
60 k.Connect() |
59 app.k.Run() |
61 |
60 |
62 stdoutIdle.WaitForChangeAndIdle(2,15) |
61 # wait 10 seconds for 10 patterns |
63 |
62 found = app.waitPatternInStdout("EDIT TEST OK", 10) |
64 k.Transfer() |
|
65 |
|
66 stdoutIdle.WaitForChangeAndIdle(2,15) |
|
67 |
|
68 del stdoutIdle |
|
69 |
|
70 k.Run() |
|
71 |
|
72 # wait 10 seconds for 10 Grumpfs |
|
73 found = waitPatternInStdout(proc, "EDIT TEST OK", 10) |
|
74 |
63 |
75 app.close() |
64 app.close() |
76 |
65 |
77 if found: |
66 if found: |
78 exit(0) |
67 exit(0) |