From a67263462cdf5f762266d924166183b9231e7044 Mon Sep 17 00:00:00 2001 From: jdosti Date: Fri, 14 Sep 2018 12:51:41 +0100 Subject: [PATCH] [ADF-3556] Create an automated test to cover sidebar position (#3788) --- e2e/core/header_component.e2e.ts | 7 +++++++ e2e/pages/adf/core/headerPage.ts | 26 +++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/e2e/core/header_component.e2e.ts b/e2e/core/header_component.e2e.ts index 245e36b450..50a400705e 100644 --- a/e2e/core/header_component.e2e.ts +++ b/e2e/core/header_component.e2e.ts @@ -148,4 +148,11 @@ describe('Header Component', () => { navigationBarPage.checkLogoTooltip(names.logo_tooltip); }); + + it('[C286297] Should be able to change the position of the sidebar menu', () => { + headerPage.sideBarPositionEnd(); + headerPage.checkSidebarPositionEnd(); + headerPage.sideBarPositionStart(); + headerPage.checkSidebarPositionStart(); + }); }); diff --git a/e2e/pages/adf/core/headerPage.ts b/e2e/pages/adf/core/headerPage.ts index 5e6f8c0582..5c73e72831 100644 --- a/e2e/pages/adf/core/headerPage.ts +++ b/e2e/pages/adf/core/headerPage.ts @@ -27,7 +27,11 @@ export class HeaderPage { iconInput = element(by.css('input[placeholder="URL path"]')); hexColorInput = element(by.css('input[placeholder="hex color code"]')); logoHyperlinkInput = element(by.css('input[placeholder="Redirect URL"]')); - logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]')); + logoTooltipInput = element(by.css('input[placeholder="Tooltip text"]')); + positionStart = element(by.css('mat-radio-button[value="start"]')); + positionEnd = element(by.css('mat-radio-button[value="end"]')); + sideBarPositionRight = element(by.css('mat-sidenav.mat-drawer.mat-sidenav.mat-drawer-end')); + sideBarPositionLeft = element(by.css('mat-sidenav.mat-drawer.mat-sidenav')); checkShowMenuCheckBoxIsDisplayed() { return Util.waitUntilElementIsVisible(this.checkBox); @@ -106,4 +110,24 @@ export class HeaderPage { Util.waitUntilElementIsVisible(this.logoTooltipInput); return this.logoTooltipInput.click().sendKeys(tooltip).sendKeys(protractor.Key.ENTER); } + + sideBarPositionStart() { + Util.waitUntilElementIsVisible(this.positionStart); + return this.positionStart.click(); + } + + sideBarPositionEnd() { + Util.waitUntilElementIsVisible(this.positionEnd); + return this.positionEnd.click(); + } + + checkSidebarPositionStart() { + return Util.waitUntilElementIsVisible(this.sideBarPositionLeft); + } + + checkSidebarPositionEnd() { + return Util.waitUntilElementIsVisible(this.sideBarPositionRight); + } + } +