Skip to content

Commit 4761d6e

Browse files
committed
fix: update code from PR comments
1 parent c8bc42c commit 4761d6e

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

packages/amazonq/test/e2e_new/amazonq/tests/shortcut.test.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '../utils/generalUtils'
1515
import { closeAllTabs } from '../utils/cleanupUtils'
1616

17-
describe('Amazon Q Shortcut Functionality', function () {
17+
describe('Amazon Q Shortcut Functionality Tests', function () {
1818
// this timeout is the general timeout for the entire test suite
1919
this.timeout(150000)
2020
let workbench: Workbench
@@ -35,62 +35,46 @@ describe('Amazon Q Shortcut Functionality', function () {
3535
await closeAllTabs(webviewView)
3636
await clearChat(webviewView)
3737
})
38-
it('Keybind Check', async () => {
38+
it('Allows User to Verify Command Palette Works as Expected', async () => {
3939
const driver = webviewView.getDriver()
40-
// Open Command Palette
4140
await pressShortcut(driver, Key.COMMAND, Key.SHIFT, 'p')
4241
const input = new InputBox()
4342
await input.sendKeys('Preferences: Open Keyboard Shortcuts')
4443
await input.sendKeys(Key.ENTER)
4544
await editorView.closeAllEditors()
4645
await webviewView.switchToFrame()
4746
})
48-
it('Generate Test Keybind', async () => {
47+
it('Allows User to Generate Tests Using Keybind', async () => {
4948
await writeToTextEditor(textEditor, 'def fibonacci(n):')
5049
await textEditor.selectText('def fibonacci(n):')
5150

5251
const driver = webviewView.getDriver()
5352
await pressShortcut(driver, Key.COMMAND, Key.ALT, 't')
54-
// Clean Up Text
5553
await textEditor.clearText()
5654
await editorView.closeAllEditors()
5755
await webviewView.switchToFrame()
58-
const responseReceived = await waitForChatResponse(webviewView)
59-
if (!responseReceived) {
60-
throw new Error('Chat response not received within timeout')
61-
}
62-
console.log('Chat response detected successfully')
56+
await waitForChatResponse(webviewView)
6357
})
64-
it('Explain Code Shortcut', async () => {
58+
it('Allows User to Select and Explain Code Using Keybind', async () => {
6559
await writeToTextEditor(textEditor, 'def fibonacci(n):')
6660
await textEditor.selectText('def fibonacci(n):')
6761

6862
const driver = webviewView.getDriver()
6963
await pressShortcut(driver, Key.COMMAND, Key.ALT, 'e')
70-
// Clean Up Text
7164
await textEditor.clearText()
7265
await editorView.closeAllEditors()
7366
await webviewView.switchToFrame()
74-
const responseReceived = await waitForChatResponse(webviewView)
75-
if (!responseReceived) {
76-
throw new Error('Chat response not received within timeout')
77-
}
78-
console.log('Chat response detected successfully')
67+
await waitForChatResponse(webviewView)
7968
})
80-
it('Optimize Code Shortcut', async () => {
69+
it('Allows User to Optimize Code Using Keybind', async () => {
8170
await writeToTextEditor(textEditor, 'def fibonacci(n):')
8271
await textEditor.selectText('def fibonacci(n):')
8372

8473
const driver = webviewView.getDriver()
8574
await pressShortcut(driver, Key.COMMAND, Key.ALT, 'a')
86-
// Clean Up Text
8775
await textEditor.clearText()
8876
await editorView.closeAllEditors()
8977
await webviewView.switchToFrame()
90-
const responseReceived = await waitForChatResponse(webviewView)
91-
if (!responseReceived) {
92-
throw new Error('Chat response not received within timeout')
93-
}
94-
console.log('Chat response detected successfully')
78+
await waitForChatResponse(webviewView)
9579
})
9680
})

0 commit comments

Comments
 (0)