From 2f7bcf20d7ee2d41cba5806682ed47b413095954 Mon Sep 17 00:00:00 2001 From: theresa Date: Tue, 30 Aug 2022 10:31:25 +0200 Subject: [PATCH] Tests: Extend toolbar page model --- .../tests/acceptance/page-model/toolbar.js | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/frontend/tests/acceptance/page-model/toolbar.js b/frontend/tests/acceptance/page-model/toolbar.js index 239c7a93d..3da6c1408 100644 --- a/frontend/tests/acceptance/page-model/toolbar.js +++ b/frontend/tests/acceptance/page-model/toolbar.js @@ -10,7 +10,7 @@ export default class Page { this.toolbarDescription = Selector(".v-card__text").nth(0); this.toolbarTitle = Selector("#p-navigation div.v-toolbar__title"); this.toolbarSecondTitle = Selector("main.v-content div.v-toolbar__title"); - this.openMobileToolbar = Selector("button.nav-menu-trigger"); + this.openMobileToolbar = Selector("button.mobile-menu-trigger"); } async checkToolbarActionAvailability(action, visible) { @@ -40,6 +40,44 @@ export default class Page { } } + async checkMobileMenuActionAvailability(action, visible) { + if ( + (action !== "login") & + (action !== "logout") & + (action !== "reload") & + (action !== "logs") & + (action !== "upload") & + (action !== "settings") + ) { + if (visible) { + await t.expect(Selector("#mobile-menu div.nav-" + action).visible).ok(); + } else { + await t.expect(Selector("#mobile-menu div.nav-" + action).visible).notOk(); + } + } else { + if (visible) { + await t.expect(Selector("#mobile-menu a.nav-" + action).visible).ok(); + } else { + await t.expect(Selector("#mobile-menu a.nav-" + action).visible).notOk(); + } + } + } + + async triggerMobileMenuAction(action) { + if ( + (action !== "login") & + (action !== "logout") & + (action !== "reload") & + (action !== "logs") & + (action !== "upload") & + (action !== "settings") + ) { + await t.click(Selector("#mobile-menu div.nav-" + action + " a")); + } else { + await t.click(Selector("#mobile-menu a.nav-" + action)); + } + } + async triggerToolbarAction(action) { if ( (t.browser.platform === "mobile") &