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
12 changed files with 224 additions and 15 deletions
+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.
# [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)
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "appium",
"version": "2.0.0-beta.16",
"version": "2.0.0-beta.18",
"description": "Automation for Apps.",
"keywords": [
"automation",
@@ -43,7 +43,7 @@
"zip-and-upload": "npm run zip && npm run upload"
},
"dependencies": {
"@appium/base-driver": "^8.0.3",
"@appium/base-driver": "^8.1.1",
"@appium/base-plugin": "1.7.2",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
@@ -66,7 +66,7 @@
"yaml": "1.10.2"
},
"devDependencies": {
"@appium/fake-driver": "^3.0.3",
"@appium/fake-driver": "^3.0.5",
"@appium/gulp-plugins": "^5.5.3"
},
"engines": {
+19
View File
@@ -3,6 +3,25 @@
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
+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;
}
+2 -1
View File
@@ -11,7 +11,7 @@
"firefoxos",
"testing"
],
"version": "8.0.3",
"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",
@@ -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
});
});
});
});
+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.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
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/doctor",
"version": "1.16.3",
"version": "1.16.4",
"description": "Test environment for fitness to run Appium",
"keywords": [
"automation",
@@ -44,7 +44,7 @@
"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",
+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.
## [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
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@appium/fake-driver",
"version": "3.0.3",
"version": "3.0.5",
"description": "Description goes here.",
"keywords": [
"automation",
@@ -37,7 +37,7 @@
"screen.png"
],
"dependencies": {
"@appium/base-driver": "^8.0.3",
"@appium/base-driver": "^8.1.1",
"@appium/support": "^2.54.2",
"@babel/runtime": "7.15.4",
"asyncbox": "2.9.1",