mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
test cluster add using minikube
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
90537f0637
commit
84872bd864
@ -121,7 +121,7 @@ jobs:
|
|||||||
displayName: Lint
|
displayName: Lint
|
||||||
- script: make test
|
- script: make test
|
||||||
displayName: Run tests
|
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
|
displayName: Install integration test dependencies
|
||||||
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux
|
- script: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' make integration-linux
|
||||||
displayName: Run integration tests
|
displayName: Run integration tests
|
||||||
|
|||||||
@ -1,8 +1,18 @@
|
|||||||
import { Application } from "spectron"
|
import { Application } from "spectron"
|
||||||
import * as util from "../helpers/utils"
|
import * as util from "../helpers/utils"
|
||||||
|
import { spawnSync } from "child_process"
|
||||||
|
import { stat } from "fs"
|
||||||
|
|
||||||
|
jest.setTimeout(20000)
|
||||||
|
|
||||||
describe("app start", () => {
|
describe("app start", () => {
|
||||||
let app: Application
|
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 () => {
|
beforeEach(async () => {
|
||||||
app = util.setup()
|
app = util.setup()
|
||||||
await app.start()
|
await app.start()
|
||||||
@ -11,10 +21,31 @@ describe("app start", () => {
|
|||||||
await app.client.waitUntilWindowLoaded()
|
await app.client.waitUntilWindowLoaded()
|
||||||
}, 20000)
|
}, 20000)
|
||||||
|
|
||||||
it('starts with whats new flow', async () => {
|
it('shows "whats new"', async () => {
|
||||||
await app.client.waitUntilTextExists("h1", "What's new")
|
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.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 () => {
|
afterEach(async () => {
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
label="Choose config:"
|
label="Choose config:"
|
||||||
>
|
>
|
||||||
<b-form-select
|
<b-form-select
|
||||||
|
id="kubecontext-select"
|
||||||
v-model="kubecontext"
|
v-model="kubecontext"
|
||||||
:options="contextNames"
|
:options="contextNames"
|
||||||
@change="onSelect($event)"
|
@change="onSelect($event)"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user