From 18f43cd6fe46c353f2a349ed476ad2b5a2d78bc1 Mon Sep 17 00:00:00 2001 From: theresa Date: Tue, 15 Nov 2022 15:08:12 +0100 Subject: [PATCH] Tests: Refactor acceptance tests --- .../acceptance/page-model/dialog-share.js | 2 +- frontend/tests/acceptance/page-model/menu.js | 2 +- .../tests/acceptance/page-model/photo-edit.js | 4 +- .../tests/acceptance/page-model/settings.js | 48 ++++++++++--------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/frontend/tests/acceptance/page-model/dialog-share.js b/frontend/tests/acceptance/page-model/dialog-share.js index 4fb63afc4..8ffcfb5e7 100644 --- a/frontend/tests/acceptance/page-model/dialog-share.js +++ b/frontend/tests/acceptance/page-model/dialog-share.js @@ -9,6 +9,6 @@ export default class Page { this.expandLink = Selector("div.v-expansion-panel__header__icon", { timeout: 15000 }); this.linkUrl = Selector(".action-url", { timeout: 15000 }); this.linkSecretInput = Selector(".input-secret input", { timeout: 15000 }); - this.linkExpireInput = Selector(".input-expires input", { timeout: 15000 }); + this.linkExpireInput = Selector(".input-expires div.v-select__selections", { timeout: 15000 }); } } diff --git a/frontend/tests/acceptance/page-model/menu.js b/frontend/tests/acceptance/page-model/menu.js index faad14185..1b2930743 100644 --- a/frontend/tests/acceptance/page-model/menu.js +++ b/frontend/tests/acceptance/page-model/menu.js @@ -5,7 +5,7 @@ export default class Page { async openNav() { if (await Selector("div.nav-expand").visible) { - await t.click(Selector("div.nav-expand")); + await t.click(Selector("div.nav-expand a")); } else if (await Selector("div.nav-expand").visible) { await t.click(Selector("div.nav-expand i")); } diff --git a/frontend/tests/acceptance/page-model/photo-edit.js b/frontend/tests/acceptance/page-model/photo-edit.js index e90430846..5d76c6010 100644 --- a/frontend/tests/acceptance/page-model/photo-edit.js +++ b/frontend/tests/acceptance/page-model/photo-edit.js @@ -153,7 +153,7 @@ export default class Page { ) ) .ok() - .click(Selector(".input-" + type + " input")) + .click(Selector(".input-" + type + " input + div.v-input--selection-controls__ripple")) .expect( Selector(".input-" + type + " input", { timeout: 8000 }).hasAttribute( "aria-checked", @@ -173,7 +173,7 @@ export default class Page { ) ) .ok() - .click(Selector(".input-" + type + " input")) + .click(Selector(".input-" + type + " input + div.v-input--selection-controls__ripple")) .expect( Selector(".input-" + type + " input", { timeout: 8000 }).hasAttribute( "aria-checked", diff --git a/frontend/tests/acceptance/page-model/settings.js b/frontend/tests/acceptance/page-model/settings.js index 36616a1f1..b668d1cc8 100644 --- a/frontend/tests/acceptance/page-model/settings.js +++ b/frontend/tests/acceptance/page-model/settings.js @@ -4,29 +4,34 @@ export default class Page { constructor() { this.generalTab = Selector("#tab-settings_general"); this.languageInput = Selector(".input-language input"); - this.uploadCheckbox = Selector(".input-upload input"); - this.downloadCheckbox = Selector(".input-download input"); - this.importCheckbox = Selector(".input-import input"); - this.archiveCheckbox = Selector('input[aria-label="Archive"]'); - this.editCheckbox = Selector(".input-edit input"); - this.filesCheckbox = Selector(".input-files input"); - this.momentsCheckbox = Selector(".input-moments input"); - this.labelsCheckbox = Selector(".input-labels input"); - this.logsCheckbox = Selector(".input-logs input"); - this.shareCheckbox = Selector(".input-share input"); - this.placesCheckbox = Selector('input[aria-label="Places"]'); - this.privateCheckbox = Selector('input[aria-label="Private"]'); - this.peopleCheckbox = Selector(".input-people input"); - this.deleteCheckbox = Selector(".input-delete input"); - this.libraryCheckbox = Selector(".input-library input"); + this.languageOpenSelection = Selector(".input-language div.v-select__selections"); + this.uploadCheckbox = Selector(".input-upload div.v-input--selection-controls__ripple"); + this.downloadCheckbox = Selector(".input-download div.v-input--selection-controls__ripple"); + this.importCheckbox = Selector(".input-import div.v-input--selection-controls__ripple"); + this.archiveCheckbox = Selector(".input-archive div.v-input--selection-controls__ripple"); + this.editCheckbox = Selector(".input-edit div.v-input--selection-controls__ripple"); + this.filesCheckbox = Selector(".input-files div.v-input--selection-controls__ripple"); + this.momentsCheckbox = Selector(".input-moments div.v-input--selection-controls__ripple"); + this.labelsCheckbox = Selector(".input-labels div.v-input--selection-controls__ripple"); + this.logsCheckbox = Selector(".input-logs div.v-input--selection-controls__ripple"); + this.shareCheckbox = Selector(".input-share div.v-input--selection-controls__ripple"); + this.placesCheckbox = Selector(".input-places div.v-input--selection-controls__ripple"); + this.privateCheckbox = Selector( + 'input[aria-label="Private"] + div.v-input--selection-controls__ripple' + ); + this.peopleCheckbox = Selector(".input-people div.v-input--selection-controls__ripple"); + this.deleteCheckbox = Selector(".input-delete div.v-input--selection-controls__ripple"); + this.libraryCheckbox = Selector(".input-library div.v-input--selection-controls__ripple"); this.libraryTab = Selector("#tab-settings_media"); - this.reviewCheckbox = Selector(".input-review input"); - this.convertCheckbox = Selector(".input-convert input"); - this.estimatesCheckbox = Selector(".input-estimates input"); - this.dateTimeStacksCheckbox = Selector(".input-stack-meta input"); - this.uuidStacksCheckbox = Selector(".input-stack-uuid input"); - this.nameStacksCheckbox = Selector(".input-stack-name input"); + this.reviewCheckbox = Selector(".input-review div.v-input--selection-controls__ripple"); + this.convertCheckbox = Selector(".input-convert div.v-input--selection-controls__ripple"); + this.estimatesCheckbox = Selector(".input-estimates div.v-input--selection-controls__ripple"); + this.dateTimeStacksCheckbox = Selector( + ".input-stack-meta div.v-input--selection-controls__ripple" + ); + this.uuidStacksCheckbox = Selector(".input-stack-uuid div.v-input--selection-controls__ripple"); + this.nameStacksCheckbox = Selector(".input-stack-name div.v-input--selection-controls__ripple"); this.advancedTab = Selector("#tab-settings_advanced"); this.debugCheckbox = Selector("label").withText("Debug Logs"); @@ -38,6 +43,5 @@ export default class Page { this.accountTab = Selector("#tab-settings_account"); this.servicesTab = Selector("#tab-settings_services"); - } }