Skip to content

Commit dbfa4a7

Browse files
committed
Update locator for rancher app cards
Signed-off-by: Martin Kravec <kravciak@gmail.com>
1 parent e1f391c commit dbfa4a7

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

tests/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ This should be clean rancher if you want to run all the tests.
3939
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged -e CATTLE_BOOTSTRAP_PASSWORD=sa rancher/rancher:latest
4040

4141
# Run tests
42-
export RANCHER_URL=https://127.0.0.1.nip.io/
42+
# Tests can detect Rancher URL automatically if not set
43+
# export RANCHER_URL=https://127.0.0.1.nip.io/
4344
pw test --ui -x
4445
```
4546

tests/e2e/rancher/rancher-apps.page.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,15 @@ export class RancherAppsPage extends BasePage {
178178

179179
@step
180180
async installChart(chart: Chart, options?: { questions?: () => Promise<void>, yamlPatch?: YAMLPatch, timeout?: number, navigate?: boolean }) {
181+
// Apps grid was redesigned in Rancher 2.12
182+
const card = this.page.locator('.grid > .item').or(this.page.locator('.app-chart-cards > .item-card'))
183+
.filter({ has: this.page.getByRole('heading', { name: chart.title, exact: true }) })
184+
181185
// Select chart by title
182186
if (options?.navigate !== false) {
183187
await this.nav.explorer('Apps', 'Charts')
184188
await expect(this.page.getByRole('heading', { name: 'Charts', exact: true })).toBeVisible()
185-
await this.page.locator('.grid > .item').getByRole('heading', { name: chart.title, exact: true }).click()
189+
await card.click()
186190

187191
if (chart.version) {
188192
const versionPane = this.page.getByRole('heading', { name: 'Chart Versions', exact: true }).locator('..')

0 commit comments

Comments
 (0)