Closed legendecas closed 5 years ago
Is your feature request related to a problem? Please describe. Provides a series naïve API(s) to enable application UI testing.
Describe the solution you'd like
var bootstrap = require('@yodaos/volksempfanger/bootstrap') var test = require('tape') test('speech synthesis test example', t => { var tt = bootstrap() var app = tt.application() var speechSynthesis = tt.speechSynthesis() var audioFocus = tt.audioFocus() audioFocus.on('gain', focus => { speechSynthesis.startRecord() }) audioFocus.on('loss', focus => { speechSynthesis.stopRecord() var utters = speechSynthesis.getRecords() speechSynthesis.clearRecords() t.deepEqual(utters, [{ text: 'foo' }]) tt.teardown() t.end() }) app.openUrl('yoda-app://cloud-player/play?text=foo') })
A wrapper over @yodaos/volksempfanger/bootstrap with tape example:
@yodaos/volksempfanger/bootstrap
var test = require('@yodaos/volksempfanger/tape') test('speech synthesis test example', t => { var app = t.application() var speechSynthesis = t.speechSynthesis() var audioFocus = t.audioFocus() audioFocus.on('gain', focus => { speechSynthesis.startRecord() }) audioFocus.on('loss', focus => { speechSynthesis.stopRecord() var utters = speechSynthesis.getRecords() speechSynthesis.clearRecords() t.deepEqual(utters, [{ text: 'foo' }]) t.end() }) app.openUrl('yoda-app://cloud-player/play?text=foo') })
Describe alternatives you've considered Please describe alternative solutions or features you have considered.
Some methods description?
Landed on https://github.com/yodaos-project/yodart/pull/700
Is your feature request related to a problem? Please describe. Provides a series naïve API(s) to enable application UI testing.
Describe the solution you'd like
API Shapes
Bootstrap
bootstrap(): TestSuite
TestSuite
TestSuite#application(): TSApplication
TestSuite#audioFocus(): TSAudioFocus
TestSuite#speechSynthesis(): TSSpeechSynthesis
TSApplication
TSApplication#openUrl()
TSAudioFocus
TSAudioFocus#on('gain')
TSAudioFocus#on('loss')
TSSpeechSynthesis
TSSpeechSynthesis#startRecord()
TSSpeechSynthesis#stopRecord()
TSSpeechSynthesis#getRecords()
TSSpeechSynthesis#clearRecords()
Usage
A wrapper over
@yodaos/volksempfanger/bootstrap
with tape example:Describe alternatives you've considered Please describe alternative solutions or features you have considered.