Tests: Adapt album tests to run on mobile

This commit is contained in:
theresa 2022-05-31 20:36:44 +02:00
parent 2a59eada63
commit 226ff20b9b
7 changed files with 15 additions and 12 deletions

View file

@ -43,6 +43,7 @@ test-pkg: reset-sqlite run-test-pkg
test-api: reset-sqlite run-test-api test-api: reset-sqlite run-test-api
test-short: reset-sqlite run-test-short test-short: reset-sqlite run-test-short
test-mariadb: reset-acceptance run-test-mariadb test-mariadb: reset-acceptance run-test-mariadb
test-mariadb-internal: reset-acceptance run-test-mariadb-internal
acceptance-private-run-chromium: acceptance-private-restart acceptance-private acceptance-private-stop acceptance-private-run-chromium: acceptance-private-restart acceptance-private acceptance-private-stop
acceptance-public-run-chromium: acceptance-restart acceptance acceptance-stop acceptance-public-run-chromium: acceptance-restart acceptance acceptance-stop
acceptance-private-run-firefox: acceptance-private-restart acceptance-private-firefox acceptance-private-stop acceptance-private-run-firefox: acceptance-private-restart acceptance-private-firefox acceptance-private-stop
@ -244,6 +245,9 @@ run-test-go:
run-test-mariadb: run-test-mariadb:
$(info Running all Go unit tests on MariaDB...) $(info Running all Go unit tests on MariaDB...)
PHOTOPRISM_TEST_DRIVER="mysql" PHOTOPRISM_TEST_DSN="root:photoprism@tcp(mariadb:4001)/acceptance?charset=utf8mb4,utf8&collation=utf8mb4_unicode_ci&parseTime=true" $(GOTEST) -parallel 1 -count 1 -cpu 1 -tags slow -timeout 20m ./pkg/... ./internal/... PHOTOPRISM_TEST_DRIVER="mysql" PHOTOPRISM_TEST_DSN="root:photoprism@tcp(mariadb:4001)/acceptance?charset=utf8mb4,utf8&collation=utf8mb4_unicode_ci&parseTime=true" $(GOTEST) -parallel 1 -count 1 -cpu 1 -tags slow -timeout 20m ./pkg/... ./internal/...
run-test-mariadb-internal:
$(info Running all Go unit tests on MariaDB...)
PHOTOPRISM_TEST_DRIVER="mysql" PHOTOPRISM_TEST_DSN="root:photoprism@tcp(mariadb:4001)/acceptance?charset=utf8mb4,utf8&collation=utf8mb4_unicode_ci&parseTime=true" $(GOTEST) -parallel 1 -count 1 -cpu 1 -tags slow -timeout 20m ./internal/acl ./internal/api ./internal/entity
run-test-pkg: run-test-pkg:
$(info Running all Go unit tests in "/pkg"...) $(info Running all Go unit tests in "/pkg"...)
$(GOTEST) -parallel 2 -count 1 -cpu 2 -tags slow -timeout 20m ./pkg/... $(GOTEST) -parallel 2 -count 1 -cpu 2 -tags slow -timeout 20m ./pkg/...

View file

@ -36,10 +36,10 @@ services:
PHOTOPRISM_HTTP_PORT: 2342 PHOTOPRISM_HTTP_PORT: 2342
PHOTOPRISM_HTTP_COMPRESSION: "gzip" # improves transfer speed and bandwidth utilization (none or gzip) PHOTOPRISM_HTTP_COMPRESSION: "gzip" # improves transfer speed and bandwidth utilization (none or gzip)
PHOTOPRISM_DATABASE_DRIVER: "mysql" PHOTOPRISM_DATABASE_DRIVER: "mysql"
PHOTOPRISM_DATABASE_SERVER: "mariadb:4001" PHOTOPRISM_DATABASE_SERVER: "mariadb-10-8:4001"
PHOTOPRISM_DATABASE_NAME: "latest" PHOTOPRISM_DATABASE_NAME: "photoprism"
PHOTOPRISM_DATABASE_USER: "latest" PHOTOPRISM_DATABASE_USER: "photoprism"
PHOTOPRISM_DATABASE_PASSWORD: "latest" PHOTOPRISM_DATABASE_PASSWORD: "photoprism"
PHOTOPRISM_DISABLE_CHOWN: "false" # disables storage permission updates on startup PHOTOPRISM_DISABLE_CHOWN: "false" # disables storage permission updates on startup
PHOTOPRISM_DISABLE_BACKUPS: "false" # disables backing up albums and photo metadata to YAML files PHOTOPRISM_DISABLE_BACKUPS: "false" # disables backing up albums and photo metadata to YAML files
PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server

View file

@ -40,6 +40,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App" PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App"
PHOTOPRISM_SITE_DESCRIPTION: "Tags and finds pictures without getting in your way!" PHOTOPRISM_SITE_DESCRIPTION: "Tags and finds pictures without getting in your way!"
PHOTOPRISM_SITE_AUTHOR: "@photoprism_app" PHOTOPRISM_SITE_AUTHOR: "@photoprism_app"
PHOTOPRISM_IMPRINT: "Beijing ICP Certificate No. 030123"
PHOTOPRISM_DEBUG: "true" PHOTOPRISM_DEBUG: "true"
PHOTOPRISM_READONLY: "false" PHOTOPRISM_READONLY: "false"
PHOTOPRISM_PUBLIC: "true" PHOTOPRISM_PUBLIC: "true"

