
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@appium/driver-test-support
Advanced tools
Testing utilities for Appium drivers
This package is for driver authors to help test their drivers.
Mocha is the supported test framework.
The driverE2ETestSuite
method creates a Mocha test suite which makes HTTP requests to an in-memory server leveraging your driver.
Note that this method must be run within a suite callback—not a test callback.
import {driverE2ETestSuite} from '@appium/driver-test-support';
const defaultW3CCapabilities = {
// some capabilities
};
describe('MyDriverClass', function() {
driverE2ETestSuite(MyDriverClass, defaultW3CCapabilities);
describe('more tests', function() {
// ...
});
});
The driverUnitTestSuite
method creates a Mocha test suite which performs assertions on an isolated instance of your driver.
Note that this method must be run within a suite callback—not a test callback.
import {driverUnitTestSuite} from '@appium/driver-test-support';
const defaultW3CCapabilities = {
// some capabilities
};
describe('MyDriverClass', function() {
driverUnitTestSuite(MyDriverClass, defaultW3CCapabilities);
describe('more tests', function() {
// ...
});
});
These are just some helpers (mainly for E2E tests):
import {TEST_HOST, getTestPort, createAppiumURL} from '@appium/driver-test-support';
import assert from 'node:assert';
import _ from 'lodash';
describe('TEST_HOST', function() {
it('should be localhost', function() {
assert.strictEqual(TEST_HOST, '127.0.0.1');
});
});
describe('getTestPort()', function() {
it('should get a free test port', async function() {
const port = await getTestPort();
assert.ok(port > 0);
});
});
describe('createAppiumURL()', function() {
it('should create a "new session" URL', function() {
const actual = createAppiumURL(TEST_HOST, 31337, '', 'session');
const expected = `http://${TEST_HOST}:31337/session`;
assert.strictEqual(actual, expected);
});
it('should create a URL to get an existing session', function() {
const sessionId = '12345';
const createGetSessionURL = createAppiumURL(TEST_HOST, 31337, _, 'session');
const actual = createGetSessionURL(sessionId);
const expected = `http://${TEST_HOST}:31337/session/${sessionId}/session`;
assert.strictEqual(actual, expected);
});
it('should create a URL for a command using an existing session', function() {
const sessionId = '12345';
const createURLWithPath = createAppiumURL('127.0.0.1', 31337, sessionId);
const actual = createURLWithPath('moocow');
const expected = `http://${TEST_HOST}:31337/session/${sessionId}/moocow`;
assert.strictEqual(actual, expected);
});
});
appium
and mocha
are peer dependencies.
npm install appium mocha @appium/driver-test-support --save-dev
Apache-2.0
FAQs
Test utilities for Appium drivers
The npm package @appium/driver-test-support receives a total of 117 weekly downloads. As such, @appium/driver-test-support popularity was classified as not popular.
We found that @appium/driver-test-support demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.