ci: update Webdriverio packages (#3027)

- Move endtoend specific deps to a sub-package
- Upgrade to Webdriverio 7
- Re-enable Safari testing
- Disable Android as it seems to be offline
- Fix resulting TS type conflict between `@types/mocha` and `@types/jasmine`
This commit is contained in:
Antoine du Hamel 2021-07-19 23:20:35 +02:00 committed by GitHub
parent 34f08cdb5f
commit ef61514e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 15749 additions and 3192 deletions

4177
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,7 @@
"packages/@uppy/*",
"packages/uppy",
"private/*",
"test/endtoend",
"website"
],
"devDependencies": {
@ -47,12 +48,10 @@
"@goto-bus-stop/envify": "^5.0.0",
"@jamen/lorem": "^0.2.0",
"@size-limit/preset-big-lib": "4.5.6",
"@types/jasmine": "file:./private/@types/jasmine",
"@types/jasminewd2": "file:./private/@types/jasmine",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.28.2",
"@wdio/cli": "^5.18.6",
"@wdio/local-runner": "^5.18.6",
"@wdio/mocha-framework": "^5.18.6",
"@wdio/sauce-service": "^5.16.10",
"abortcontroller-polyfill": "^1.7.3",
"adm-zip": "^0.5.5",
"aliasify": "^2.1.0",
@ -61,9 +60,7 @@
"babel-jest": "^27.0.6",
"babel-plugin-inline-package-json": "^2.0.0",
"babelify": "^10.0.0",
"brake": "^1.0.1",
"browserify": "^17.0.0",
"chai": "^4.2.0",
"chalk": "^4.1.1",
"concat-stream": "^2.0.0",
"core-js": "^3.15.2",
@ -86,12 +83,10 @@
"eslint-plugin-react": "^7.22.0",
"events.once": "^2.0.2",
"exorcist": "^2.0.0",
"express": "^4.17.1",
"fakefile": "^1.0.0",
"github-contributors-list": "^1.2.4",
"glob": "^7.1.6",
"globby": "^11.0.4",
"http-proxy": "^1.18.1",
"isomorphic-fetch": "^3.0.0",
"jest": "^27.0.6",
"last-commit-message": "^1.0.0",
@ -100,7 +95,6 @@
"md-gum-polyfill": "^1.0.0",
"mime-types": "^2.1.26",
"minify-stream": "^2.0.1",
"minimist": "^1.2.5",
"multi-glob": "^1.0.2",
"nodemon": "^2.0.8",
"npm-auth-to-token": "^1.0.0",
@ -127,11 +121,9 @@
"tinyify": "^3.0.0",
"tsd": "^0.17.0",
"tsify": "^5.0.1",
"tus-node-server": "^0.3.2",
"typescript": "~4.3",
"verdaccio": "^5.1.1",
"watchify": "^4.0.0",
"webdriverio": "^7.7.4",
"whatwg-fetch": "^3.6.2"
},
"scripts": {
@ -161,13 +153,8 @@
"start:companion": "bash ./bin/companion",
"start": "npm-run-all --parallel watch start:companion web:start",
"test:companion": "npm run --prefix ./packages/@uppy/companion test",
"test:endtoend:build-ci": "bash ./bin/endtoend-build-ci",
"test:endtoend:build": "bash ./bin/endtoend-build",
"test:endtoend:local": "npm run test:endtoend:build && wdio test/endtoend/wdio.local.conf.js",
"test:endtoend:providers": "npm run test:endtoend:build && . ./test/endtoend/providers/env.sh && wdio test/endtoend/wdio.local.conf.js --spec test/endtoend/providers/provider.*.test.js",
"test:endtoend:prepare-ci": "npm-run-all --parallel --race test:endtoend:registry test:endtoend:build-ci",
"test:endtoend:registry": "verdaccio --listen 4002 --config test/endtoend/verdaccio.yaml",
"test:endtoend": "npm run test:endtoend:prepare-ci && wdio test/endtoend/wdio.remote.conf.js",
"test:endtoend:local": "npm run --prefix ./test/endtoend test:endtoend:local",
"test:endtoend": "npm run --prefix ./test/endtoend test:endtoend",
"test:locale-packs": "node ./bin/locale-packs.js test",
"test:type": "lerna exec --scope '@uppy/*' --ignore '@uppy/{angular,react-native,locales,companion,provider-views,robodog,svelte}' tsd",
"test:unit": "npm run build:lib && jest --env jsdom",

View file

@ -0,0 +1,7 @@
{
"name": "@types/jasmine",
"version": "0.0.0",
"private": true,
"description": "This package is here to avoid type conflict between @types/jasmine used by Angular and @types/mocha used by everything else.",
"types": "types.d.ts"
}

2
private/@types/jasmine/types.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
declare module 'jasmine' {}
declare module 'jasminewd2' {}

View file

@ -1,4 +1,4 @@
/* global browser, expect, $, $$ */
/* global capabilities, browser, expect, $, $$ */
const testURL = 'http://localhost:4567/create-react-app'
describe('webpack build', () => {
@ -68,7 +68,13 @@ describe('React: DashboardModal', () => {
await browser.url(testURL)
})
it('should have controlled open and close', async () => {
it('should have controlled open and close', async function test () {
// Does not work on Safari 13.1 right now
if (capabilities.browserName === 'safari' && capabilities.browserVersion === '13.1') {
this.skip()
return
}
const modalToggle = await $('#modal-dashboard-toggle')
const modalWrapper = await $('#modal-dashboard .uppy-Dashboard--modal')
const modalClose = await $('#modal-dashboard .uppy-Dashboard-close')

14626
test/endtoend/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
{
"private": true,
"devDependencies": {
"@wdio/cli": "^7.7.7",
"@wdio/local-runner": "^7.7.7",
"@wdio/mocha-framework": "^7.7.7",
"@wdio/sauce-service": "^7.7.7",
"brake": "^1.0.1",
"chai": "^4.2.0",
"express": "^4.17.1",
"glob": "^7.1.6",
"http-proxy": "^1.18.1",
"minimist": "^1.2.5",
"tus-node-server": "^0.3.2",
"webdriverio": "^7.7.7"
},
"engines": {
"node": ">=16.0.0"
},
"scripts": {
"test:endtoend:build-ci": "cd ../.. && bash ./bin/endtoend-build-ci",
"test:endtoend:build": "cd ../.. && bash ./bin/endtoend-build",
"test:endtoend:local": "npm run test:endtoend:build && wdio wdio.local.conf.js",
"test:endtoend:providers": "npm run test:endtoend:build && . ./providers/env.sh && wdio wdio.local.conf.js --spec providers/provider.*.test.js",
"test:endtoend:prepare-ci": "npm-run-all --parallel --race test:endtoend:registry test:endtoend:build-ci",
"test:endtoend:registry": "verdaccio --listen 4002 --config verdaccio.yaml",
"test:endtoend": "npm run test:endtoend:prepare-ci && wdio wdio.remote.conf.js"
}
}

View file

@ -86,10 +86,7 @@ describe('ThumbnailGenerator', () => {
expect(previews).to.have.lengthOf(3) // ex. the invalid image
for (const p of previews) {
expect(await p.getAttribute('src')).to.match(/^blob:/)
// Doesn't appear to work in Chrome 67 on Android 6.0
if (capabilities.platformName !== 'Android') {
expect(await getWidth(p)).to.equal(200)
}
expect(await getWidth(p)).to.equal(200)
}
})
})

View file

@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"uppy": "file:../../../packages/uppy"
}
}

View file

@ -3,7 +3,7 @@ const path = require('path')
const { CompanionService, StaticServerService, TusService } = require('./utils')
const suites = {}
glob('test/endtoend/*/test.js').forEach((file) => {
glob('./*/test.js').forEach((file) => {
const name = path.basename(path.dirname(file))
suites[name] = [file]
})
@ -18,7 +18,7 @@ exports.config = {
// directory is where your package.json resides, so `wdio` will be called from there.
//
specs: [
'test/endtoend/*/test.js',
'./*/test.js',
],
// Patterns to exclude.
@ -89,16 +89,16 @@ exports.config = {
[CompanionService],
[StaticServerService, {
folders: [
{ mount: '/chaos-monkey', path: './test/endtoend/chaos-monkey/dist' },
{ mount: '/create-react-app', path: './test/endtoend/create-react-app/build' },
{ mount: '/i18n-drag-drop', path: './test/endtoend/i18n-drag-drop/dist' },
{ mount: '/providers', path: './test/endtoend/providers/dist' },
{ mount: '/thumbnails', path: './test/endtoend/thumbnails/dist' },
{ mount: '/transloadit', path: './test/endtoend/transloadit/dist' },
{ mount: '/tus-drag-drop', path: './test/endtoend/tus-drag-drop/dist' },
{ mount: '/typescript', path: './test/endtoend/typescript/dist' },
{ mount: '/url-plugin', path: './test/endtoend/url-plugin/dist' },
{ mount: '/xhr-limit', path: './test/endtoend/xhr-limit/dist' },
{ mount: '/chaos-monkey', path: './chaos-monkey/dist' },
{ mount: '/create-react-app', path: './create-react-app/build' },
{ mount: '/i18n-drag-drop', path: './i18n-drag-drop/dist' },
{ mount: '/providers', path: './providers/dist' },
{ mount: '/thumbnails', path: './thumbnails/dist' },
{ mount: '/transloadit', path: './transloadit/dist' },
{ mount: '/tus-drag-drop', path: './tus-drag-drop/dist' },
{ mount: '/typescript', path: './typescript/dist' },
{ mount: '/url-plugin', path: './url-plugin/dist' },
{ mount: '/xhr-limit', path: './xhr-limit/dist' },
],
}],
[TusService],

View file

@ -2,9 +2,11 @@ const base = require('./wdio.base.conf')
function createCapability (capability) {
return {
'tunnel-identifier': process.env.SAUCE_TUNNEL_IDENTIFIER,
build: process.env.SAUCE_BUILD,
extendedDebugging: true,
'sauce:options': {
tunnelIdentifier: process.env.SAUCE_TUNNEL_IDENTIFIER,
build: process.env.SAUCE_BUILD,
extendedDebugging: true,
},
...capability,
}
}
@ -15,21 +17,21 @@ exports.config = {
logLevel: 'warn',
capabilities: [
{ browserName: 'firefox', version: 'latest', platform: 'Windows 10' },
{ browserName: 'firefox', version: 'latest-1', platform: 'Windows 10' },
{ browserName: 'chrome', version: 'latest', platform: 'Windows 10' },
{ browserName: 'chrome', version: 'latest-1', platform: 'Windows 10' },
// { browserName: 'safari', version: 'latest', platform: 'macOS 11' },
// { browserName: 'safari', version: '13.1', platform: 'macOS 10.15' },
// { browserName: 'Safari', platformName: 'iOS', platformVersion: '12.2', deviceOrientation: 'portrait', deviceName: 'iPhone 8 Simulator' },
{ browserName: 'chrome', platformName: 'Android', platformVersion: '6.0', deviceOrientation: 'portrait', deviceName: 'Android Emulator' },
{ browserName: 'firefox', browserVersion: 'latest', platformName: 'Windows 10' },
{ browserName: 'firefox', browserVersion: 'latest-1', platformName: 'Windows 10' },
{ browserName: 'chrome', browserVersion: 'latest', platformName: 'Windows 10' },
{ browserName: 'chrome', browserVersion: 'latest-1', platformName: 'Windows 10' },
{ browserName: 'safari', browserVersion: 'latest', platformName: 'macOS 11' },
{ browserName: 'safari', browserVersion: '13.1', platformName: 'macOS 10.15' },
{ browserName: 'Safari', 'appium:deviceName': 'iPhone 12 Simulator', 'appium:deviceOrientation': 'portrait', 'appium:platformVersion': '14.3', platformName:'iOS' },
// { browserName: 'Chrome', 'appium:deviceName': 'Android GoogleAPI Emulator', 'appium:deviceOrientation': 'portrait', 'appium:platformVersion': '11.0', platformName: 'Android' },
].map(createCapability),
// Patterns to exclude.
exclude: [
'test/endtoend/chaos-monkey/*',
'test/endtoend/url-plugin/*',
'test/endtoend/transloadit/*',
'./chaos-monkey/*',
'./url-plugin/*',
'./transloadit/*',
],
// If you only want to run your tests until a specific amount of tests have failed use

View file

@ -3,7 +3,7 @@ const http = require('http')
const { Writable } = require('stream')
const { supportsChooseFile } = require('../utils')
const tempWrite = import('temp-write')
const tempWrite = Function(`return import('temp-write')`)() // eslint-disable-line no-new-func
async function make1kBFile () {
const size = 1024
const content = Buffer.allocUnsafe(size)