-
Notifications
You must be signed in to change notification settings - Fork 682
feat(amazonq): Add Pin Context Tests and Update to pinContextHelper #7829
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
base: feature/ui-e2e-tests
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
looks like we need to rebase the latest changes based on the github actions |
feature --> feat
|
export async function getSubMenuItems(webview: WebviewView): Promise<{ items: WebElement[]; labels: string[] }> { | ||
try { | ||
const menuList = await waitForElement(webview, By.css('.mynah-detailed-list-items-block')) | ||
await sleep(3000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this additional sleep needed?
console.log('Menu item found:', labelText) | ||
} catch (e) { | ||
labels.push('') | ||
console.log('Could not get text for menu item') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we fail here? If we can't find an item in the menu isn't that indicative of a bug?
|
||
return { items: menuListItems, labels } | ||
} catch (e) { | ||
console.error('Error getting Pin Context menu items:', e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question here.
export async function clickSubMenuItem(webview: WebviewView, itemName: string): Promise<boolean> { | ||
try { | ||
const menuList = await waitForElement(webview, By.css('.mynah-detailed-list-items-block')) | ||
await sleep(3000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this sleep needed? Shouldn't it be covered by waitForElement?
return true | ||
} | ||
} catch (e) { | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above about errors.
console.log(`Pin Context menu item not found: ${itemName}`) | ||
return false | ||
} catch (e) { | ||
console.error(`Error clicking Pin Context menu item ${itemName}:`, e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails I think we should throw instead of returning a boolean.
await createPrompt.click() | ||
await clickPinContextButton(webviewView) | ||
await clickPinContextMenuItem(webviewView, 'Prompts') | ||
await clickSubMenuItem(webviewView, 'test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my understanding is that this returns a boolean false if it fails, but this won't cause the test to fail.
await clickPinContextMenuItem(webviewView, '@workspace') | ||
}) | ||
it('Prompts Context Test', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same idea before on test labels.
Problem
We have yet to implement the initial P0 Pin Context Tests. The pinContextHelper does not mesh well with sub menu items when clicking through different prompts to use.
Solution
I have implemented the File Context and Prompt Context Test. The Pin Context test with the @workspace was previously implemented. I have implemented the helpers: getSubMenuItems and clickSubMenuItem in the pinContextHelper. All tests still run together.
Test Suite:
feature/x
branches will not be squash-merged at release time.