Kaynağa Gözat

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>
wushuzh 1 yıl önce
ebeveyn
işleme
6958445f83

+ 1 - 1
Makefile

@@ -5,7 +5,7 @@ endef
 compile: 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:
 	go env -w GOARCH=arm GOARM=6

+ 4 - 4
integration-tests/configs/general/config.yaml

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

+ 11 - 11
integration-tests/test/general.mjs

@@ -44,42 +44,42 @@ describe('config: general', function () {
     expect(buttons).to.have.length(8)
   })
 
-  it('Start date action (popup)', async function() {
+  it('Start dir action (popup)', async function () {
     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)
 
-    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'))
     expect(await dialog.isDisplayed()).to.be.true
 
     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'))
     expect(dialogErr).to.not.be.null
     expect(await dialogErr.isDisplayed()).to.be.false
   })
 
-  it('Start date action (passive)', async function() {
+  it('Start cd action (passive)', async function () {
     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)
 
-    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'))
     expect(await dialog.isDisplayed()).to.be.false