Closed ameliemaia closed 7 years ago
Hey @amelierosser I can't access that link. Can you add me or post a public link?
Hi Ian, here's the code snippet!
'audio seeks': function() {
return (
this.remote
.get(require.toUrl(`${utils.getBaseUrl()}/sono/seek.html`))
// Wait for the page to load
.sleep(1000)
// Play the audio
.execute(function() {
document.defaultView.testCase.player.play();
})
// Wait for the audio to play a little
.sleep(2000)
// Pause the audio and set the current time
.execute(function() {
document.defaultView.testCase.player.pause();
document.defaultView.testCase.player.currentTime = 10;
})
// Wait a little more to make sure the audio currentTime doesn't change
.sleep(1000)
// Return the final currentTime
.execute(function() {
return document.defaultView.testCase.player.currentTime;
})
// Test whether the currentTime is equal to the seeked time
.then(currentTime => {
assert.equal(currentTime, 10);
})
);
Thanks Amelie, I'll take a look.
Thank you Ian, it passed the test perfectly!
Hi, I've just began testing sono in https://github.com/Stinkstudios/boilerplate-component-test/blob/feature/sono/tests/functional/sono/_suite.js#L120.
When trying to set the currentTime or seek() I've noticed:
What should happen: