decktape/plugins/deck.js
Antonin Stefanutti 820176b217 Migrate to ES6
2017-08-25 15:18:07 +02:00

29 lines
515 B
JavaScript

exports.create = page => new Deck(page);
class Deck {
constructor(page) {
this.page = page;
}
getName() {
return 'Deck JS';
}
isActive() {
return this.page.evaluate(_ => typeof $ === 'function' && typeof $.deck === 'function');
}
slideCount() {
return this.page.evaluate(_ => $.deck('getSlides').length);
}
nextSlide() {
return this.page.evaluate(_ => $.deck('next'));
}
currentSlideIndex() {
return this.page.evaluate(_ => $.deck('getSlide').attr('id'));
}
}