Skip to content

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Randall-Jiang
Copy link
Contributor

@Randall-Jiang Randall-Jiang commented Mar 14, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Added end to end UI tests for /test workflow.

These tests cover:

  1. When user reject the generated unit test
  2. Check if progress bar has the correct text
  3. Check if the cancel button work correctly
  4. Check the customer facing error
  5. Check the feedback button show correctly
  6. Check if the input enable after user accpet/reject/cancel

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Randall-Jiang Randall-Jiang changed the title add e2e test for reject case fix(amazonq): Added end to end UI tests for /test workflow. Mar 20, 2025
@Randall-Jiang Randall-Jiang marked this pull request as ready for review March 20, 2025 00:05
@Randall-Jiang Randall-Jiang requested a review from a team as a code owner March 20, 2025 00:05
Comment on lines 696 to 720
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;
Copy link
Contributor

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

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTest

@Randall-Jiang
Copy link
Contributor Author

/runUiTest

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

1 similar comment
@Randall-Jiang
Copy link
Contributor Author

/runUiTests

@Randall-Jiang
Copy link
Contributor Author

/runUiTests

Comment on lines 697 to 713
// 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');
// }
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants