From 6f42e0ea0ec0cee9161230ccbccebfa906f92970 Mon Sep 17 00:00:00 2001 From: AleAb25 <55090252+AleAb25@users.noreply.github.com> Date: Wed, 13 Nov 2019 19:44:05 +0000 Subject: [PATCH] [AAE-485] - empty value for CardView Int Item e2e test (#5240) * AAE-485 - empty value e2e test * Updated test with try-catch block for AAE-485 / C321535 --- e2e/core/card-view/card-view-component.e2e.ts | 9 ++++++++- e2e/pages/adf/cardViewComponentPage.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/e2e/core/card-view/card-view-component.e2e.ts b/e2e/core/card-view/card-view-component.e2e.ts index 642ec86a82..209aac8fa4 100644 --- a/e2e/core/card-view/card-view-component.e2e.ts +++ b/e2e/core/card-view/card-view-component.e2e.ts @@ -157,7 +157,7 @@ describe('CardView Component', () => { await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format'); }); - it('[C279949] Should not be possible have an empty value', async () => { + it('[C279949] Should not be possible to have a space as a value', async () => { await cardViewPageComponent.clickOnIntField(); await cardViewPageComponent.enterIntField(' '); await cardViewPageComponent.clickOnIntSaveIcon(); @@ -165,6 +165,13 @@ describe('CardView Component', () => { await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format'); }); + it('[C321535] Should be able to delete the value and save the CardView Int Item', async () => { + await cardViewPageComponent.clickOnIntField(); + await cardViewPageComponent.clearIntField(); + await cardViewPageComponent.clickOnIntSaveIcon(); + await expect(await cardViewPageComponent.isErrorNotDisplayed()).toBe(true, 'The CardView Int Item should accept an empty field, but the error message is still displayed'); + }); + it('[C279950] Should return an error when the value is > 2147483647', async () => { await cardViewPageComponent.clickOnIntField(); await cardViewPageComponent.enterIntField('214748367'); diff --git a/e2e/pages/adf/cardViewComponentPage.ts b/e2e/pages/adf/cardViewComponentPage.ts index fd9386b16a..1d5835f598 100644 --- a/e2e/pages/adf/cardViewComponentPage.ts +++ b/e2e/pages/adf/cardViewComponentPage.ts @@ -218,4 +218,18 @@ export class CardViewComponentPage { } } + async isErrorNotDisplayed(): Promise { + const errorElement: ElementFinder = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]')); + try { + await BrowserVisibility.waitUntilElementIsNotVisible(errorElement); + return true; + } catch { + return false; + } + } + + async clearIntField(): Promise { + await this.intField.clear(); + } + }