Frontend: Add acceptance test

This commit is contained in:
Theresa Gresch 2020-10-20 18:10:38 +02:00
parent b5c71742d8
commit 79357aefef
2 changed files with 38 additions and 4 deletions

View file

@ -39,6 +39,7 @@ acceptance-restart:
cp -f storage/acceptance/settings/settingsBackup.yml storage/acceptance/settings/settings.yml cp -f storage/acceptance/settings/settingsBackup.yml storage/acceptance/settings/settings.yml
rm -rf storage/acceptance/originals/2010 rm -rf storage/acceptance/originals/2010
rm -rf storage/acceptance/originals/2013 rm -rf storage/acceptance/originals/2013
rm -rf storage/acceptance/originals/2017
go run cmd/photoprism/photoprism.go --public --database-driver sqlite --database-dsn ./storage/acceptance/index.db --import-path ./storage/acceptance/import --http-port=2343 --settings-path ./storage/acceptance/settings --originals-path ./storage/acceptance/originals --sidecar-json=false --sidecar-yaml=false start -d go run cmd/photoprism/photoprism.go --public --database-driver sqlite --database-dsn ./storage/acceptance/index.db --import-path ./storage/acceptance/import --http-port=2343 --settings-path ./storage/acceptance/settings --originals-path ./storage/acceptance/originals --sidecar-json=false --sidecar-yaml=false start -d
acceptance-restore-db: acceptance-restore-db:
cp -f storage/acceptance/settings/settingsBackup.yml storage/acceptance/settings/settings.yml cp -f storage/acceptance/settings/settingsBackup.yml storage/acceptance/settings/settings.yml

View file

@ -23,7 +23,7 @@ const page = new Page();
//TODO Check count in navi gets updated --> gt/lt or matches count of images //TODO Check count in navi gets updated --> gt/lt or matches count of images
//TODO videos - play video //TODO videos - play video
/*test('#1 Scroll to top', async t => { test('#1 Scroll to top', async t => {
await t await t
.click(Selector('.nav-photos')) .click(Selector('.nav-photos'))
.click(Selector('.p-expand-search')); .click(Selector('.p-expand-search'));
@ -468,7 +468,7 @@ test('#6 Archive/restore video, photos, private photos and review photos using c
logger.clear(); logger.clear();
await t await t
.expect(Selector('div').withAttribute('data-uid', FirstReviewPhoto).exists, {timeout: 5000}).ok(); .expect(Selector('div').withAttribute('data-uid', FirstReviewPhoto).exists, {timeout: 5000}).ok();
});*/ });
//TODO edited values stay after reindex!! //TODO edited values stay after reindex!!
//TODO test camera, lens //TODO test camera, lens
@ -794,7 +794,7 @@ test('#8 Change primary file', async t => {
.expect(FirstFileAfterChange).contains('photos8_2_ski.jpg'); .expect(FirstFileAfterChange).contains('photos8_2_ski.jpg');
}); });
/*test('#9 Navigate from card view to place', async t => { test('#9 Navigate from card view to place', async t => {
await t.click(Selector('.p-expand-search')); await t.click(Selector('.p-expand-search'));
await page.setFilter('view', 'Cards'); await page.setFilter('view', 'Cards');
await t await t
@ -832,4 +832,37 @@ test('#10 Ungroup files', async t => {
const PhotoCountAfterUngroup = await Selector('button.action-title-edit').count; const PhotoCountAfterUngroup = await Selector('button.action-title-edit').count;
await t await t
.expect(PhotoCountAfterUngroup).eql(2); .expect(PhotoCountAfterUngroup).eql(2);
});*/ });
test('#11 Delete non primary file', async t => {
await page.openNav();
await t
.click(Selector('.nav-library'))
//TODO Connecting... error must be moved somewhere else
.click(Selector('#tab-import'))
.click(Selector('.input-import-folder input'), {timeout: 5000})
.click(Selector('div.v-list__tile__title').withText('/pizza'))
.click(Selector('.action-import'))
//TODO replace wait
.wait(30000)
.click(Selector('.nav-photos'))
.click(Selector('.p-expand-search'));
await page.search('mogale');
const PhotoCount = await Selector('button.action-title-edit').count;
const Photo = await Selector('div.p-photo').nth(0).getAttribute('data-uid');
await t
.expect(PhotoCount).eql(1)
.click(Selector('button.action-title-edit').withAttribute('data-uid', Photo))
.click(Selector('#tab-files'))
const FileCount = await Selector('li.v-expansion-panel__container').count;
await t
.expect(FileCount).eql(2)
.click(Selector('li.v-expansion-panel__container').nth(1))
.click(Selector('.action-delete'))
.click(Selector('.action-confirm'))
.wait(12000)
const FileCountAfterDeletion = await Selector('li.v-expansion-panel__container').count;
await t
.expect(FileCountAfterDeletion).eql(1);
});