Fixed e2e tests

This commit is contained in:
Toni Matković 2019-11-06 11:47:55 +01:00
parent 26f101d090
commit a37ff70c98

View File

@ -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.');
});
});