Skip to content

Conversation

@gandhi-21
Copy link
Contributor

@gandhi-21 gandhi-21 commented Mar 4, 2025

Types of changes

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

Description

Add UI tests to validate the Update an existing README flow
Created a sample repository from scratch,
For Update README to reflect code flow, there are 3 tests which confirm that the user is

  1. Shown the option to confirm / change folder / cancel on selecting the update options
  2. Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
  3. The Readme updates with the latest changes

For Make a specific change flow, there are 2 tests which confirm that the user is

  1. Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
  2. The Readme is updated with the specific changes requested

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.

@gandhi-21 gandhi-21 changed the title test(qdoc) Add tests for QDoc latest code changes flow test(qdoc) Add tests for qdoc update readme flow Mar 4, 2025
@gandhi-21 gandhi-21 closed this Mar 4, 2025
@gandhi-21 gandhi-21 reopened this Mar 4, 2025
@gandhi-21 gandhi-21 changed the title test(qdoc) Add tests for qdoc update readme flow test(qdoc): Add tests for qdoc update readme flow Mar 4, 2025
@gandhi-21 gandhi-21 closed this Mar 4, 2025
@gandhi-21 gandhi-21 reopened this Mar 4, 2025
@gandhi-21 gandhi-21 marked this pull request as ready for review March 4, 2025 21:29
@gandhi-21 gandhi-21 requested a review from a team as a code owner March 4, 2025 21:29
@gandhi-21 gandhi-21 force-pushed the doc branch 2 times, most recently from 56730c2 to 8cc8c6d Compare March 6, 2025 16:21
@gandhi-21 gandhi-21 changed the title test(qdoc): Add tests for qdoc update readme flow test(qdoc): Add ui tests for qdoc update readme flow Mar 11, 2025
@gandhi-21 gandhi-21 enabled auto-merge (squash) March 12, 2025 19:17
@gandhi-21
Copy link
Contributor Author

/retryBuilds

Comment on lines +126 to +139
const contents = await page.evaluate(el => el.innerHTML, await page.${'$'}(':root'));

const element = await page.${'$'}('.mynah-chat-prompt-input');
if(element) {

console.log('Typing /doc in the chat window');

await page.type('.mynah-chat-prompt-input', '/doc');
await page.keyboard.press('Enter');

console.log('Attempting to find and click Update an existing README button');
await findAndClickButton(page, 'Update an existing README', true, 10000);
console.log('Attempting to find and click Update README to reflect code button');
await findAndClickButton(page, 'Update README to reflect code', true, 10000);
Copy link
Contributor

Choose a reason for hiding this comment

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

These few lines appear to be repeated in most tests, can they be abstracted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

abstracting parts of the testing flow can cause issues while trying to read and debug code for someone unfamiliar. So we should keep testing scripts as is to understand what's happening in the test without needing to jump around.

package software.aws.toolkits.jetbrains.uitests.docTests.scripts

// language=TS
val findAndClickButtonScript = """
Copy link
Contributor

Choose a reason for hiding this comment

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

This is awesome! Maybe could be moved to a common utils file so other teams can also use it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, doesn't seem blocking though, i can do that in a followup

@gandhi-21
Copy link
Contributor Author

/runUiTests

@gandhi-21 gandhi-21 merged commit 36e6a34 into aws:main Mar 14, 2025
13 of 18 checks passed
gandhi-21 pushed a commit to gandhi-21/aws-toolkit-jetbrains that referenced this pull request Mar 17, 2025
gandhi-21 pushed a commit to gandhi-21/aws-toolkit-jetbrains that referenced this pull request Mar 17, 2025
leigaol pushed a commit to leigaol/aws-toolkit-jetbrains that referenced this pull request Mar 17, 2025
Add UI tests to validate the Update an existing README flow
Created a sample repository from scratch,
For Update README to reflect code flow, there are 3 tests which confirm that the user is

    Shown the option to confirm / change folder / cancel on selecting the update options
    Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
    The Readme updates with the latest changes

For Make a specific change flow, there are 2 tests which confirm that the user is

    Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
    The Readme is updated with the specific changes requested


* test(qdoc): initial tests for latest code changes flow

* update tstData to test

* update scripts + move test data to subfolder for update readme tests

* update instructions in update readme with specific changes test

* update base readme for testing the update readme flow

* update test assertions for q doc update flow tests

* separate out test cases into individual tests

* remove gradle settings file for q doc update flow test repo

* log result from scripts for debugging

* manually restore readme after each test run

* add end of assertions println for debugging + update readme

* update q tests config for debugging

* update config and rename dummy repo files for create readme tests

* update build file for create readme tests sample repo

* update to print the result on failures only

* remove unused file from test dummy repo

---------

Co-authored-by: Gaurav Gandhi <[email protected]>
leigaol pushed a commit to leigaol/aws-toolkit-jetbrains that referenced this pull request Mar 20, 2025
Add UI tests to validate the Update an existing README flow
Created a sample repository from scratch,
For Update README to reflect code flow, there are 3 tests which confirm that the user is

    Shown the option to confirm / change folder / cancel on selecting the update options
    Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
    The Readme updates with the latest changes

For Make a specific change flow, there are 2 tests which confirm that the user is

    Shown the Update with specific changes flow when selecting Make Changes upon getting updated readme back
    The Readme is updated with the specific changes requested


* test(qdoc): initial tests for latest code changes flow

* update tstData to test

* update scripts + move test data to subfolder for update readme tests

* update instructions in update readme with specific changes test

* update base readme for testing the update readme flow

* update test assertions for q doc update flow tests

* separate out test cases into individual tests

* remove gradle settings file for q doc update flow test repo

* log result from scripts for debugging

* manually restore readme after each test run

* add end of assertions println for debugging + update readme

* update q tests config for debugging

* update config and rename dummy repo files for create readme tests

* update build file for create readme tests sample repo

* update to print the result on failures only

* remove unused file from test dummy repo

---------

Co-authored-by: Gaurav Gandhi <[email protected]>
gandhi-21 pushed a commit to gandhi-21/aws-toolkit-jetbrains that referenced this pull request Mar 21, 2025
gandhi-21 added a commit that referenced this pull request Mar 21, 2025
* move findAndClickButton to common ScriptUtils & update script syntax to JS (followups from #5435)

* initial commit: add qdoc create readme tests

---------

Co-authored-by: Gaurav Gandhi <[email protected]>
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.

4 participants