Skip to content
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

JPERF-1053 Deprecate and stop using Issue.id #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ Dropping a requirement of a major version of a dependency is a new contract.

### Fixed
- Stop expecting a single iframe on `DashboardPage`. Fix [JPERF-149].
- Stop using Issue.id to identify issues in `IssueNavigatorPage`. Fix [JPERF-1053].

[JPERF-149]: https://ecosystem.atlassian.net/browse/JPERF-149
[JPERF-1053]: https://ecosystem.atlassian.net/browse/JPERF-1053

## [3.21.2] - 2023-08-03
[3.21.2]: https://github.com/atlassian/jira-actions/compare/release-3.21.1...release-3.21.2
Expand Down Expand Up @@ -74,6 +76,7 @@ Dropping a requirement of a major version of a dependency is a new contract.

[JPERF-1088]: https://ecosystem.atlassian.net/browse/JPERF-1088


## [3.20.2] - 2023-04-04
[3.20.2]: https://github.com/atlassian/jira-actions/compare/release-3.20.1...release-3.20.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,32 @@ data class WebJira(
return BrowseProjectsPage(driver)
}

@Deprecated("Use goToCommentForm(String) instead")
fun goToCommentForm(
issueId: Long
): CommentForm {
navigateTo("secure/AddComment!default.jspa?id=$issueId")
return CommentForm(driver)
}

fun goToCommentForm(
issueKey: String
): CommentForm {
navigateTo("secure/AddComment!default.jspa?key=$issueKey")
return CommentForm(driver)
}

@Deprecated("Use gotoEditIssue(String) instead")
fun goToEditIssue(issueId: Long): EditIssuePage {
navigateTo("secure/EditIssue!default.jspa?id=$issueId")
return EditIssuePage(driver)
}

fun goToEditIssue(issueKey: String): EditIssuePage {
navigateTo("secure/EditIssue!default.jspa?id=$issueKey")
return EditIssuePage(driver)
}

fun getJiraNode(): String {
return driver.findElement(By.id("footer-build-information")).text
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class AddCommentAction(
return
}
meter.measure(ADD_COMMENT) {
val commentForm = jira.goToCommentForm(issue.id).waitForButton().enterCommentText("SNARKY REMARK")
val commentForm = jira.goToCommentForm(issue.key).waitForButton().enterCommentText("SNARKY REMARK")
meter.measure(ADD_COMMENT_SUBMIT) {
commentForm.submit().waitForSummary()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class EditIssueAction(
}
meter.measure(EDIT_ISSUE) {
val editIssueForm = jira
.goToEditIssue(issue.id)
.goToEditIssue(issue.key)
.waitForEditIssueForm()
.fillForm()
meter.measure(
Expand All @@ -36,4 +36,4 @@ class EditIssueAction(
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ class ViewIssueAction private constructor(
val issuePage = meter.measure(
key = VIEW_ISSUE,
action = { jira.goToIssue(issueKey).waitForSummary() },
observation = { page ->
observation = { _ ->
Json.createObjectBuilder()
.add("issueKey", issueKey)
.add("issueId", page.getIssueId())
.build()
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package com.atlassian.performance.tools.jiraactions.api.memories

data class Issue(
val key: String,
@Deprecated("Use Issue.key instead")
val id: Long,
val type: String,
val editable: Boolean
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ open class IssueNavigatorPage(
return IssuePage(driver)
}

@Deprecated("Do not use it. IssueId is no longer supported")
fun selectedIssueId(): Long {
return IssuePage(driver).getIssueId()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class IssuePage(
return driver.findElement(By.cssSelector("#description-val .user-content-block")).text
}

@Deprecated("Do not use it. IssueId is not supported anymore")
fun getIssueId(): Long = driver.findElement(By.id("key-val")).getAttribute("rel").toLong()
fun getIssueType(): String = driver.findElement(By.id("type-val")).text

Expand Down