1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fix autoplay bug also add E2E test for checking it #725

This commit is contained in:
Patrik J. Braun 2023-10-06 01:04:25 +02:00
parent 81843ddf9b
commit b5f36fb8f2
2 changed files with 24 additions and 1 deletions

View File

@ -282,7 +282,7 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
) { ) {
return; return;
} }
// this.nextPhoto.emit(); this.nextPhoto.emit();
}; };
private drawSliderProgress(t: number) { private drawSliderProgress(t: number) {

View File

@ -71,6 +71,29 @@ describe('Gallery', () => {
cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel');
}); });
it('Gallery should auto play in lightbox', () => {
cy.wait('@getContent');
// contains a folder
cy.get('app-gallery-directories.directories > app-gallery-directory > .button > .photo-container');
for (let i = 0; i < 5; ++i) {
cy.window().scrollTo(0, 9000, {ensureScrollable: false, duration: 100, easing: 'linear'}).wait(500);
}
cy.visit('/gallery/?p=IMG_5910.jpg');
cy.get('app-gallery-lightbox-media img[alt="IMG_5910.jpg"]');
cy.get('.controls-background ng-icon[name="ionPlayOutline"]').click({scrollBehavior: false});
cy.wait(5000); // autoplay default delay is 5s
cy.get('app-gallery-lightbox-media img[alt="IMG_6220.jpg"]', {timeout: 2000});
});
it('Gallery should auto open lightbox for IMG_5910.jpg', () => { it('Gallery should auto open lightbox for IMG_5910.jpg', () => {
// ignore noisy tests // ignore noisy tests
cy.on('fail', (err, runnable) => { cy.on('fail', (err, runnable) => {