Compare commits

...
Author SHA1 Message Date
Jonathan Lipps 01dd42ee17 Publish
- appium@2.0.0-beta.18
 - @appium/base-driver@8.1.1
 - @appium/fake-driver@3.0.5
2021-09-16 10:37:18 -07:00
Jonathan Lipps 31af0e1167 chore(base-driver): start to document BaseDriver types for TS users 2021-09-16 10:24:56 -07:00
Jonathan Lipps 4f89d398a4 Publish
- appium@2.0.0-beta.17
 - @appium/base-driver@8.1.0
 - @appium/doctor@1.16.4
 - @appium/fake-driver@3.0.4
2021-09-16 10:15:01 -07:00
Jonathan Lipps 3e5aec945b feat(base-driver): allow drivers, and plugins to declare that certain routes must never be proxied 2021-09-16 10:13:57 -07:00
Renovate Bot 650f4e2688 chore(doctor): update dependency inquirer to v8.1.5 2021-09-16 10:21:57 +00:00
Jonathan Lipps e0c7754af6 Publish
- appium@2.0.0-beta.16
 - @appium/base-driver@8.0.3
 - @appium/fake-driver@3.0.3
2021-09-15 12:02:01 -07:00
Jonathan Lipps ff3bb4f4b5 feat(appium): add env var to trigger reloading of extensions
this is useful during driver/plugin development, so the appium server does not always
need to be restarted, at least not when extensions are created on new sessions
2021-09-15 11:40:07 -07:00
Renovate Bot 96079de6b3 chore(fake-driver): update dependency asyncbox to v2.9.1 2021-09-15 08:41:36 +00:00
Jonathan Lipps 4ec2d1edd7 Publish
- appium@2.0.0-beta.15
 - @appium/base-driver@8.0.2
 - @appium/doctor@1.16.3
 - @appium/eslint-config-appium@4.7.2
 - @appium/fake-driver@3.0.2
 - @appium/gulp-plugins@5.5.3
 - @appium/support@2.54.2
 - @appium/test-support@1.3.6
