Faculty of Information Technology
Software Engineering Group

Ticket #280: MnemonicTests.st

File MnemonicTests.st, 1.9 KB (added by Patrik Svestka, 16 months ago)

test for mnemonic shortcut

Line 
1'From Smalltalk/X jv-branch, Version:8.0.99.0 on 21-05-2019 at 02:03:29 PM'     !
2
3"{ Package: 'stx:libview/tests' }"
4
5"{ NameSpace: Smalltalk }"
6
7TestCase subclass:#MnemonicTests
8        instanceVariableNames:'browser browserInteractor'
9        classVariableNames:''
10        poolDictionaries:''
11        category:'TestCases'
12!
13
14!MnemonicTests class methodsFor:'documentation'!
15
16documentation
17"
18    documentation to be added.
19
20    [author:]
21        svestkap
22
23    [instance variables:]
24
25    [class variables:]
26
27    [see also:]
28
29"
30! !
31
32!MnemonicTests methodsFor:'initialize / release'!
33
34setUp
35   
36    Screen current isNil ifTrue:[
37        Smalltalk openDisplay.
38    ].
39    self skipIf:Screen current isNil description:'No display connection'.
40    Smalltalk loadPackage:'stx:goodies/sunit/ext/ui'.
41    super setUp.
42
43    browser := Tools::NewSystemBrowser new.
44    browser open.
45    browserInteractor := browser interactor.
46
47    "Modified: / 21-05-2019 / 13:38:24 / svestkap"
48!
49
50tearDown
51    "common cleanup - invoked after testing."
52
53    browser closeDownViews.
54    browser := browserInteractor := nil.
55
56    "Modified: / 21-05-2019 / 13:39:26 / svestkap"
57! !
58
59!MnemonicTests methodsFor:'tests'!
60
61test_openAdditionalTabViaMnemonicShorcut
62    "Open a new tab in a Brower via mnemonic shortcut"
63
64    browserInteractor type: #Cmdu. "/ should do alt u on File menu/Buffers
65    browserInteractor type: #CursorDown. "/ move to 'Add Page'
66    browserInteractor type: #Return. "/ there should be two tabs opened now
67    self assert: (browser bufferNameList) size = 2.
68   
69    browserInteractor type: #Ctrlt.  "/ opens a new tab in the browser
70    self assert: (browser bufferNameList) size = 3.
71   
72    "
73     self run:#openAdditionalTabViaMnemonicShorcut
74     self new openAdditionalTabViaMnemonicShorcut
75    "
76
77    "Created: / 21-05-2019 / 13:58:55 / svestkap"
78! !
79