test: rework ui tests for new layout

This commit is contained in:
Thea Schöbl
2022-08-25 14:40:33 +00:00
committed by Rainer Killinger
parent 0bce9e5452
commit de10654675
11 changed files with 143 additions and 132 deletions

View File

@@ -27,25 +27,31 @@ describe('schedule', function () {
);
});
it('should respect the url', function () {
cy.visit('/schedule/calendar/2022-01-19');
cy.get('#date-select-button0').should('contain', '19.01.22');
});
it('should navigate a full page', function () {
cy.visit('/schedule/calendar/2022-01-19');
cy.get('.swiper-slide-active').should('contain', '19. Jan. 2022');
cy.get('.swiper-slide-active').should('contain', 'Mi');
cy.get('.left-button').click();
cy.wait(2000);
cy.get('.swiper-slide-active').should('not.contain', '19. Jan. 2022');
cy.get('.swiper-slide-active').should('contain', 'So');
cy.get('.right-button').click();
cy.wait(2000);
cy.get('.swiper-slide-active').should('contain', '19. Jan. 2022');
cy.get('.swiper-slide-active').should('contain', 'Mi');
cy.get('.right-button').click();
cy.wait(2000);
cy.get('.swiper-slide-active').should('not.contain', '19. Jan. 2022');
cy.get('.swiper-slide-active').should('contain', 'Sa');
});
for (const [width, count] of [
[760, 1],
[760, 3],
[770, 3],
[1700, 7],
]) {
@@ -53,24 +59,24 @@ describe('schedule', function () {
it(`should have ${count} slides for ${width}px`, function () {
cy.visit('/schedule/calendar/2022-01-19');
cy.viewport(width, 550);
cy.get('ion-content')
cy.get('.schedule-wrapper > .infinite-swiper-wrapper')
.find('.swiper-slide')
.should('have.length', slideMultiplier * count)
.first()
.invoke('outerWidth')
.should('be.gt', 170);
.should('be.gt', 140);
});
}
it('should navigate to a specific date', function () {
cy.visit('/schedule/calendar/2022-01-19');
cy.contains('.swiper-slide-active', '19. Jan. 2022').click();
cy.contains('#date-select-button0', '19.01.22').click();
cy.wait(2000);
cy.get('button[data-day=1][data-month=1][data-year=2022]', {
includeShadowDom: true,
}).click();
cy.wait(2000);
cy.get('.swiper-slide-active').should('contain', '1. Jan. 2022');
cy.contains('#date-select-button0', '01.01.22').click();
});
it('should add events', function () {