https://github.com/linuxsuren/ks-ui-test
https://github.com/linuxsuren/ks-ui-test
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/linuxsuren/ks-ui-test
- Owner: LinuxSuRen
- License: mit
- Created: 2020-12-11T13:13:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T11:01:50.000Z (about 3 years ago)
- Last Synced: 2025-02-13T07:36:00.616Z (about 1 year ago)
- Language: Java
- Size: 59.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://goreportcard.com/report/linuxsuren/github-go)
[](https://godoc.org/github.com/linuxsuren/ks-ui-test)
[](https://github.com/linuxsuren/github-go/graphs/contributors)
[](https://github.com/linuxsuren/github-go/releases/latest)

This is not the official UI test for [Kubesphere](https://github.com/kubesphere/kubesphere/). I created this only for someone
who might want to have less simple and meaningless work with developing Kubesphere.
# Run it
You can run it a with normal browser via: `make build run`
Or, you can also run it in a container with a headless browser: `make build image-run`
# How it works
This project base on [phoenix.webui.framework](https://github.com/LinuxSuRen/phoenix.webui.framework)
which is a UI testing framework of [Selenium](https://github.com/SeleniumHQ/selenium).
# Run in container
`docker run --rm registry.cn-beijing.aliyuncs.com/surenpi/ks-ui-test -url ${KS} -user ${KS_USER} -password ${KS_PASS}`
# Run in Jenkins
First, Start Jenkins via: `jcli center start`. Then config [jcli](https://github.com/jenkins-zh/jenkins-cli) if you've done it before.
Second, build the JNLP agent image via: `make jnlp-image`.
Then run it: `jcli computer launch simple -m docker --remove --agent-type custom --custom-image surenpi/selenium-agent`
At last, create a pipeline with the following content:
```
pipeline {
agent {
label 'simple'
}
environment {
KS = "http://127.0.0.1:30880/login"
}
stages {
stage('Example') {
steps {
withCredentials([usernamePassword(credentialsId: 'kubesphere', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
sh "java -Djava.awt.headless=true -jar /test.jar -url ${KS} -password ${PASS} -username ${USER}"
}
}
}
}
}
```
In order to make sure this pipeline works well, please remember provide a correct URL of Kubesphere and a credential.
You can trigger this pipeline via a command line: `jcli job build -b simple`. Or just trigger it manually.