View file

@ -57,7 +57,7 @@ test.meta("testID", "calendar-002")("Update calendar details", async (t) => {
await album.openNthAlbum(0); await album.openNthAlbum(0);
await t.expect(toolbar.toolbarTitle.innerText).contains("March 2014"); await t.expect(toolbar.toolbarSecondTitle.innerText).contains("March 2014");
await t.expect(toolbar.toolbarDescription.innerText).contains("We went to ski"); await t.expect(toolbar.toolbarDescription.innerText).contains("We went to ski");
await menu.openPage("calendar"); await menu.openPage("calendar");
if (t.browser.platform === "mobile") { if (t.browser.platform === "mobile") {
@ -135,7 +135,7 @@ test.meta("testID", "calendar-004").meta({ type: "smoke" })(
await menu.openPage("albums"); await menu.openPage("albums");
await album.selectAlbumFromUID(AlbumUid); await album.selectAlbumFromUID(AlbumUid);
await contextmenu.triggerContextMenuAction("delete", ""); await contextmenu.triggerContextMenuAction("delete", "");
await menu.openPage("albums"); await toolbar.triggerToolbarAction("reload");
const AlbumCountAfterDelete = await album.getAlbumCount("all"); const AlbumCountAfterDelete = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterDelete).eql(AlbumCount); await t.expect(AlbumCountAfterDelete).eql(AlbumCount);
await menu.openPage("calendar"); await menu.openPage("calendar");

View file

@ -71,7 +71,7 @@ test.meta("testID", "folders-002")("Update folder details", async (t) => {
await t await t
.expect(toolbar.toolbarDescription.nth(0).innerText) .expect(toolbar.toolbarDescription.nth(0).innerText)
.contains("Last holiday") .contains("Last holiday")
.expect(toolbar.toolbarTitle.nth(0).innerText) .expect(toolbar.toolbarSecondTitle.innerText)
.contains("MyFolder"); .contains("MyFolder");
await menu.openPage("folders"); await menu.openPage("folders");
@ -149,7 +149,6 @@ test.meta("testID", "folders-004")("Create/delete album-clone from folder", asyn
await menu.openPage("albums"); await menu.openPage("albums");
await album.selectAlbumFromUID(AlbumUid); await album.selectAlbumFromUID(AlbumUid);
await contextmenu.triggerContextMenuAction("delete", ""); await contextmenu.triggerContextMenuAction("delete", "");
await menu.openPage("albums");
const AlbumCountAfterDelete = await album.getAlbumCount("all"); const AlbumCountAfterDelete = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterDelete).eql(AlbumCount); await t.expect(AlbumCountAfterDelete).eql(AlbumCount);

View file

@ -57,7 +57,7 @@ test.meta("testID", "moments-001")("Update moment details", async (t) => {
await album.openNthAlbum(0); await album.openNthAlbum(0);
await t.expect(toolbar.toolbarTitle.innerText).contains("Winter"); await t.expect(toolbar.toolbarSecondTitle.innerText).contains("Winter");
await t.expect(toolbar.toolbarDescription.innerText).contains("We went to ski"); await t.expect(toolbar.toolbarDescription.innerText).contains("We went to ski");
await menu.openPage("moments"); await menu.openPage("moments");
@ -137,7 +137,6 @@ test.meta("testID", "moments-003")("Create/delete album-clone from moment", asyn
await menu.openPage("albums"); await menu.openPage("albums");
await album.selectAlbumFromUID(AlbumUid); await album.selectAlbumFromUID(AlbumUid);
await contextmenu.triggerContextMenuAction("delete", ""); await contextmenu.triggerContextMenuAction("delete", "");
await menu.openPage("albums");
const AlbumCountAfterDelete = await album.getAlbumCount("all"); const AlbumCountAfterDelete = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterDelete).eql(AlbumCount); await t.expect(AlbumCountAfterDelete).eql(AlbumCount);

View file

@ -17,8 +17,8 @@ type Data struct {
FileName string `meta:"FileName"` FileName string `meta:"FileName"`
DocumentID string `meta:"BurstUUID,MediaGroupUUID,ImageUniqueID,OriginalDocumentID,DocumentID,DigitalImageGUID"` DocumentID string `meta:"BurstUUID,MediaGroupUUID,ImageUniqueID,OriginalDocumentID,DocumentID,DigitalImageGUID"`
InstanceID string `meta:"InstanceID,DocumentID"` InstanceID string `meta:"InstanceID,DocumentID"`
TakenAt time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime" xmp:"DateCreated"` TakenAt time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,DateCreated,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime" xmp:"DateCreated"`
TakenAtLocal time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime"` TakenAtLocal time.Time `meta:"SubSecDateTimeOriginal,SubSecCreateDate,DateTimeOriginal,CreationDate,CreateDate,DateCreated,MediaCreateDate,ContentCreateDate,DateTimeDigitized,DateTime"`
TakenGps time.Time `meta:"GPSDateTime,GPSDateStamp"` TakenGps time.Time `meta:"GPSDateTime,GPSDateStamp"`
TakenNs int `meta:"-"` TakenNs int `meta:"-"`
TimeZone string `meta:"-"` TimeZone string `meta:"-"`