在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):appium/appium-gulp-plugins开源软件地址(OpenSource Url):https://github.com/appium/appium-gulp-plugins开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):appium-gulp-pluginsCustom plugins used across appium modules statusboilerplate pluginThis plugin sets up all the other typical plugins we use with a simple configuration object. usageBasically just set up the let gulp = require('gulp'),
boilerplate = require('appium-gulp-plugins').boilerplate.use(gulp);
boilerplate({build: "My Project Name"}); You can pass a lot of options to configure const DEFAULT_OPTS = {
files: ['*.js', 'lib/**/*.js', 'test/**/*.js', '!gulpfile.js'],
transpile: true,
transpileOut: 'build',
babelOpts: {},
linkBabelRuntime: true,
watch: true,
watchE2E: false,
test: {
files: ['${testDir}/**/*-specs.js', '!${testDir}/**/*-e2e-specs.js'],
traceWarnings: false,
},
coverage: {
files: ['./build/test/**/*-specs.js', '!./build/test/**/*-e2e-specs.js'],
verbose: true,
},
'coverage-e2e': {
files: ['./build/test/**/*-e2e-specs.js'],
verbose: true,
},
e2eTest: {
files: ['${testDir}/**/*-e2e-specs.js'],
forceExit: false,
traceWarnings: false,
},
testReporter: (process.env.TRAVIS || process.env.CI) ? 'spec' : 'nyan',
testTimeout: 20000,
build: 'Appium',
extraPrepublishTasks: [],
eslint: true,
eslintOnWatch: false, // deprecated, move to lintOnWatch
lintOnWatch: false,
ci: {
interval: 60000,
owner: 'appium',
repo: 'appium-build-store',
},
}; As you can see, it defaults to transpiling with Babel, running transpile pluginBabel compilation, sourcemaps and file renaming functionality in
one plugin. usage1/ Configure gulp as below: let gulp = require('gulp'),
Transpiler = require('appium-gulp-plugins').Transpiler;
gulp.task('transpile', function () {
let transpiler = new Transpiler();
// babel options are configurable in transpiler.babelOpts
return gulp.src('test/fixtures/es7/**/*.js')
.pipe(transpiler.stream())
.pipe(gulp.dest('build'));
}); 2/ in your code you need to mark the main and mocha files as below:
Regular lib files do not need any extra comments. watch pluginThere are some issues with Gulp 3.x error handling which cause the default gulp-watch to hang. This plugin is a small hack which solves that by respawning the whole process on error. This should not be needed in gulp 4.0. Files in the usageconst gulp = require('gulp');
const spawnWatcher = require('./index').spawnWatcher.use(gulp, opts);
spawnWatcher.configure('watch', ['lib/**/*.js','test/**/*.js','!test/fixtures'], function () {
// this is the watch action
return runSequence('test');
}); The test function in error handlingThe spawn needs to catch error as soon as they happen. To do so use the
// add error handling where needed
gulp.task('transpile', function () {
return gulp.src('test/es7/**/*.js')
.pipe(transpile())
.on('error', spawnWatcher.handleError)
.pipe(gulp.dest('build'));
});
gulp.task('test', ['transpile'] , function () {
return gulp.src('build/test/a-specs.js')
.pipe(mocha())
.on('error', spawnWatcher.handleError);
}); notificationNative notification is enabled by default. To disable it use the
collate logging and testsSet the environment variable iOS app buildingThis package can create iosApps: {
relativeLocations: {
iphoneos: 'relative/path/to/device/app.app',
iphonesimulator: 'relative/path/to/sim/app.app',
},
appName: 'AppName.app',
}, This will create a number of The simulator app will be build in To build for real devices, set the environment variable hacking this packageSince this package is used to build and test all the Appium packages, it should not use any of those packages. watch
test
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论