Skip to content
New issue

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

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

Already on GitHub? # to your account

Added E2E execution plan tests with coverage #18929

Merged
merged 40 commits into from
Mar 27, 2025

Conversation

laurennat
Copy link
Collaborator

@laurennat laurennat commented Mar 12, 2025

Set up playwright infrastructure for collecting coverage on react webviews and testing react webviews. There's also a few really minor changes to some Execution Plan react components, which just make it easier to playwright test them.

Screenshot 2025-03-12 124128

Copy link

github-actions bot commented Mar 12, 2025

PR Changes

Category Main Branch PR Branch Difference
Code Coverage 51.21% 53.18% $${\color{lightgreen} 1.97\% }$$
VSIX Size 13004 KB 12985 KB $${\color{lightgreen} -19 KB \space (0\%) }$$
Webview Bundle Size 3228 KB 3232 KB $${\color{lightgreen} 4 KB \space (0\%) }$$

@caohai
Copy link
Member

caohai commented Mar 13, 2025

This is also only for local testing.

Are you planning to add these tests to the CI pipeline in a seperate PR?

@laurennat
Copy link
Collaborator Author

Yes, I'm adding it in later

@aasimkhan30
Copy link
Contributor

Using the example, I was able to access elements inside the webviews. I opened the connection dialog, found the webview iframe, located the profile name field, and filled it in with a dummy profile name.

   const connectionDialogFrame = vsCodePage
        .frameLocator(".webview")
        .frameLocator("[title='Connection Dialog (Preview)']");

    if (connectionDialogFrame) {
        const inputField = connectionDialogFrame.getByLabel("Profile Name");
        await expect(inputField).toBeVisible({ timeout: 10000 });
        const isInputFieldVisible = await inputField.isVisible();
        if (isInputFieldVisible) {
            await inputField.fill("Server Name");
        }
    }

@caohai
Copy link
Member

caohai commented Mar 17, 2025

Using the example, I was able to access elements inside the webviews. I opened the connection dialog, found the webview iframe, located the profile name field, and filled it in with a dummy profile name.

   const connectionDialogFrame = vsCodePage
        .frameLocator(".webview")
        .frameLocator("[title='Connection Dialog (Preview)']");

    if (connectionDialogFrame) {
        const inputField = connectionDialogFrame.getByLabel("Profile Name");
        await expect(inputField).toBeVisible({ timeout: 10000 });
        const isInputFieldVisible = await inputField.isVisible();
        if (isInputFieldVisible) {
            await inputField.fill("Server Name");
        }
    }

This looks great!

@laurennat
Copy link
Collaborator Author

Using the example, I was able to access elements inside the webviews. I opened the connection dialog, found the webview iframe, located the profile name field, and filled it in with a dummy profile name.

   const connectionDialogFrame = vsCodePage
        .frameLocator(".webview")
        .frameLocator("[title='Connection Dialog (Preview)']");

    if (connectionDialogFrame) {
        const inputField = connectionDialogFrame.getByLabel("Profile Name");
        await expect(inputField).toBeVisible({ timeout: 10000 });
        const isInputFieldVisible = await inputField.isVisible();
        if (isInputFieldVisible) {
            await inputField.fill("Server Name");
        }
    }

This looks great!

I'll change the tests to this format! thanks for finding this

@Benjin
Copy link
Contributor

Benjin commented Mar 26, 2025

image

Do you know what's going on here?

@laurennat laurennat requested a review from aasimkhan30 March 26, 2025 20:43
@laurennat
Copy link
Collaborator Author

image

Do you know what's going on here?

This was fixed, but it couldn't overwrite the results because the pipeline was broken :( Now it's good though!

@laurennat
Copy link
Collaborator Author

@lewis-sanchez is merging for me because I still have the merge permissions issue

@lewis-sanchez lewis-sanchez merged commit faa30a0 into main Mar 27, 2025
5 checks passed
@lewis-sanchez lewis-sanchez deleted the laurennat/playwrightReactTesting branch March 27, 2025 22:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants