Selaa lähdekoodia

skip test if TRANSLOADIT_KEY is not set, use waitForExist

Artur Paikin 6 vuotta sitten
vanhempi
commit
b6f9ab2bb0
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9 3
      test/endtoend/transloadit/test.js

+ 9 - 3
test/endtoend/transloadit/test.js

@@ -18,10 +18,16 @@ function setTransloaditKeyAndInit (transloaditKey) {
 describe('Transloadit file processing', () => {
   beforeEach(() => {
     browser.url(testURL)
-    browser.execute(setTransloaditKeyAndInit, process.env.TRANSLOADIT_KEY)
   })
 
   it('should upload a file to Transloadit and crop it', () => {
+    const transloaditKey = process.env.TRANSLOADIT_KEY
+    if (transloaditKey === undefined) {
+      console.log('skipping Transloadit integration test')
+      return this.skip()
+    }
+    browser.execute(setTransloaditKeyAndInit, transloaditKey)
+
     const inputPath = '#uppy-transloadit .uppy-Dashboard-input'
     const resultPath = '#uppy-result'
 
@@ -33,9 +39,9 @@ describe('Transloadit file processing', () => {
     } else {
       browser.execute(selectFakeFile, 'uppyTransloadit')
     }
-    browser.pause(15000)
+    // browser.pause(15000)
     // $('.uppy-StatusBar-actionBtn--upload').click()
-    // $(resultPath).waitForExist()
+    $(resultPath).waitForExist(15000)
     const text = browser.getText(resultPath)
     expect(text).to.be.equal('ok')
   })