chore(fake-driver): gulp is dead, long live scripts
This PR removes Gulp from `@appium/fake-driver` as already done in a couple other packages.
Also: moved `screen.png` into `lib/` since `@babel/cli` can just copy it over into `build/`.
DELETE
packages/fake-driver/gulpfile.js
-'use strict';
-
-const gulp = require('gulp');
-const boilerplate = require('@appium/gulp-plugins').boilerplate.use(gulp);
-
-gulp.task('copy-screen.png', () => gulp.src('./screen.png').pipe(gulp.dest('./build/')));
-
-gulp.task('copy-app.xml', () => gulp.src('./test/fixtures/app.xml').pipe(gulp.dest('./build/test/fixtures/')));
-
-boilerplate({
- build: '@appium/fake-driver',
- testTimeout: 15000,
- watchE2E: true,
- postTranspile: ['copy-screen.png', 'copy-app.xml']
-});

MODIFY
packages/fake-driver/lib/fake-app.js
packages/fake-driver/lib/fake-app.js
@@ -6,7 +6,7 @@ import xpath from 'xpath';
import log from './logger';
import { FakeElement } from './fake-element';
-const SCREENSHOT = path.join(__dirname, '..', 'screen.png');
+const SCREENSHOT = path.join(__dirname, 'screen.png');
class FakeApp {
constructor () {

RENAME
packages/fake-driver/screen.png
packages/fake-driver/lib/screen.png
MODIFY
packages/fake-driver/package.json
packages/fake-driver/package.json
{
"name": "@appium/fake-driver",
"version": "3.2.5",
- "description": "Description goes here.",
+ "description": "Mock driver used internally by Appium for testing. Ignore",
"keywords": [
"automation",
"javascript",
"index.js",
"lib",
"build",
- "test/fixtures",
- "screen.png"
+ "test/fixtures"
],
"scripts": {
- "dev": "gulp dev --no-notif",
- "build": "gulp transpile",
- "test": "gulp unit-test:run",
- "test:e2e": "gulp e2e-test:run"
+ "build": "babel lib --root-mode=upward --out-dir=build/lib --copy-files",
+ "dev": "npm run build -- --watch",
+ "fix": "npm run lint -- --fix",
+ "lint": "eslint -c ../../.eslintrc --ignore-path ../../.eslintignore .",
+ "test": "npm run test:unit",
+ "test:e2e": "mocha --require ../../test/setup-babel.js --timeout 20s --slow 10s \"./test/e2e/**/*.spec.js\"",
+ "test:unit": "mocha --require ../../test/setup-babel.js \"./test/unit/**/*.spec.js\""
},
"dependencies": {
"@appium/base-driver": "file:../base-driver",

RENAME
packages/fake-driver/test/alert-tests.js
packages/fake-driver/test/e2e/alert-tests.js
-import { initSession, deleteSession, W3C_PREFIXED_CAPS } from './helpers';
+import { initSession, deleteSession, W3C_PREFIXED_CAPS } from '../helpers';
function alertTests () {
describe('alerts', function () {

RENAME
packages/fake-driver/test/context-tests.js
packages/fake-driver/test/e2e/context-tests.js
-import { initSession, deleteSession, W3C_PREFIXED_CAPS } from './helpers';
+import { initSession, deleteSession, W3C_PREFIXED_CAPS } from '../helpers';
function contextTests () {
describe('contexts, webviews, frames', function () {

RENAME
packages/fake-driver/test/driver-e2e-specs.js
packages/fake-driver/test/e2e/driver.e2e.spec.js
import axios from 'axios';
import { baseDriverE2ETests } from '@appium/base-driver/build/test/basedriver';
-import { FakeDriver, startServer } from '../lib/index.js';
-import { BASE_CAPS, deleteSession, initSession, TEST_HOST, TEST_PORT, W3C_PREFIXED_CAPS } from './helpers';
+import { FakeDriver, startServer } from '../../lib/index.js';
+import { BASE_CAPS, deleteSession, initSession, TEST_HOST, TEST_PORT, W3C_PREFIXED_CAPS } from '../helpers';
import contextTests from './context-tests';
import findElementTests from './find-element-tests';
import elementInteractionTests from './element-interaction-tests';

RENAME
packages/fake-driver/test/element-interaction-tests.js
packages/fake-driver/test/e2e/element-interaction-tests.js
import chaiWebdriverIOAsync from 'chai-webdriverio-async';
-import { initSession, deleteSession, W3C_PREFIXED_CAPS } from './helpers';
+import { initSession, deleteSession, W3C_PREFIXED_CAPS } from '../helpers';
function elementTests () {
describe('element interaction and introspection', function () {

RENAME
packages/fake-driver/test/find-element-tests.js
packages/fake-driver/test/e2e/find-element-tests.js
-import { initSession, deleteSession, W3C_PREFIXED_CAPS } from './helpers';
+import { initSession, deleteSession, W3C_PREFIXED_CAPS } from '../helpers';
import chaiWebdriverIOAsync from 'chai-webdriverio-async';

RENAME
packages/fake-driver/test/general-tests.js
packages/fake-driver/test/e2e/general-tests.js
import chaiWebdriverIOAsync from 'chai-webdriverio-async';
-import { initSession, deleteSession, W3C_PREFIXED_CAPS } from './helpers';
+import { initSession, deleteSession, W3C_PREFIXED_CAPS } from '../helpers';
function generalTests () {
describe('generic actions', function () {

RENAME
packages/fake-driver/test/command-specs.js
packages/fake-driver/test/unit/command.spec.js
import _ from 'lodash';
-import contextCommands from '../lib/commands/contexts';
-import elementCommands from '../lib/commands/element';
-import findCommands from '../lib/commands/find';
-import generalCommands from '../lib/commands/general';
-import exportedCommands from '../lib/commands';
+import contextCommands from '../../lib/commands/contexts';
+import elementCommands from '../../lib/commands/element';
+import findCommands from '../../lib/commands/find';
+import generalCommands from '../../lib/commands/general';
+import exportedCommands from '../../lib/commands';

RENAME
packages/fake-driver/test/driver-specs.js
packages/fake-driver/test/unit/driver.spec.js
// transpile:mocha
import _ from 'lodash';
-import { FakeDriver } from '../lib';
-import { W3C_CAPS, W3C_PREFIXED_CAPS } from './helpers';
+import { FakeDriver } from '../../lib';
+import { W3C_CAPS, W3C_PREFIXED_CAPS } from '../helpers';
import { baseDriverUnitTests } from '@appium/base-driver/build/test/basedriver';

chore(fake-driver): gulp is dead, long live scripts

This PR removes Gulp from `@appium/fake-driver` as already done in a couple other packages.

Also: moved `screen.png` into `lib/` since `@babel/cli` can just copy it over into `build/`.