Gathering detailed insights and metrics for appium-test-support
Gathering detailed insights and metrics for appium-test-support
Gathering detailed insights and metrics for appium-test-support
Gathering detailed insights and metrics for appium-test-support
A collection of test utility lib used across Appium packages
npm install appium-test-support
Typescript
Module System
Node Version
NPM Version
JavaScript (81.83%)
Shell (18.17%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
4 Stars
127 Commits
6 Forks
14 Watchers
1 Branches
21 Contributors
Updated on Oct 25, 2023
Latest Version
1.3.3
Package Id
appium-test-support@1.3.3
Unpacked Size
40.36 kB
Size
14.27 kB
File Count
21
NPM Version
6.14.5
Node Version
13.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A collection of test utility lib used across Appium packages.
npm install appium-test-support --save-dev
1import { stubEnv } from 'appium-test-support'; 2 3describe('myTest', () => { 4 stubEnv(); 5 it('setting env variable', () => { 6 // Changes to process.env will stay local 7 process.env.ABC = 'abc'; 8 }); 9});
1import { stubLog } from 'appium-test-support'; 2 3describe('myTest', () => { 4 let sandbox; 5 // configure sandbox here... 6 7 it('stubbing log', () => { 8 let logStub = stubLog(sandbox, log); 9 log.info('Hello World!'); 10 log.warn(`The ${'sun'.yellow} is shining!`); 11 logStub.output.should.equals([ 12 'info: Hello World!', 13 `warn: The ${'sun'.yellow} is shining!` 14 ].join('\n')); 15 }); 16 it('stubbing log stripping colors', () => { 17 let logStub = stubLog(sandbox, log, {stripColors: true}); 18 log.info('Hello World!'); 19 log.warn(`The ${'sun'.yellow} is shining!`); 20 logStub.output.should.equals([ 21 'info: Hello World!', 22 'warn: The sun is shining!' 23 ].join('\n')); 24 }); 25});
Use when mixing up sinon apis (mocks, spies stubs).
1import { withSandbox } from 'appium-test-support'; 2 3let api = { 4 abc: () => { return 'abc'; } 5}; 6 7describe('MyTest', withSandbox({mocks: {api}}, (S) => { 8 it('stubbing api, stubbing dog', () => { 9 S.mocks.api.expects('abc').once().returns('efg'); 10 let dog = { bark: () => { return 'ouaf!'; } }; 11 S.sandbox.stub(dog, 'bark').returns('miaou'); 12 api.abc().should.equal('efg'); 13 dog.bark().should.equal('miaou'); 14 S.verify(); 15 }); 16}));
When using mainly stubs.
1import { withMocks } from 'appium-test-support'; 2 3let api = { 4 abc: () => { return 'abc'; } 5}; 6 7describe('withMocks', withMocks({api}, (mocks) => { 8 it('should mock api', () => { 9 mocks.api.expects('abc').once().returns('efg'); 10 api.abc().should.equal('efg'); 11 mocks.verify(); 12 }); 13}));
1import { fakeTime } from 'appium-test-support'; 2 3function doSomething() { 4 return new B.Promise((resolve) => { 5 let ret = ''; 6 function appendOneByOne () { 7 if(ret.length >= 10) { 8 return resolve(ret); 9 } 10 setTimeout(() => { 11 ret = ret + ret.length; 12 appendOneByOne(); 13 }, 1000); 14 } 15 appendOneByOne(); 16 }); 17} 18 19describe('fakeTime', () => { 20 let sandbox; 21 // create sandbox ... 22 23 it('should fake time', async () => { 24 let timeLord = fakeTime(sandbox); 25 let p = doSomething(); 26 timeLord.speedup(200, 60); // interval=200, times=60 27 (await p).should.equals('0123456789'); 28 }); 29});
On Travis, setting up an emulator takes a lot of boilerplate. While the configuration needs to be done on a case-by-case basis, the actual startup can be scripted. Toward that, there are two scripts:
android-emu-travis-pre
- creates a device (configured with the environment variables
ANDROID_EMU_NAME
, ANDROID_EMU_TARGET
, and ANDROID_EMU_ABI
) and starts it
in the backgroundandroid-emu-travis-post
- waits for the device to be booted, and then goes
to its home screennpm run watch
npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
Found 4/14 approved changesets -- score normalized to 2
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More