Skip to content

Commit 5c6a627

Browse files
committed
[E2E] Workbench tests with arguments hints are added
1 parent 887895e commit 5c6a627

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

tests/e2e/pageObjects/workbench-page.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export class WorkbenchPage {
4747
preselectGroupBy: Selector
4848
preselectArea: Selector
4949
expandArea: Selector
50+
monacoHintWithArguments: Selector
51+
noCommandHistorySection: Selector
5052

5153
constructor() {
5254
//CSS selectors
@@ -97,6 +99,8 @@ export class WorkbenchPage {
9799
this.monacoCloseCommandDetails = Selector('span.codicon-close');
98100
this.monacoSuggestion = Selector('span.monaco-icon-name-container');
99101
this.iframe = Selector('.pluginIframe', { timeout: 90000 });
102+
this.monacoHintWithArguments = Selector('[widgetid="editor.widget.parameterHintsWidget"]')
103+
this.noCommandHistorySection = Selector('[data-testid=wb_no-results]')
100104
// Panel
101105
this.preselectArea = Selector('[data-testid=enablementArea]');
102106
this.expandArea = Selector('[]')

tests/e2e/tests/regression/workbench/autocomplete.e2e.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,45 @@ test('Verify that user can open the "read more" about the command by clicking on
4949
await t.pressKey('ctrl+space');
5050
await t.expect(await workbenchPage.monacoCommandDetails.exists).notOk('The "read more" about the command is closed');
5151
});
52+
test('Verify that user can see static list of arguments is displayed when he enters the command in Editor in Workbench', async t => {
53+
const command = 'AI.SCRIPTEXECUTE'
54+
//Type the command in Editing area
55+
await t.typeText(workbenchPage.queryInput, command, { replace: true });
56+
//Check that no hints are displayed
57+
await t.expect(workbenchPage.monacoHintWithArguments.visible).notOk('Hints with arguments are not displayed yet')
58+
//Add space after the printed command
59+
const command_hint = 'AI.SCRIPTEXECUTE '
60+
await t.typeText(workbenchPage.queryInput, command_hint, { replace: true })
61+
//Check that hint with arguments are displayed
62+
await t.expect(workbenchPage.monacoHintWithArguments.visible).ok('Hints with arguments are displayed')
63+
});
64+
test('Verify that user can close the static list of arguments by pressing “ESC”', async t => {
65+
const command = 'TS.DELETERULE '
66+
await t.typeText(workbenchPage.queryInput, command, { replace: true })
67+
//Check that hint with arguments are displayed
68+
await t.expect(workbenchPage.monacoHintWithArguments.visible).ok('Hints with arguments are displayed')
69+
//Remove hints with arguments
70+
await t.pressKey('esc');
71+
//Check no hints are displayed
72+
await t.expect(workbenchPage.monacoHintWithArguments.visible).notOk('Hints with arguments are not displayed')
73+
});
74+
test('Verify that user can see the static list of arguments when he uses “Ctrl+Shift+Space” combination for already entered command for Windows', async t => {
75+
const command = 'JSON.ARRAPPEND'
76+
await t.typeText(workbenchPage.queryInput, command, { replace: true });
77+
//Verify that the list with auto-suggestions is displayed
78+
await t.expect(await workbenchPage.monacoSuggestion.exists).ok('Auto-suggestions are displayed');
79+
//Select the command from suggestion list
80+
await t.pressKey('enter');
81+
//Check that the command is displayed in Editing area after selecting
82+
const script = await workbenchPage.queryInputScriptArea.textContent;
83+
await t.expect(script.replace(/\s/g, ' ')).eql('JSON.ARRAPPEND key value ', 'Result of sent command exists');
84+
//Check that hint with arguments are displayed
85+
await t.expect(workbenchPage.monacoHintWithArguments.visible).ok('Hints with arguments are displayed')
86+
//Remove hints with arguments
87+
await t.pressKey('esc');
88+
//Check no hints are displayed
89+
await t.expect(workbenchPage.monacoHintWithArguments.visible).notOk('Hints with arguments are not displayed')
90+
//Check that using shortcut “Ctrl+Shift+Space” hints are displayed
91+
await t.pressKey('ctrl+shift+space');
92+
await t.expect(workbenchPage.monacoHintWithArguments.visible).ok('Hints with arguments are displayed')
93+
});

0 commit comments

Comments
 (0)