-
Notifications
You must be signed in to change notification settings - Fork 251
fix(amazonq): Added end to end UI tests for /test workflow. #5476
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: main
Are you sure you want to change the base?
Conversation
async function waitForElementWithText(page, text) { | ||
await page.waitForFunction( | ||
(expectedText) => { | ||
const elements = document.querySelectorAll('*'); | ||
return Array.from(elements).find(element => | ||
element.textContent?.trim() === expectedText | ||
); | ||
}, | ||
{}, | ||
text | ||
); | ||
} | ||
|
||
async function waitAndGetElementByText(page, text) { | ||
const element = await page.waitForFunction( | ||
(expectedText) => { | ||
const elements = document.querySelectorAll('*'); | ||
return Array.from(elements).find(element => | ||
element.textContent?.trim() === expectedText | ||
); | ||
}, | ||
{}, | ||
text | ||
); | ||
return element; |
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.
these functions can be abstracted out and used as utils
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTest |
/runUiTest |
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTests |
/runUiTests |
1 similar comment
/runUiTests |
/runUiTests |
// const feedbackButton = await page.waitForFunction( | ||
// (expectedText) => { | ||
// const buttons = document.querySelectorAll('button'); | ||
// return Array.from(buttons).find(button => | ||
// button.textContent.includes(expectedText) | ||
// ); | ||
// }, | ||
// { timeout: 4000000 }, | ||
// "How can we make /test better" | ||
// ); | ||
// | ||
// if (feedbackButton){ | ||
// console.log("Feedback button found with correct text after error") | ||
// }else{ | ||
// console.log("Feedback button not found") | ||
// throw new Error('Feedback button not found'); | ||
// } |
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.
can you please remove this code?
Types of changes
Description
Added end to end UI tests for /test workflow.
These tests cover:
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.