apache / apache/pulsar-manager
Pulsar manager integration test task
- Dominant language
- Vue
- Stars
- 539
- Forks
- 239
- PR merge metrics
- No merged PRs in 30d
Description
### Motivation
In order to test pulsar-manager and ensure pulsar-manager quality.
Verify page functions, verify business logic.
### Tools
nightwatch, request
### Start add test
#### Open a issue
Title: [integration-test][tenants-create]Add integration for tenants-create
#### Start pulsar-manager and pulsar service
Reference https://github.com/streamnative/pulsar-manager/blob/master/front-end/README.md
#### Add a test, take tenants as an example
```
cd integration-test
# create directory, for example testTenants, testNamespaces, testTopics, etc
mkdir testTenants
# create file, for example tenants.js, namespaces.js, etc
touch tenants.js
```
#### Add test code to tenants.js
```
var request = require('request')
var serviceUrl = "http://localhost:8080"
module.exports = {
'Tenants create' : function (browser) {
browser
.url(browser.launchUrl + '/#/management/tenants')
.waitForElementVisible('body')
.pause(1000)
.waitForElementVisible('div[class=app-container]')
.useXpath()
.click("//section[@class='app-main']/div[@class='app-container']/div[@class='filter-container']/button/span[text()='Add']")
.useCss()
.setValue("input[placeholder='Please input tenant']", 'test-integrations')
.useXpath()
.click("//div[contains(@class, 'el-form-item')]/div[contains(@class, 'el-select')]/div[contains(@class, 'el-input')]")
.pause(1000)
.useXpath()
.click("//div[@x-placement='bottom-start']")
.useXpath()
.click("//div[contains(@class, 'dialog-footer')]/button/span[text()='Confirm']")
.pause(2000)
},
'Tenants create check': function(browser) {
request(serviceUrl + '/admin/v2/tenants/test-integrations', function(error, response, body) {
if (response.statusCode == 200) {
console.log("Create tenants pass")
} else {
console.log("Create tenants failed")
}
}
)
},
'Tenants search': function (browser) {
browser
.useCss()
.setValue("input[placeholder='Tenant']", 'test-integrations')
.useXpath()
.click("//span[text()='Search']")
},
'Tenants config': function (browser) {
browser
.click("//span[text()='config']")
.pause(1000)
},
'Tenants edit': function (browser) {
browser
.click("//span[text()='Edit']")
.click("//div[contains(@class, 'dialog-footer')]/button/span[text()='Confirm']")
.pause(1000)
},
'Tenants delete': function (browser) {
browser
.click("//span[text()='Delete']")
.pause(2000)
.end();
},
'Tenants delete check': function(browser) {
request(serviceUrl + '/admin/v2/tenants/test-integrations', function(error, response, body) {
if (response.statusCode == 404) {
console.log("Delete tenants pass")
} else {
console.log("Delete tenants failed")
}
}
)
}
};
```
#### Run test
```
cd integration-test
../node_modules/nightwatch/bin/nightwatch testTenants/tenants.js
```
#### Open a pull request
Title: [integration-test][tenants-create]Add integration for tenants-create
### Module to be tested
* tenants
* [x] list
* [x] get
* [x] update
* [x] delete
* namespaces
* [ ] create
* [ ] delete
* [ ] set-clusters
* [ ] set-backlog-quota
* [ ] remove-backlog-quota
* [ ] set-persistence
* [ ] set-message-ttl
* [ ] set-anti-affinity-group
* [ ] delete-anti-affinity-group
* [ ] set-deduplication
* [ ] set-retention
* [ ] unload
* [ ] split-bundle
* [ ] set-dispatch-rate
* [ ] clear-backlog
* [ ] unsubscribe
* [ ] set-encryption-required
* [ ] set-subscription-auth-mode
* [ ] set-max-producers-per-topic
* [ ] set-max-consumers-per-topic
* [ ] set-max-consumers-per-subscription
* [ ] set-compaction-threshold
* [ ] set-offload-threshold
* [ ] set-offload-deletion-lag
* [ ] clear-offload-deletion-lag
* [ ] set-schema-autoupdate-strateg
* topics
* [ ] create
* [ ] update-partitioned-topic
* [ ] delete-partitioned-topic
* [ ] grant-permission
* [ ] revoke-permission
* [ ] unload
* [ ] terminate
* [ ] compact
* [ ] offloa
* clusters
* [ ] create
* [ ] update
* [ ] update-peer-clusters
* [ ] domain-name-get
* [ ] domain-name-create
* [ ] domain-name-delete
* [ ] domain-name-update
* brokers
* [ ] update-dynamic-config
* [ ] list-dynamic-config
* [ ] get-all-dynamic-config
* [ ] get-internal-config
* [ ] get-runtime-config
* [ ] healthcheck
* resource-quotas
* [ ] get
* [ ] set
* [ ] reset-namespace-bundle-quota
* functions
* [ ] create
* [ ] start
* [ ] stop
* [ ] restart
* [ ] update
* sources
* [ ] create
* [ ] start
* [ ] stop
* [ ] restart
* [ ] update
* sinks
* [ ] create
* [ ] start
* [ ] stop
* [ ] restart
* [ ] update
* bookies
* [ ] racks-placement
* [ ] get-bookie-rack
* [ ] delete-bookie-rack
* [ ] set-bookie-rack
* schemas
* [ ] get
* [ ] delete
* [ ] upload
Contributor guide
Research direction
Read front-end/README.md, then inspect the integration-test directory and use testTenants/tenants.js as the example entry point. Start Pulsar Manager and Pulsar, run ../node_modules/nightwatch/bin/nightwatch testTenants/tenants.js, and add integration coverage for the module operations listed in the issue. Done means the relevant tests run successfully and a pull request is opened.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100