Use windows compatible cmds and wait more time (#374)

* bugfix: change action request cnt type as Counter

* bugfix: fix type of act req count and typo

* bugfix: change to correct type of act req in TC

* bugfix: use Windows compatible cmds for test

* bugfix: wait more for slow test env

---------

Co-authored-by: wushuzh <wushuzh@outlook.com>
This commit is contained in:
wushuzh 2024-08-06 21:43:16 +08:00 committed by GitHub
parent ef91294d5e
commit 6958445f83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 16 deletions

View File

@ -5,7 +5,7 @@ endef
compile: daemon-compile-currentenv compile: daemon-compile-currentenv
daemon-compile-currentenv: daemon-compile-currentenv:
go build -o OliveTin github.com/OliveTin/OliveTin/cmd/OliveTin go build github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile-armhf: daemon-compile-armhf:
go env -w GOARCH=arm GOARM=6 go env -w GOARCH=arm GOARM=6

View File

@ -24,12 +24,12 @@ actions:
shell: sleep 5 shell: sleep 5
icon: "&#x1F62A" icon: "&#x1F62A"
- title: date-popup - title: dir-popup
shell: date shell: dir
popupOnStart: execution-dialog-stdout-only popupOnStart: execution-dialog-stdout-only
- title: date-passive - title: cd-passive
shell: date shell: cd
- title: "Run Ansible Playbook" - title: "Run Ansible Playbook"
icon: "&#x1F1E6" icon: "&#x1F1E6"

View File

@ -44,42 +44,42 @@ describe('config: general', function () {
expect(buttons).to.have.length(8) expect(buttons).to.have.length(8)
}) })
it('Start date action (popup)', async function() { it('Start dir action (popup)', async function () {
await getRootAndWait() await getRootAndWait()
const buttons = await webdriver.findElements(By.css('[title="date-popup"]')) const buttons = await webdriver.findElements(By.css('[title="dir-popup"]'))
expect(buttons).to.have.length(1) expect(buttons).to.have.length(1)
const buttonDate = buttons[0] const buttonCMD = buttons[0]
expect(buttonDate).to.not.be.null expect(buttonCMD).to.not.be.null
buttonDate.click() buttonCMD.click()
const dialog = await webdriver.findElement(By.id('execution-results-popup')) const dialog = await webdriver.findElement(By.id('execution-results-popup'))
expect(await dialog.isDisplayed()).to.be.true expect(await dialog.isDisplayed()).to.be.true
const title = await webdriver.findElement(By.id('execution-dialog-title')) const title = await webdriver.findElement(By.id('execution-dialog-title'))
expect(await title.getAttribute('innerText')).to.be.equal('date-popup') expect(await webdriver.wait(until.elementTextIs(title, 'dir-popup'), 2000))
const dialogErr = await webdriver.findElement(By.id('big-error')) const dialogErr = await webdriver.findElement(By.id('big-error'))
expect(dialogErr).to.not.be.null expect(dialogErr).to.not.be.null
expect(await dialogErr.isDisplayed()).to.be.false expect(await dialogErr.isDisplayed()).to.be.false
}) })
it('Start date action (passive)', async function() { it('Start cd action (passive)', async function () {
await getRootAndWait() await getRootAndWait()
const buttons = await webdriver.findElements(By.css('[title="date-passive"]')) const buttons = await webdriver.findElements(By.css('[title="cd-passive"]'))
expect(buttons).to.have.length(1) expect(buttons).to.have.length(1)
const buttonDate = buttons[0] const buttonCMD = buttons[0]
expect(buttonDate).to.not.be.null expect(buttonCMD).to.not.be.null
buttonDate.click() buttonCMD.click()
const dialog = await webdriver.findElement(By.id('execution-results-popup')) const dialog = await webdriver.findElement(By.id('execution-results-popup'))
expect(await dialog.isDisplayed()).to.be.false expect(await dialog.isDisplayed()).to.be.false