Skip to content

[AXON-453] Add E2E Test for Assigning Jira Issue to Self #474

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 1 commit into
base: main
Choose a base branch
from

Conversation

sspanchenko
Copy link
Collaborator

@sspanchenko sspanchenko commented Jun 18, 2025

What Is This Change?

Added a complete end-to-end Playwright test to verify that a user can assign themselves to a Jira issue via the assignee field inside the webview iframe.
✅ Selecting a Jira issue from the sidebar
✅ Opening the issue tab inside iframe
✅ Verifying the current assignee ("Mocked McMock")
✅ Clearing the assignee field
✅ Typing into the assignee field to trigger the suggestions dropdown
✅ Selecting the user from the dropdown
✅ Verifying the user is assigned again

Result video

video.webm

},
"fields": {
"equalTo": "*all"
"contains": "transitions"
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

During implementation, the existing bts1.json mock didn't work correctly for the assign-to-self flow — specifically, the mocked endpoint for fetching issue details failed due to an invalid URL (it included a space) and unexpected query parameters. I fixed it by removing the query parameters from the URL path and correcting the broken link. If there's a cleaner or more accurate way to handle this setup, happy to take suggestions. Thanks!

@sspanchenko sspanchenko changed the title AXON-453: Add E2E Test for Assigning Jira Issue to Self [AXON-453] Add E2E Test for Assigning Jira Issue to Self Jun 18, 2025
await settingsFrame.getByLabel('Password (API token)').fill('12345');
await settingsFrame.getByRole('button', { name: 'Save Site' }).click();

await page.waitForTimeout(250);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Locally this test is failing for me because this timeout is too short. Let's make it 2000

@marcomura
Copy link
Collaborator

marcomura commented Jun 22, 2025

Thanks for this test. This is a good starting point, but as is this test is not really re-assigning the ticket to anybody else.

To actually exercise the code, this test should:

  1. assign the issue to someone else
  2. verify that the issue disappears from the left panel (assigned to me)
  3. re-assign it again to me
  4. verify that the issue appeared again from the left panel
  5. Close and re-open the Jira issue to see the new assignee is correctly showing in the webview

To achieve this, you must be able to change the mocked data on the fly.
E.g.,

  • when fetching BTS-1 it should be first assigned to me,
  • then, after re-assigning it, when fetching BTS-1 it should be assigned to someone else,
  • then, after re-assinging it, when fetching BTS-1 it should be assigned to me again.

Check if you can programmatically add/modify mocks via these APIs:
https://wiremock.org/3.x/docs/standalone/admin-api-reference/#tag/Stub-Mappings

Copy link
Collaborator

@marcomura marcomura left a comment

Choose a reason for hiding this comment

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

see comment

@sspanchenko sspanchenko changed the title [AXON-453] Add E2E Test for Assigning Jira Issue to Self [WIP][AXON-453] Add E2E Test for Assigning Jira Issue to Self Jun 30, 2025
@sspanchenko sspanchenko force-pushed the AXON-453-assign-to-me-e2e branch 6 times, most recently from eed5d68 to 2baf89c Compare July 3, 2025 11:20
@sspanchenko sspanchenko force-pushed the AXON-453-assign-to-me-e2e branch from b4d2626 to 360b9de Compare July 3, 2025 14:57
@sspanchenko sspanchenko changed the title [WIP][AXON-453] Add E2E Test for Assigning Jira Issue to Self [AXON-453] Add E2E Test for Assigning Jira Issue to Self Jul 3, 2025
// First, let's try to find the iframe by waiting for it to be visible
const webviewFrame = page.frameLocator('iframe.webview');
// Try multiple possible iframe titles/selectors
const possibleSelectors = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took it from here so I don't have trouble finding the iframe either

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