Skip to content

Commit 61b5194

Browse files
Merge pull request #440 from HanzJas/add_horizon_param_skmo
Add parameter for HorizonTest
2 parents ec6fe35 + 72a4f82 commit 61b5194

6 files changed

Lines changed: 24 additions & 0 deletions

File tree

api/bases/test.openstack.org_horizontests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,12 @@ spec:
13251325
ProjectNameXpath is the xpath to select project name
13261326
on the horizon dashboard based on the u/s or d/s theme
13271327
type: string
1328+
projectTextXpath:
1329+
description: |-
1330+
ProjectTextXpath is the xpath to element displaying
1331+
current project name on the horizon dashboard based
1332+
on the u/s or d/s theme
1333+
type: string
13281334
repoUrl:
13291335
default: https://review.opendev.org/openstack/horizon
13301336
description: RepoUrl is the URL of the Horizon repository.

api/v1beta1/horizontest_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ type HorizonTestSpec struct {
5252
// on the horizon dashboard based on the u/s or d/s theme
5353
ProjectNameXpath string `json:"projectNameXpath"`
5454

55+
// +kubebuilder:validation:Optional
56+
// +operator-sdk:csv:customresourcedefinitions:type=spec
57+
// ProjectTextXpath is the xpath to element displaying
58+
// current project name on the horizon dashboard based
59+
// on the u/s or d/s theme
60+
ProjectTextXpath string `json:"projectTextXpath"`
61+
5562
// +kubebuilder:validation:Required
5663
// +kubebuilder:validation:MinLength=1
5764
// +kubebuilder:validation:MaxLength=253

config/crd/bases/test.openstack.org_horizontests.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,12 @@ spec:
13251325
ProjectNameXpath is the xpath to select project name
13261326
on the horizon dashboard based on the u/s or d/s theme
13271327
type: string
1328+
projectTextXpath:
1329+
description: |-
1330+
ProjectTextXpath is the xpath to element displaying
1331+
current project name on the horizon dashboard based
1332+
on the u/s or d/s theme
1333+
type: string
13281334
repoUrl:
13291335
default: https://review.opendev.org/openstack/horizon
13301336
description: RepoUrl is the URL of the Horizon repository.

config/samples/test_v1beta1_horizontest.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ spec:
6262
# ProjectNameXpath is the xpath to select project name on dashboard (optional)
6363
projectNameXpath: "//span[@class='rcueicon rcueicon-folder-open']/ancestor::li"
6464

65+
# ProjectTextXpath is the xpath to element displaying current project (optional)
66+
projectTextXpath: ".//span[@class='rcueicon rcueicon-folder-open']/ancestor::li"
67+
6568
# Privileged
6669
# ----------
6770
#

internal/controller/horizontest_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ func (r *HorizonTestReconciler) PrepareHorizonTestEnvVars(
187187
"HORIZON_KEYS_FOLDER": "/etc/test_operator",
188188
"EXTRA_FLAG": instance.Spec.ExtraFlag,
189189
"PROJECT_NAME_XPATH": instance.Spec.ProjectNameXpath,
190+
"PROJECT_TEXT_XPATH": instance.Spec.ProjectTextXpath,
190191
})
191192

192193
return envVars

zuul.d/jobs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
cifmw_test_operator_horizontest_dashboard_url: "https://horizon-openstack.apps-crc.testing/"
128128
cifmw_test_operator_horizontest_extra_flag: "not pagination and test_users.py"
129129
cifmw_test_operator_horizontest_project_name_xpath: //*[@class="context-project"]//ancestor::ul
130+
cifmw_test_operator_horizontest_project_text_xpath: './/*[@class="context-project"]'
130131
cifmw_test_operator_horizontest_extra_mounts:
131132
- name: v1
132133
region: r1

0 commit comments

Comments
 (0)