File tree Expand file tree Collapse file tree 4 files changed +50
-0
lines changed
Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ /*-----------------------------------------------------------------------------------------------
2+ * Copyright (c) Red Hat, Inc. All rights reserved.
3+ * Licensed under the MIT License. See LICENSE file in the project root for license information.
4+ *-----------------------------------------------------------------------------------------------*/
5+
6+ import { InputBox , Workbench } from 'vscode-extension-tester' ;
7+
8+ export async function activateCommand ( command : string ) {
9+ const prompt = await new Workbench ( ) . openCommandPrompt ( ) as InputBox ;
10+ await prompt . setText ( command ) ;
11+ await prompt . confirm ( ) ;
12+
13+ }
Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See LICENSE file in the project root for license information.
44 *-----------------------------------------------------------------------------------------------*/
55
6+ import { checkAboutCommand } from './suite/command-about' ;
67import { testDevfileRegistries } from './suite/devfileRegistries' ;
78import { checkExtension } from './suite/extension' ;
89import { checkOpenshiftView } from './suite/openshift' ;
910
1011describe ( 'Extension public-facing UI tests' , ( ) => {
1112 checkExtension ( ) ;
1213 checkOpenshiftView ( ) ;
14+ checkAboutCommand ( ) ;
1315 testDevfileRegistries ( ) ;
1416} ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import * as fs from 'fs-extra';
88import { checkExtension } from './suite/extension' ;
99import { checkOpenshiftView } from './suite/openshift' ;
1010import { createComponentTest } from './suite/component' ;
11+ import { checkAboutCommand } from './suite/command-about' ;
1112
1213describe ( 'Extension smoke test' , ( ) => {
1314 const kubeConfig = path . join ( process . env [ ( process . platform === 'win32' ) ? 'USERPROFILE' : 'HOME' ] , '.kube' , 'config' ) ;
@@ -32,4 +33,5 @@ describe('Extension smoke test', () => {
3233 checkExtension ( ) ;
3334 checkOpenshiftView ( ) ;
3435 createComponentTest ( contextFolder ) ;
36+ checkAboutCommand ( ) ;
3537} ) ;
Original file line number Diff line number Diff line change 1+ /*-----------------------------------------------------------------------------------------------
2+ * Copyright (c) Red Hat, Inc. All rights reserved.
3+ * Licensed under the MIT License. See LICENSE file in the project root for license information.
4+ *-----------------------------------------------------------------------------------------------*/
5+
6+ import { expect } from 'chai' ;
7+ import { TerminalView } from 'vscode-extension-tester' ;
8+ import { activateCommand } from '../common/command-activator' ;
9+
10+ export function checkAboutCommand ( ) {
11+ describe ( 'About Command' , ( ) => {
12+ const command = '>OpenShift: About' ;
13+ const expectedTerminalName = 'OpenShift: Show odo Version' ;
14+ const odoVersion = 'odo v3' ;
15+
16+ before ( async ( ) => {
17+ await activateCommand ( command ) ;
18+ } )
19+
20+ it ( 'New terminal opens' , async function ( ) {
21+ this . timeout ( 60000 ) ;
22+ await new Promise ( res => setTimeout ( res , 6000 ) ) ;
23+ const terminalName = await new TerminalView ( ) . getCurrentChannel ( ) ;
24+ expect ( terminalName ) . to . include ( expectedTerminalName ) ;
25+ } ) ;
26+
27+ it ( 'Terminal shows according information' , async function ( ) {
28+ this . timeout ( 60000 ) ;
29+ const terminalText = await new TerminalView ( ) . getText ( ) ;
30+ expect ( terminalText ) . to . include ( odoVersion ) ;
31+ } ) ;
32+ } ) ;
33+ }
You can’t perform that action at this time.
0 commit comments