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(); + } + }