mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
Added e2e tests
This commit is contained in:
parent
8a99f59ba5
commit
26f101d090
|
@ -0,0 +1,8 @@
|
|||
<html>
|
||||
|
||||
<body>
|
||||
<redoc spec-url="../demo/openapi.yaml" disable-infinite-scroll="true"></redoc>
|
||||
<script src="../bundles/redoc.standalone.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
describe('Infinite scroll disabling', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('disable-infinite-scroll-index.html');
|
||||
});
|
||||
|
||||
it('should initially have only info component', () => {
|
||||
cy.get('.api-content')
|
||||
.children()
|
||||
.should('have.length', 2)
|
||||
.first()
|
||||
.should('have.text', 'Swagger Petstore')
|
||||
.last()
|
||||
.should('have.text', 'Introduction');
|
||||
});
|
||||
|
||||
it('should render only 1 component after menu item click', () => {
|
||||
cy.contains('pet')
|
||||
.click()
|
||||
.contains('Add a new pet to the store')
|
||||
.click()
|
||||
.window().then($window => {
|
||||
expect($window.scrollY).to.be.closeTo(300, 20); })
|
||||
.get('#operation/addPet')
|
||||
.should(' have.text', 'Add new pet to the store inventory.');
|
||||
});
|
||||
|
||||
it('should test group menu item click', () => {
|
||||
cy.contains('pet')
|
||||
.click()
|
||||
.children()
|
||||
.should('have.length', 2)
|
||||
.first()
|
||||
.should('have.text', 'pet')
|
||||
.last()
|
||||
.should('have.text', 'Everything about your Pets');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user