PCQA-1757 Point repositories UI at the Settings "Package Repositories" page

Port of master 51263729e4983. 262 only received the first iteration of
this fix (the retargeted PythonPackageRepositoriesDialogUi locator); the
test-side half was never cherry-picked, so packagesTable still matched
the two PyPackagesTree nodes reported in the ticket, and
CustomRepositoryTest still clicked the removed gear button and waited for
the removed "Manage Repositories" popup item.

- add PackageRepositoriesSettingsUi with packageRepositoriesSettingsPage,
  which navigates the Settings tree to Python | Package Repositories
- drop PythonPackageRepositoriesDialogUi, obsolete since PY-89838 moved
  repository management out of the standalone dialog
- PythonPackagesToolWindowUiComponent: scope packagesTable to the
  JBScrollPane wrapper so it resolves to one component again, and replace
  settingsButton with optionsButton (the toolbar group is now
  AllIcons.Actions.More / "Options")
- CustomRepositoryTest: open the page via Options -> "Repositories...",
  fix the copy-pasted @DisplayName, restore the Allure labels the rest of
  the packaging package already carries

Adapted to the 262 Finder API: the x() readableName overloads only exist
on master, so the component locators here carry no readable names.

GitOrigin-RevId: 43e51c472684cb4586ca241345253392cd493e9b
This commit is contained in:
Denis Mashutin
2026-08-19 20:27:47 +00:00
committed by intellij-monorepo-bot
parent a96d0841a8
commit 7c4ac37408
3 changed files with 25 additions and 32 deletions
@@ -0,0 +1,21 @@
package com.intellij.driver.sdk.ui.components.python
import com.intellij.driver.sdk.ui.components.ComponentData
import com.intellij.driver.sdk.ui.components.UiComponent
import com.intellij.driver.sdk.ui.components.settings.SettingsDialogUiComponent
fun SettingsDialogUiComponent.packageRepositoriesSettingsPage(action: PackageRepositoriesSettingsPageUi.() -> Unit = {}): PackageRepositoriesSettingsPageUi {
openTreeSettingsSection("Python", "Package Repositories", fullMatch = false)
return x(PackageRepositoriesSettingsPageUi::class.java) {
byType("com.intellij.openapi.options.ex.ConfigurableCardPanel")
}.apply(action)
}
class PackageRepositoriesSettingsPageUi(data: ComponentData) : UiComponent(data) {
val addButton = x { and(byClass("ActionButton"), byAccessibleName("Add")) }
val removeButton = x { and(byClass("ActionButton"), byAccessibleName("Delete")) }
val enableRepositoryCheckBox = x { byAccessibleName("Enable repository") }
val nameField = x("//div[@accessiblename='Name:' and @class='JBTextField']")
val urlField = x("//div[@accessiblename='Repository URL:' and @class='JBTextField']")
}
@@ -1,28 +0,0 @@
package com.intellij.driver.sdk.ui.components.python
import com.intellij.driver.sdk.ui.components.ComponentData
import com.intellij.driver.sdk.ui.components.UiComponent
import com.intellij.driver.sdk.ui.components.common.IdeaFrameUI
import javax.swing.JDialog
import javax.swing.JFrame
/**
* Package repository management moved from the standalone "Python Package Repositories" dialog into
* the Settings dialog "Python | Package Repositories" page (PY-89838). This component targets that
* Settings page; open it via the Python Packages tool window Options menu -> "Repositories...".
*/
fun IdeaFrameUI.pythonPackageRepositoriesDialog(func: PythonPackageRepositoriesDialogUi.() -> Unit = {}) =
x(PythonPackageRepositoriesDialogUi::class.java) {
and(or(byType(JDialog::class.java), byType(JFrame::class.java)), byAccessibleName("Settings"))
}.apply(func)
class PythonPackageRepositoriesDialogUi(data: ComponentData) : UiComponent(data) {
val addButton = x { and(byClass("ActionButton"), byAccessibleName("Add")) }
val removeButton = x { and(byClass("ActionButton"), byAccessibleName("Delete")) }
val okButton = x { byAccessibleName("OK") }
val applyButton = x { byAccessibleName("Apply") }
val cancelButton = x { byAccessibleName("Cancel") }
val nameField = x("//div[@accessiblename='Name:' and @class='JBTextField']")
val urlField = x("//div[@accessiblename='Repository URL:' and @class='JBTextField']")
}
@@ -11,14 +11,14 @@ fun Finder.pythonPackagesToolWindow(@Language("xpath") xpath: String? = null) =
class PythonPackagesToolWindowUiComponent(data: ComponentData) : UiComponent(data) {
val packagesTable
get() = x("//div[@class='PyPackagesTree']", UiComponent::class.java)
get() = x("//div[@class='JBScrollPane'][.//div[@class='PyPackagesTree']]", UiComponent::class.java)
val searchField
get() = x("//div[@class='PyPackageSearchTextField']", UiComponent::class.java)
// Gear button in the Python Packages tool window toolbar
val settingsButton
get() = x("//div[@myicon='settings.svg']", UiComponent::class.java)
// "Options" button in the Python Packages tool window toolbar (AllIcons.Actions.More since PY-89838)
val optionsButton
get() = x { and(byClass("ActionButton"), byAccessibleName("Options")) }
val installButton = x { and((byClass("JBOptionButton")), (byAccessibleName("Install"))) }