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:
parent
81843ddf9b
commit
b5f36fb8f2
@ -282,7 +282,7 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// this.nextPhoto.emit();
|
||||
this.nextPhoto.emit();
|
||||
};
|
||||
|
||||
private drawSliderProgress(t: number) {
|
||||
|
@ -71,6 +71,29 @@ describe('Gallery', () => {
|
||||
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', () => {
|
||||
// ignore noisy tests
|
||||
cy.on('fail', (err, runnable) => {
|
||||
|
Loading…
Reference in New Issue
Block a user