mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-1839] Card View E2E (#5472)
This commit is contained in:
@@ -286,6 +286,19 @@ describe('CardView Component', () => {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('[C306895] Should display the form field as editable and clickable depending on the \'Editable\' toggle mode.', async () => {
|
||||||
|
const message = 'clickable updated';
|
||||||
|
await cardViewPageComponent.clickOnResetButton();
|
||||||
|
await expect(await cardViewPageComponent.getClickableValue()).toContain('click here');
|
||||||
|
|
||||||
|
await cardViewPageComponent.updateClickableField(message);
|
||||||
|
await expect(await cardViewPageComponent.hasCardViewConsoleLog(message)).toContain(`[This is clickable ] - ${message}`);
|
||||||
|
|
||||||
|
await cardViewPageComponent.clickOnResetButton();
|
||||||
|
await cardViewPageComponent.updateClickableField('');
|
||||||
|
await expect(await cardViewPageComponent.hasCardViewConsoleLog('[This is clickable ] -' )).toContain('[This is clickable ] -');
|
||||||
|
});
|
||||||
|
|
||||||
it('[C279936] Should not be possible edit any parameter when editable property is false', async () => {
|
it('[C279936] Should not be possible edit any parameter when editable property is false', async () => {
|
||||||
await cardViewPageComponent.disableEdit();
|
await cardViewPageComponent.disableEdit();
|
||||||
|
|
||||||
|
@@ -36,6 +36,7 @@ export class CardViewComponentPage {
|
|||||||
editableSwitch: ElementFinder = element(by.id('app-toggle-editable'));
|
editableSwitch: ElementFinder = element(by.id('app-toggle-editable'));
|
||||||
clearDateSwitch: ElementFinder = element(by.id('app-toggle-clear-date'));
|
clearDateSwitch: ElementFinder = element(by.id('app-toggle-clear-date'));
|
||||||
noneOptionSwitch: ElementFinder = element(by.id('app-toggle-none-option'));
|
noneOptionSwitch: ElementFinder = element(by.id('app-toggle-none-option'));
|
||||||
|
clickableField: ElementFinder = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
|
||||||
|
|
||||||
async clickOnAddButton(): Promise<void> {
|
async clickOnAddButton(): Promise<void> {
|
||||||
await BrowserActions.click(this.addButton);
|
await BrowserActions.click(this.addButton);
|
||||||
@@ -225,6 +226,27 @@ export class CardViewComponentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getClickableValue(): Promise<string> {
|
||||||
|
return this.clickableField.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
async updateClickableField(text: string): Promise<void> {
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(this.clickableField);
|
||||||
|
await BrowserActions.click(this.clickableField);
|
||||||
|
const inputField = element(by.css('input[data-automation-id="card-textitem-editinput-click"]'));
|
||||||
|
await BrowserVisibility.waitUntilElementIsPresent(inputField);
|
||||||
|
await BrowserActions.clearSendKeys(inputField, text);
|
||||||
|
const save = element(by.css('[data-automation-id="card-textitem-update-click"]'));
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(save);
|
||||||
|
await BrowserActions.click(save);
|
||||||
|
}
|
||||||
|
|
||||||
|
async hasCardViewConsoleLog(text: string): Promise<string> {
|
||||||
|
const cardViewConsole = element(by.cssContainingText('.app-console', text));
|
||||||
|
await BrowserVisibility.waitUntilElementIsVisible(cardViewConsole);
|
||||||
|
return cardViewConsole.getText();
|
||||||
|
}
|
||||||
|
|
||||||
async clearIntField(): Promise<void> {
|
async clearIntField(): Promise<void> {
|
||||||
await this.intField.clear();
|
await this.intField.clear();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user