diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 9658b0fd55..a16892ea23 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -121,7 +121,7 @@ jobs: displayName: Lint - script: make test displayName: Run tests - - script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y + - script: sudo apt-get update && sudo apt-get install libgconf-2-4 -y && sudo snap install -y minikube && sudo minikube start --vm-driver=none displayName: Install integration test dependencies - script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux displayName: Run integration tests diff --git a/spec/integration/specs/app_spec.ts b/spec/integration/specs/app_spec.ts index c2c4be18fe..b3f14debc9 100644 --- a/spec/integration/specs/app_spec.ts +++ b/spec/integration/specs/app_spec.ts @@ -1,8 +1,18 @@ import { Application } from "spectron" import * as util from "../helpers/utils" +import { spawnSync } from "child_process" +import { stat } from "fs" + +jest.setTimeout(20000) describe("app start", () => { let app: Application + const clickWhatsNew = async (app: Application) => { + await app.client.waitUntilTextExists("h1", "What's new") + await app.client.click("button.btn-primary") + await app.client.waitUntilTextExists("h1", "Welcome") + } + beforeEach(async () => { app = util.setup() await app.start() @@ -11,10 +21,31 @@ describe("app start", () => { await app.client.waitUntilWindowLoaded() }, 20000) - it('starts with whats new flow', async () => { - await app.client.waitUntilTextExists("h1", "What's new") + it('shows "whats new"', async () => { + await clickWhatsNew(app) + }) + + it('allows to add a cluster', async () => { + const status = spawnSync("minikube status", {shell: true}) + if (status.status !== 0) { + console.warn("skipping test") + return + } + await clickWhatsNew(app) + await app.client.click("a#add-cluster") + await app.client.waitUntilTextExists("legend", "Choose config:") + await app.client.selectByVisibleText("select#kubecontext-select", "minikube (new)") await app.client.click("button.btn-primary") - await app.client.waitUntilTextExists("h1", "Welcome") + await app.client.waitUntilTextExists("pre.auth-output", "Authentication proxy started") + let windowCount = await app.client.getWindowCount() + // wait for webview to appear on window count + while (windowCount == 1) { + windowCount = await app.client.getWindowCount() + } + await app.client.windowByIndex(windowCount - 1) + await app.client.waitUntilTextExists("span.link-text", "Cluster") + await app.client.click('a[href="/nodes"]') + await app.client.waitUntilTextExists("div.TableCell", "minikube") }) afterEach(async () => { diff --git a/src/renderer/components/AddClusterPage.vue b/src/renderer/components/AddClusterPage.vue index 6f105a3950..74811a35b2 100644 --- a/src/renderer/components/AddClusterPage.vue +++ b/src/renderer/components/AddClusterPage.vue @@ -11,6 +11,7 @@ label="Choose config:" >