Add slide mode with reveal.js

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-10-04 12:50:39 +02:00
parent 29565f8f89
commit 36e445e631
70 changed files with 1225 additions and 323 deletions

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
interface Chainable {
/**

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
interface Chainable {
/**
@ -13,7 +12,7 @@ declare namespace Cypress {
*/
fill(value: string): Chainable<Element>
codemirrorFill(value: string): Chainable<Element>
setCodemirrorContent(value: string): Chainable<Element>
}
}
@ -25,12 +24,14 @@ Cypress.Commands.add('fill', {
.trigger('change', { force: true })
})
Cypress.Commands.add('codemirrorFill', (content: string) => {
Cypress.Commands.add('setCodemirrorContent', (content: string) => {
const line = content.split('\n')
.find(value => value !== '')
cy.get('.CodeMirror')
.click()
.get('textarea')
.type('{ctrl}a')
.type('{backspace}')
.fill(content)
if (line) {
cy.get('.CodeMirror')

View file

@ -6,13 +6,13 @@
declare namespace Cypress {
interface Chainable {
getMarkdownRenderer(): Chainable<Element>
getIframeBody(): Chainable<Element>
getReveal(): Chainable<Element>
getMarkdownBody(): Chainable<Element>
}
}
Cypress.Commands.add('getMarkdownRenderer', () => {
Cypress.Commands.add('getIframeBody', () => {
return cy
.get(`iframe[data-cy="documentIframe"][data-content-ready="true"]`)
.should('be.visible')
@ -23,6 +23,10 @@ Cypress.Commands.add('getMarkdownRenderer', () => {
.then(cy.wrap.bind(cy))
})
Cypress.Commands.add('getMarkdownBody', () => {
return cy.getMarkdownRenderer().find('.markdown-body')
Cypress.Commands.add('getReveal', () => {
return cy.getIframeBody().find('.reveal')
})
Cypress.Commands.add('getMarkdownBody', () => {
return cy.getIframeBody().find('.markdown-body')
})

View file

@ -24,6 +24,6 @@ import 'cypress-file-upload'
import './checkLinks'
import './config'
import './fill'
import './getMarkdownRenderer'
import './get-iframe-content'
import './login'
import './visit-test-editor'

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
interface Chainable {
/**