-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
E2E test to cover scenario of Kubeapps cluster not part of clusters l…
…ist (#5573) ### Description of the change This PR adds an E2E test in CI to avoid regression on #5566 and hence to avoid that #4564 happens again. ### Benefits Kubeapps is usable even if Kubeapps cluster is not among the clusters configured. ### Possible drawbacks N/A ### Applicable issues - fixes #4563 Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
- Loading branch information
1 parent
7cf1b15
commit 317934a
Showing
5 changed files
with
173 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,6 +411,7 @@ jobs: | |
tests_group: | ||
- main | ||
- multicluster | ||
- multicluster-nokubeapps | ||
- carvel | ||
- operator | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
integration/tests/multicluster-nokubeapps/11-multicluster-nokubeapps-cluster.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2022 the Kubeapps contributors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const { test, expect } = require("@playwright/test"); | ||
const { KubeappsLogin } = require("../utils/kubeapps-login"); | ||
const utils = require("../utils/util-functions"); | ||
|
||
test("Deploys package in the only additional cluster while Kubeapps cluster is not available", async ({ page }) => { | ||
test.setTimeout(120000); | ||
|
||
// Log in | ||
const k = new KubeappsLogin(page); | ||
await k.doLogin("kubeapps-operator@example.com", "password", process.env.ADMIN_TOKEN); | ||
|
||
// Check and select cluster using ui | ||
await page.click(".kubeapps-dropdown .kubeapps-nav-link"); | ||
await page.selectOption('select[name="clusters"]', "second-cluster"); | ||
// Check that there is only one cluster | ||
const clustersLength = await page.locator('select[name="clusters"] option').count() | ||
expect(clustersLength).toEqual(1) | ||
await page.click('cds-button:has-text("Change Context")'); | ||
|
||
// Select package to deploy | ||
await page.click('a.nav-link:has-text("Catalog")'); | ||
await page.locator("input#search").fill("apache"); | ||
await page.waitForTimeout(3000); | ||
await page.click('a:has-text("foo apache chart for CI")'); | ||
await page.click('cds-button:has-text("Deploy") >> nth=0'); | ||
|
||
// Deploy package | ||
const releaseNameLocator = page.locator("#releaseName"); | ||
await releaseNameLocator.waitFor(); | ||
await expect(releaseNameLocator).toHaveText(""); | ||
const releaseName = utils.getRandomName("test-05-release"); | ||
console.log(`Creating release "${releaseName}"`); | ||
await releaseNameLocator.fill(releaseName); | ||
await page.locator('cds-button:has-text("Deploy")').click(); | ||
|
||
// Assertions | ||
await page.waitForSelector("css=.application-status-pie-chart-number >> text=1", { | ||
timeout: utils.getDeploymentTimeout(), | ||
}); | ||
await page.waitForSelector("css=.application-status-pie-chart-title >> text=Ready", { | ||
timeout: utils.getDeploymentTimeout(), | ||
}); | ||
|
||
// Clean up | ||
await page.locator('cds-button:has-text("Delete")').click(); | ||
await page.locator('cds-modal-actions button:has-text("Delete")').click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters