mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 06:04:56 +03:00
Fixed e2e tests
This commit is contained in:
parent
26f101d090
commit
a37ff70c98
|
@ -1,6 +1,6 @@
|
|||
describe('Infinite scroll disabling', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('disable-infinite-scroll-index.html');
|
||||
cy.visit('e2e/disable-infinite-scroll-index.html');
|
||||
});
|
||||
|
||||
it('should initially have only info component', () => {
|
||||
|
@ -8,30 +8,38 @@ describe('Infinite scroll disabling', () => {
|
|||
.children()
|
||||
.should('have.length', 2)
|
||||
.first()
|
||||
.should('have.text', 'Swagger Petstore')
|
||||
.find('h1')
|
||||
.should('include.text', 'Swagger Petstore');
|
||||
cy.get('.api-content')
|
||||
.children()
|
||||
.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.');
|
||||
.find('h1')
|
||||
.should('include.text', 'Introduction');
|
||||
});
|
||||
|
||||
it('should test group menu item click', () => {
|
||||
cy.contains('pet')
|
||||
.click()
|
||||
.click();
|
||||
cy.get('[id="tag/pet"]')
|
||||
.children()
|
||||
.should('have.length', 2)
|
||||
.first()
|
||||
.should('have.text', 'pet')
|
||||
.should('have.text', 'pet');
|
||||
cy.get('[id="tag/pet"]')
|
||||
.children()
|
||||
.last()
|
||||
.should('have.text', 'Everything about your Pets');
|
||||
.should('have.text', 'Everything about your Pets\n');
|
||||
});
|
||||
|
||||
it('should render only 1 component after menu item click', () => {
|
||||
cy.contains('pet')
|
||||
.click();
|
||||
cy.contains('Add a new pet to the store')
|
||||
.click()
|
||||
.window().then($window => {
|
||||
expect($window.scrollY).to.be.closeTo(350, 20);
|
||||
});
|
||||
cy.contains('Add a new pet to the store');
|
||||
cy.contains('Add new pet to the store inventory.');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user