Skip to content

feat(amazonq): Quick actions E2E UI tests and update to quickActionsHelper #7831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: feature/ui-e2e-tests
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function getQuickActionsCommands(webview: WebviewView): Promise<{ i
const menuItems = await waitForElements(
webview,
By.css('.mynah-detailed-list-item.mynah-ui-clickable-item.target-command'),
10000
100

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100 miliseconds is 0.1 seconds, is it worth putting a timeout for so little time?

)

const menuTexts = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ describe('Amazon Q Chat Quick Actions Functionality', function () {
await clearChat(webviewView)
})

it('Quick Actions Test', async () => {
it('/dev Test', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what behavior are these tests verifying? I would try to make it clear in the name. For example, /doc is in the quickActions menu.

Also, you could avoid some overhead by iterating through a list of these strings and creating a test for each one.
Ex.

for (const command of ['doc', 'transform', 'test', 'review']) {
   it(`quick action menu includes ${command}`, async function () {
      ...
    }
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a really good idea, didn't think of that. Will implement!

await clickQuickActionsCommand(webviewView, 'dev')
})
it('/doc Test', async () => {
await clickQuickActionsCommand(webviewView, 'doc')
})
it('/transform Test', async () => {
await clickQuickActionsCommand(webviewView, 'transform')
})
it('/test Test', async () => {
await clickQuickActionsCommand(webviewView, 'test')
})
it('/review Test', async () => {
await clickQuickActionsCommand(webviewView, 'review')
})
})
Loading