浏览代码

ci: fix tranloadit2 e2e tests (#3270)

* ci: fix tranloadit2 e2e tests

* ci: Re-enable tranloadit tests

* ci: update settings

* improve comments

* Remove cropping step from transloadit2 e2e test

* add steps back

* remove template id

* increase timeout

* transloadit2

* Re-enable all e2e tests

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
Antoine du Hamel 3 年之前
父节点
当前提交
7cad0130dd

+ 1 - 0
.github/workflows/end-to-end.yml

@@ -35,3 +35,4 @@ jobs:
           SAUCE_BUILD: ${{github.run_id}}
           SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
           SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
+          TRANSLOADIT_KEY: ${{secrets.TRANSLOADIT_KEY}}

+ 1 - 1
bin/endtoend-build-tests

@@ -12,7 +12,7 @@ __base="$(basename ${__file} .sh)"
 __root="$(cd "$(dirname "${__dir}")" && pwd)"
 
 # Tests using a simple build setup.
-tests="chaos-monkey i18n-drag-drop providers thumbnails transloadit tus-drag-drop url-plugin xhr-limit"
+tests="chaos-monkey i18n-drag-drop providers thumbnails transloadit transloadit2 tus-drag-drop url-plugin xhr-limit"
 
 for t in $tests; do
   mkdir -p "${__root}/test/endtoend/$t/dist"

+ 1 - 1
packages/@uppy/transloadit/src/AssemblyOptions.js

@@ -20,7 +20,7 @@ function validateParams (params) {
 
   if (!params.auth || !params.auth.key) {
     throw new Error('Transloadit: The `params.auth.key` option is required. '
-      + 'You can find your Transloadit API key at https://transloadit.com/account/api-settings.')
+      + 'You can find your Transloadit API key at https://transloadit.com/c/template-credentials')
   }
 }
 

+ 1 - 1
test/endtoend/transloadit/test.js

@@ -17,7 +17,7 @@ describe('Transloadit file processing', () => {
   it('should upload a file to Transloadit and crop it', async function test () {
     const transloaditKey = process.env.TRANSLOADIT_KEY
     if (transloaditKey === undefined) {
-      console.log('skipping Transloadit integration test')
+      console.log('skipping Transloadit integration test: process.env.TRANSLOADIT_KEY is not set')
       return this.skip()
     }
 

+ 9 - 12
test/endtoend/transloadit2/main.js

@@ -16,22 +16,19 @@ function initUppyTransloadit (transloaditKey) {
     })
     .use(Transloadit, {
       service: 'https://api2-ap-southeast-1.transloadit.com',
-      params: {
-        steps: {
-          crop_thumbed: {
-            use: [':original'],
-            robot: '/image/resize',
-            height: 100,
-            resize_strategy: 'crop',
-            width: 100,
-          },
-        },
-      },
       getAssemblyOptions () {
         return {
           params: {
             auth: { key: transloaditKey },
-            template_id: 'uppyTransloadit',
+            steps: {
+              crop_thumbed: {
+                use: [':original'],
+                robot: '/image/resize',
+                height: 100,
+                resize_strategy: 'crop',
+                width: 100,
+              },
+            },
           },
           fields: {
             message: 'test',

+ 4 - 4
test/endtoend/transloadit2/test.js

@@ -3,21 +3,21 @@ const path = require('path')
 const fs = require('fs')
 const { selectFakeFile, supportsChooseFile, ensureInputVisible } = require('../utils')
 
-const testURL = 'http://localhost:4567/transloadit'
+const testURL = 'http://localhost:4567/transloadit2'
 
 function setTransloaditKeyAndInit (transloaditKey) {
   window.initUppyTransloadit(transloaditKey)
 }
 
-describe('Transloadit file processing', () => {
+describe('Transloadit getAssemblyOptions', () => {
   beforeEach(async () => {
     await browser.url(testURL)
   })
 
-  it('should upload a file to Transloadit and crop it', async function test () {
+  it('should pass `fields` to `assembly:result`', async function test () {
     const transloaditKey = process.env.TRANSLOADIT_KEY
     if (transloaditKey === undefined) {
-      console.log('skipping Transloadit integration test')
+      console.log('skipping Transloadit integration test: process.env.TRANSLOADIT_KEY is not set')
       return this.skip()
     }
 

+ 1 - 1
test/endtoend/wdio.base.conf.js

@@ -72,7 +72,7 @@ exports.config = {
   baseUrl: 'http://localhost',
 
   // Default timeout for all waitFor* commands.
-  waitforTimeout: 10000,
+  waitforTimeout: 15000,
 
   // Default timeout in milliseconds for request
   // if Selenium Grid doesn't send response

+ 0 - 1
test/endtoend/wdio.remote.conf.js

@@ -32,7 +32,6 @@ exports.config = {
   exclude: [
     './chaos-monkey/*',
     './url-plugin/*',
-    './transloadit/*',
   ],
 
   // If you only want to run your tests until a specific amount of tests have failed use