2021-09-14 14:08:52 -07:00
23 changed files with 361 additions and 40 deletions
@@ -83,6 +83,22 @@ changes and automatically re-transpile the code. Usually, the same tool will
automatically run unit tests as well to ensure that nothing small has broken.
Most Appium packages have this as the default behavior when running `gulp`.
### Hacking on Extensions
If you are building an Appium driver or plugin, you can always link your development version into
an Appium server so that as you make changes, you don't have to publish/install as part of your dev
cycle:
```
appium driver install --source=/path/to/your/local/dev/repo
```
If you make changes to your extension while the Appium server is already running, those changes
won't be picked up since Appium has loaded your extension into memory. If you want to have
something approaching a "hot reload", then run appium with the `APPIUM_RELOAD_EXTENSIONS=1` env
var. This will cause Appium to reload your extension any time it would be instantiated, for
example, on a new session request.
### Linting and Style
It's important for all of Appium's JS to look and feel the same. This includes
+1 -1
View File
@@ -81,7 +81,7 @@
"@babel/register": "7.15.3",
"@babel/runtime": "7.15.4",
"appium-base-driver": "7.10.0",
"asyncbox": "2.8.0",
"asyncbox": "2.9.1",
"babel-eslint": "10.1.0",
"babel-plugin-istanbul": "6.0.0",
"babel-plugin-source-map-support": "2.1.3",
+35
View File
@@ -3,6 +3,41 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [2.0.0-beta.18](https://github.com/appium/appium/compare/appium@2.0.0-beta.17...appium@2.0.0-beta.18) (2021-09-16)
**Note:** Version bump only for package appium
# [2.0.0-beta.17](https://github.com/appium/appium/compare/appium@2.0.0-beta.16...appium@2.0.0-beta.17) (2021-09-16)
**Note:** Version bump only for package appium
# [2.0.0-beta.16](https://github.com/appium/appium/compare/appium@2.0.0-beta.15...appium@2.0.0-beta.16) (2021-09-15)
### Features
* **appium:** add env var to trigger reloading of extensions ([ff3bb4f](https://github.com/appium/appium/commit/ff3bb4f4b538ee5136fdc6356ca00e09fcdc5533))
# [2.0.0-beta.15](https://github.com/appium/appium/compare/appium@2.0.0-beta.14...appium@2.0.0-beta.15) (2021-09-14)
**Note:** Version bump only for package appium
# [2.0.0-beta.14](https://github.com/appium/appium/compare/appium@2.0.0-beta.13...appium@2.0.0-beta.14) (2021-09-14)
+7 -1
View File
@@ -203,7 +203,13 @@ export default class ExtensionConfig {
require (extName) {
const {mainClass} = this.installedExtensions[extName];
return require(this.getExtensionRequirePath(extName))[mainClass];
const reqPath = this.getExtensionRequirePath(extName);
const reqResolved = require.resolve(reqPath);
if (process.env.APPIUM_RELOAD_EXTENSIONS && require.cache[reqResolved]) {
log.debug(`Removing ${reqResolved} from require cache`);
delete require.cache[reqResolved];
}
return require(reqPath)[mainClass];
}
isInstalled (extName) {
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "appium",
"version": "2.0.0-beta.14",
"version": "2.0.0-beta.18",
"description": "Automation for Apps.",
"keywords": [
"automation",
@@ -43,13 +43,13 @@
"zip-and-upload": "npm run zip && npm run upload"
},
"dependencies": {
"@appium/base-driver": "^8.0.1",
"@appium/base-driver": "^8.1.1",
"@appium/base-plugin": "1.7.2",
"@appium/support": "^2.54.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"argparse": "2.0.1",
"async-lock": "1.3.0",
"asyncbox": "2.8.0",
"asyncbox": "2.9.1",
"axios": "0.21.4",
"bluebird": "3.7.2",
"continuation-local-storage": "3.2.1",
@@ -66,8 +66,8 @@
"yaml": "1.10.2"
},
"devDependencies": {
"@appium/fake-driver": "^3.0.1",
"@appium/gulp-plugins": "^5.5.2"
"@appium/fake-driver": "^3.0.5",
"@appium/gulp-plugins": "^5.5.3"
},
"engines": {
"node": ">=12",
+35
View File
@@ -3,6 +3,41 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [8.1.1](https://github.com/appium/appium/compare/@appium/base-driver@8.1.0...@appium/base-driver@8.1.1) (2021-09-16)
**Note:** Version bump only for package @appium/base-driver
# [8.1.0](https://github.com/appium/appium/compare/@appium/base-driver@8.0.3...@appium/base-driver@8.1.0) (2021-09-16)
### Features
* **base-driver:** allow drivers, and plugins to declare that certain routes must never be proxied ([3e5aec9](https://github.com/appium/appium/commit/3e5aec945bc0493dbd14d0759e5e35749e974aac))
## [8.0.3](https://github.com/appium/appium/compare/@appium/base-driver@8.0.2...@appium/base-driver@8.0.3) (2021-09-15)
**Note:** Version bump only for package @appium/base-driver
## [8.0.2](https://github.com/appium/appium/compare/@appium/base-driver@8.0.1...@appium/base-driver@8.0.2) (2021-09-14)
**Note:** Version bump only for package @appium/base-driver
## [8.0.1](https://github.com/appium/appium/compare/@appium/base-driver@8.0.0...@appium/base-driver@8.0.1) (2021-09-14)
**Note:** Version bump only for package @appium/base-driver
+121
View File
@@ -0,0 +1,121 @@
import { W3C_ELEMENT_KEY } from './lib/protocol/helpers'
declare class BaseDriver {
// class variables
static baseVersion: string;
static get argsConstraints(): {};
constructor(opts?: {}, shouldValidateCaps?: boolean);
// fields
sessionId: string;
opts: DriverOpts;
initialOpts: DriverOpts;
caps?: {};
originalCaps?: {};
helpers: DriverHelpers;
basePath: string;
relaxedSecurityEnabled: boolean;
allowInsecure: string[];
denyInsecure: string[];
newCommandTimeoutMs: number;
implicitWaitMs: number;
locatorStrategies: string[];
webLocatorStrategies: string[];
settings: DeviceSettings;
protocol?: string;
supportedLogTypes: {[type: string]: LogType};
// getters/setters
get driverData(): {};
get isCommandsQueueEnabled(): boolean;
get eventHistory(): {};
get desiredCapConstraints(): {};
set desiredCapConstraints(constraints: {});
// non-command methods
onUnexpectedShutdown(handler: () => any): void;
logEvent(eventName: string): void;
getStatus(): Promise<{}>;
sessionExists(sessionId: string): boolean;
logExtraCaps(caps: {}): void;
validateDesiredCaps(caps: {}): boolean;
isFeatureEnabled(name: string): boolean;
ensureFeatureEnabled(name: string): void;
executeCommand(cmd: string, ...args: any[]): Promise<any>;
startUnexpectedShutdown(err?: Error): Promise<void>;
validateLocatorStrategy(strategy: string, webContext?: boolean): void;
reset(): Promise<void>;
proxyActive(): boolean;
getProxyAvoidList(): [string, RegExp][];
canProxy(): boolean;
proxyRouteIsAvoided(sessionId: string, method: string, url: string): boolean;
addManagedDriver(driver: BaseDriver): void;
getManagedDrivers(): BaseDriver[];
clearNewCommandTimeout(): Promise<void>;
startNewCommandTimeout(): Promise<void>;
implicitWaitForCondition(condition: () => Promise<any>): Promise<any>;
// commands
createSession(jwpCaps: {}, jwpReqCaps: {}, w3cCaps: {}): Promise<[string, {}]>;
getSessions(): Promise<{id: string, capabilities: {}}>
getSession(): Promise<{}>
deleteSession(): Promise<void>;
getSettings(): Promise<DeviceSettings>;
updateSettings(newSettings: {}): Promise<DeviceSettings>;
logCustomEvent(vendor: string, event: string): void;
getLogEvents(type?: string | string[]): {};
executeDriverScript(script: string, scriptType: string, timeout: number): Promise<{}>;
findElement(strategy: string, selector: string): Promise<Element>;
findElements(strategy: string, selector: string): Promise<Element[]>;
findElementFromElement(strategy: string, selector: string, elementId: string): Promise<Element>;
findElementsFromElement(strategy: string, selector: string, elementId: string): Promise<Element[]>;
findElOrEls(strategy: string, selector: string, mult: boolean, context: string): Promise<Element>;
getLogTypes(): Promise<string[]>
getLog(logType: string): Promise<{}[]>
timeouts(type: string, ms: number, script: number, pageLoad: number, implicit: number): Promise<void>;
getTimeouts(): Promise<{command: number, implicit: number}>;
implicitWait(ms: number): Promise<void>;
newCommandTimeout(ms: number): Promise<void>;
}
declare type DriverOpts = {
tmpDir: string
[key: string]: any
}
declare type Element = {
'element-6066-11e4-a52e-4f735466cecf': string
}
declare interface DriverHelpers {
configureApp: (
app: string,
supportedAppExtensions: string[]
) => Promise<string>;
isPackageOrBundle: (app: string) => boolean;
duplicateKeys: <T>(
input: T,
firstKey: string,
secondKey: string
) => T;
parseCapsArray: (cap: string|string[]) => string[]
}
declare type SettingsUpdater = (prop: string, newValue: {}, curValue: {}) => Promise<void>;
declare class DeviceSettings {
constructor(defaultSettings: {}, onSettingsUpdate: SettingsUpdater);
update(newSettings: {}): Promise<void>;
getSettings(): DeviceSettings;
}
declare type LogType = {
description: string
getter: (driver: BaseDriver) => Promise<{}[]>
}
export { BaseDriver, DriverHelpers, DriverOpts, Element, LogType };
export default BaseDriver;
@@ -231,13 +231,15 @@ function buildHandler (app, method, path, spec, driver, isSessCmd) {
throw new errors.NoSuchDriverError();
}
// if the driver is currently proxying commands to another JSONWP
// server, bypass all our checks and assume the upstream server knows
// what it's doing. But keep this in the try/catch block so if proxying
// itself fails, we give a message to the client. Of course we only
// want to do these when we have a session command; the Appium driver
// must be responsible for start/stop session, etc...
if (isSessCmd && driverShouldDoJwpProxy(driver, req, spec.command)) {
// if the driver is currently proxying commands to another JSONWP server, bypass all our
// checks and assume the upstream server knows what it's doing. But keep this in the
// try/catch block so if proxying itself fails, we give a message to the client. Of course we
// only want to do these when we have a session command; the Appium driver must be
// responsible for start/stop session, etc... We also allow the command spec to declare that
// this command should never be proxied (which is useful for plugin developers who add
// commands and generally would not want that command to be proxied instead of handled by the
// plugin)
if (isSessCmd && !spec.neverProxy && driverShouldDoJwpProxy(driver, req, spec.command)) {
await doJwpProxy(driver, req, res);
return;
}
+6 -5
View File
@@ -11,7 +11,7 @@
"firefoxos",
"testing"
],
"version": "8.0.1",
"version": "8.1.1",
"author": "https://github.com/appium",
"license": "Apache-2.0",
"repository": {
@@ -31,6 +31,7 @@
},
"files": [
"index.js",
"index.d.ts",
"lib",
"static",
"test/basedriver",
@@ -41,10 +42,10 @@
"!build/test/basedriver/fixtures"
],
"dependencies": {
"@appium/support": "^2.54.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"async-lock": "1.3.0",
"asyncbox": "2.8.0",
"asyncbox": "2.9.1",
"axios": "0.21.4",
"bluebird": "3.7.2",
"body-parser": "1.19.0",
@@ -63,8 +64,8 @@
"ws": "7.5.5"
},
"devDependencies": {
"@appium/eslint-config-appium": "^4.7.1",
"@appium/gulp-plugins": "^5.5.2"
"@appium/eslint-config-appium": "^4.7.2",
"@appium/gulp-plugins": "^5.5.3"
},
"publishConfig": {
"access": "public"
@@ -6,6 +6,12 @@ import { util } from '@appium/support';
class FakeDriver extends BaseDriver {
static newMethodMap = {
'/session/:sessionId/noproxy': {
GET: {command: 'notProxiedCommand', neverProxy: true}
}
};
constructor () {
super();
this.protocol = PROTOCOLS.MJSONWP;
@@ -131,6 +137,10 @@ class FakeDriver extends BaseDriver {
canProxy (/*sessionId*/) {
return false;
}
async notProxiedCommand () {
return 'This was not proxied';
}
}
export { FakeDriver };
@@ -900,6 +900,7 @@ describe('Protocol', function () {
mjsonwpServer = await server({
routeConfiguringFunction: routeConfiguringFunction(driver),
port,
extraMethodMap: FakeDriver.newMethodMap
});
});
@@ -1053,5 +1054,20 @@ describe('Protocol', function () {
should.not.exist(driver.sessionId);
driver.jwpProxyActive.should.be.false;
});
it('should avoid proxying when command spec specifies neverProxy', async function () {
const {status, data} = await axios({
url: `${baseUrl}/session/${sessionId}/noproxy`,
method: 'GET',
});
status.should.equal(200);
data.should.eql({
status: 0,
value: 'This was not proxied',
sessionId
});
});
});
});
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.16.4](https://github.com/appium/appium/compare/@appium/doctor@1.16.3...@appium/doctor@1.16.4) (2021-09-16)
**Note:** Version bump only for package @appium/doctor
## [1.16.3](https://github.com/appium/appium/compare/@appium/doctor@1.16.2...@appium/doctor@1.16.3) (2021-09-14)
**Note:** Version bump only for package @appium/doctor
## [1.16.2](https://github.com/appium/appium/compare/@appium/doctor@1.16.1...@appium/doctor@1.16.2) (2021-09-14)
**Note:** Version bump only for package @appium/doctor
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/doctor",
"version": "1.16.2",
"version": "1.16.4",
"description": "Test environment for fitness to run Appium",
"keywords": [
"automation",
@@ -38,21 +38,21 @@
"build/lib"
],
"dependencies": {
"@appium/support": "^2.54.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"appium-adb": "8.14.0",
"authorize-ios": "1.2.1",
"bluebird": "3.7.2",
"colors": "1.4.0",
"inquirer": "8.1.3",
"inquirer": "8.1.5",
"lodash": "4.17.21",
"source-map-support": "0.5.20",
"teen_process": "1.16.0",
"yargs": "17.1.1"
},
"devDependencies": {
"@appium/gulp-plugins": "^5.5.2",
"@appium/test-support": "^1.3.5"
"@appium/gulp-plugins": "^5.5.3",
"@appium/test-support": "^1.3.6"
},
"engines": {
"node": ">=12",
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [4.7.2](https://github.com/appium/appium/compare/@appium/eslint-config-appium@4.7.1...@appium/eslint-config-appium@4.7.2) (2021-09-14)
**Note:** Version bump only for package @appium/eslint-config-appium
## [4.7.1](https://github.com/appium/appium/compare/@appium/eslint-config-appium@4.7.0...@appium/eslint-config-appium@4.7.1) (2021-08-16)
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/eslint-config-appium",
"version": "4.7.1",
"version": "4.7.2",
"description": "Shared config for Appium's eslint style",
"keywords": [
"eslint",
@@ -45,5 +45,4 @@
"npm": ">=6"
},
"gitHead": "ec6a90a797d2dadb407922426be16efaec9def07"
}
+32
View File
@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.0.5](https://github.com/appium/appium/compare/@appium/fake-driver@3.0.4...@appium/fake-driver@3.0.5) (2021-09-16)
**Note:** Version bump only for package @appium/fake-driver
## [3.0.4](https://github.com/appium/appium/compare/@appium/fake-driver@3.0.3...@appium/fake-driver@3.0.4) (2021-09-16)
**Note:** Version bump only for package @appium/fake-driver
## [3.0.3](https://github.com/appium/appium/compare/@appium/fake-driver@3.0.2...@appium/fake-driver@3.0.3) (2021-09-15)
**Note:** Version bump only for package @appium/fake-driver
## [3.0.2](https://github.com/appium/appium/compare/@appium/fake-driver@3.0.1...@appium/fake-driver@3.0.2) (2021-09-14)
**Note:** Version bump only for package @appium/fake-driver
## [3.0.1](https://github.com/appium/appium/compare/@appium/fake-driver@3.0.0...@appium/fake-driver@3.0.1) (2021-09-14)
**Note:** Version bump only for package @appium/fake-driver
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/fake-driver",
"version": "3.0.1",
"version": "3.0.5",
"description": "Description goes here.",
"keywords": [
"automation",
@@ -37,10 +37,10 @@
"screen.png"
],
"dependencies": {
"@appium/base-driver": "^8.0.1",
"@appium/support": "^2.54.1",
"@appium/base-driver": "^8.1.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"asyncbox": "2.8.0",
"asyncbox": "2.9.1",
"bluebird": "3.7.2",
"lodash": "4.17.21",
"source-map-support": "0.5.20",
@@ -48,7 +48,7 @@
"xpath": "0.0.32"
},
"devDependencies": {
"@appium/gulp-plugins": "^5.5.2"
"@appium/gulp-plugins": "^5.5.3"
},
"engines": {
"node": ">=12",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [5.5.3](https://github.com/appium/appium/compare/@appium/gulp-plugins@5.5.2...@appium/gulp-plugins@5.5.3) (2021-09-14)
**Note:** Version bump only for package @appium/gulp-plugins
## [5.5.2](https://github.com/appium/appium/compare/@appium/gulp-plugins@5.5.1...@appium/gulp-plugins@5.5.2) (2021-09-14)
**Note:** Version bump only for package @appium/gulp-plugins
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/gulp-plugins",
"version": "5.5.2",
"version": "5.5.3",
"description": "Custom gulp plugins to be used across all appium modules",
"keywords": [
"automation",
@@ -35,7 +35,7 @@
"build"
],
"dependencies": {
"@appium/eslint-config-appium": "^4.7.1",
"@appium/eslint-config-appium": "^4.7.2",
"@babel/core": "7.15.5",
"@babel/plugin-proposal-class-properties": "7.14.5",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.14.5",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.54.2](https://github.com/appium/appium/compare/@appium/support@2.54.1...@appium/support@2.54.2) (2021-09-14)
**Note:** Version bump only for package @appium/support
## [2.54.1](https://github.com/appium/appium/compare/@appium/support@2.54.0...@appium/support@2.54.1) (2021-09-14)
**Note:** Version bump only for package @appium/support
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/support",
"version": "2.54.1",
"version": "2.54.2",
"description": "Support libs used across appium packages",
"keywords": [
"automation",
@@ -68,7 +68,7 @@
"yauzl": "2.10.0"
},
"devDependencies": {
"@appium/gulp-plugins": "^5.5.2"
"@appium/gulp-plugins": "^5.5.3"
},
"engines": {
"node": ">=12",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.6](https://github.com/appium/appium/compare/@appium/test-support@1.3.5...@appium/test-support@1.3.6) (2021-09-14)
**Note:** Version bump only for package @appium/test-support
## [1.3.5](https://github.com/appium/appium/compare/@appium/test-support@1.3.4...@appium/test-support@1.3.5) (2021-09-14)
**Note:** Version bump only for package @appium/test-support
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/test-support",
"version": "1.3.5",
"version": "1.3.6",
"description": "A collection of test utilities used across Appium packages",
"keywords": [
"automation",
@@ -37,7 +37,7 @@
"build/lib"
],
"dependencies": {
"@appium/support": "^2.54.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"bluebird": "3.7.2",
"lodash": "4.17.21",
@@ -46,8 +46,8 @@
"source-map-support": "0.5.20"
},
"devDependencies": {
"@appium/eslint-config-appium": "^4.7.1",
"@appium/gulp-plugins": "^5.5.2"
"@appium/eslint-config-appium": "^4.7.2",
"@appium/gulp-plugins": "^5.5.3"
},
"engines": {
"node": ">=12",