mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 17:01:03 +00:00
a398660c18
* Add function for test attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Adjust components Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Fix naming of attribute Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Rename method, interface, attribute and use interface Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Lint and format fix Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
32 lines
793 B
TypeScript
32 lines
793 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
declare namespace Cypress {
|
|
interface Chainable {
|
|
getIframeBody(): Chainable<Element>
|
|
getReveal(): Chainable<Element>
|
|
getMarkdownBody(): Chainable<Element>
|
|
}
|
|
}
|
|
|
|
Cypress.Commands.add('getIframeBody', () => {
|
|
return cy
|
|
.get(`iframe[data-cypress-id="documentIframe"][data-content-ready="true"]`)
|
|
.should('be.visible')
|
|
.its('0.contentDocument')
|
|
.should('exist')
|
|
.its('body')
|
|
.should('not.be.undefined')
|
|
.then(cy.wrap.bind(cy))
|
|
})
|
|
|
|
Cypress.Commands.add('getReveal', () => {
|
|
return cy.getIframeBody().find('.reveal')
|
|
})
|
|
|
|
Cypress.Commands.add('getMarkdownBody', () => {
|
|
return cy.getIframeBody().find('.markdown-body')
|
|
})
|