it('should be able to produce and consume messages with one header value as buffer: consumeLoop', function(done) { var headers = [ { key: Buffer.from('value') } ]; this.timeout(5000); run_headers_test(done, headers); });
prompt.once('run', async() => { for (let step of store.get(prompt.name)) { await timeout(() => prompt.keypress(...step.keypress), step.interval); } });
it('should fetch a valid application list for the top free collection', () => { return gplay.list({ collection: gplay.collection.TOP_FREE, num: 100 }) .then((apps) => apps.map(assertValidApp)) .then((apps) => apps.map((app) => assert(app.free))); }).timeout(timeout);
describe('Check Gmail signup', () => { it('Landing page has CTA button', async () => { await page.setViewport({ width: 1280, height: 800 }) await page.goto('https://www.google.com/gmail/about/', { waitUntil: 'networkidle0' }) const SignUpButton = await page.$('a.hero_home__link__desktop') assert.ok(SignUpButton) }).timeout(10000) })
it('.emit()', async function() { expect(emitter.emit('a')).to.be.a('promise'); const array = []; emitter.on('a', () => array.push(1)); emitter.on('a', async () => { await timeout(10); array.push(2); }); emitter.on('a', () => array.push(3)); expect(await emitter.emit('a')).to.be.true; expect(array).to.have.ordered.members([1, 2, 3]); });
/** * Set timeout for this test * @param {*} timeout */ timeout(timeout) { this.scenarios.forEach(scenario => scenario.timeout(timeout)); return this; }
it('It should not fail with apps with no downloads and fullDetail', () => gplay.list({ category: gplay.category.GAME_ACTION, collection: gplay.collection.TOP_FREE, num: 10, fullDetail: true }) .then((apps) => apps.map(assertValidApp)) ).timeout(timeout);
it('should be able to produce and consume messages with multiple headers value as buffer: consumeLoop', function(done) { var headers = [ { key1: Buffer.from('value1') }, { key2: Buffer.from('value2') }, { key3: Buffer.from('value3') }, { key4: Buffer.from('value4') }, ]; this.timeout(5000); run_headers_test(done, headers); });
it('should be able to produce and consume messages with one header value as string: consumeLoop', function(done) { var headers = [ { key: "value" } ]; this.timeout(5000); run_headers_test(done, headers); });
it('should fetch a valid application list for the top paid collection', () => { return gplay.list({ collection: gplay.collection.TOP_PAID, num: 100 }) .then((apps) => apps.map(assertValidApp)) .then((apps) => apps.map((app) => assert.isFalse(app.free))); }).timeout(timeout);
it('should fetch a valid application list for the new free collection', () => { return gplay.list({ collection: gplay.collection.NEW_FREE, num: 100 }) .then((apps) => apps.map(assertValidApp)) .then((apps) => apps.map((app) => assert(app.free))); }).timeout(timeout);
it('should fetch a valid application list for the new games free collection', () => { return gplay.list({ collection: gplay.collection.NEW_FREE_GAMES, num: 100 }) .then((apps) => apps.map(assertValidApp)) .then((apps) => apps.map((app) => assert(app.free))); }).timeout(timeout);
prompt.once('run', async() => { for (let step of store.get(prompt.name)) { await timeout(() => prompt.keypress(...step.keypress), step.interval); } });
it('.emit()', async function() { expect(emitter.emit('a')).to.be.a('promise'); const array = []; emitter.on('a', () => array.push(1)); emitter.on('a', async () => { await timeout(10); array.push(2); }); emitter.on('a', () => array.push(3)); expect(await emitter.emit('a')).to.be.true; expect(array).to.have.ordered.members([1, 2, 3]); });