mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-7575] create library dialog e2e fix (#3803)
This commit is contained in:
committed by
GitHub
parent
95fde425d8
commit
f11ce49ba3
@@ -49,9 +49,7 @@ test.describe('Create Libraries ', () => {
|
||||
let randomLibraryId: string;
|
||||
let randomLibraryDescription: string;
|
||||
const libraryDialogTitle = 'Create Library';
|
||||
// TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF
|
||||
const libraryNameLabel = 'Name';
|
||||
// TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF
|
||||
const libraryIdLabel = 'Library ID';
|
||||
const libraryDescriptionLabel = 'Description';
|
||||
const publicVisibility = 'Public';
|
||||
@@ -97,9 +95,9 @@ test.describe('Create Libraries ', () => {
|
||||
|
||||
test('[C280024] Create Library dialog UI', async () => {
|
||||
await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeVisible();
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryNameLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryDescriptionLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getLabelText(libraryNameLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getLabelText(libraryIdLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getLabelText(libraryDescriptionLabel)).toBeVisible();
|
||||
await expect(libraryDialog.getLabelText(publicVisibility)).toBeVisible();
|
||||
await expect(libraryDialog.getLabelText(publicVisibility)).toBeChecked();
|
||||
await expect(libraryDialog.getLabelText(privateVisibility)).toBeVisible();
|
||||
@@ -115,9 +113,9 @@ test.describe('Create Libraries ', () => {
|
||||
});
|
||||
|
||||
test('[C280025] Create a public library', async ({ myLibrariesPage }) => {
|
||||
await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName);
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryNameLabel)).toHaveValue(randomLibraryName);
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(randomLibraryName);
|
||||
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
|
||||
await expect(libraryDialog.getLabelText(libraryNameLabel)).toHaveValue(randomLibraryName);
|
||||
await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(randomLibraryName);
|
||||
await libraryDialog.createButton.click();
|
||||
await expect(libraryBreadcrumb.getItemByTitle(randomLibraryName)).toBeVisible();
|
||||
|
||||
@@ -169,7 +167,7 @@ test.describe('Create Libraries ', () => {
|
||||
|
||||
test('[C280029] Cancel button', async () => {
|
||||
await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeVisible();
|
||||
await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.cancelButton.click();
|
||||
|
||||
await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeHidden();
|
||||
@@ -212,33 +210,33 @@ test.describe('Create Libraries ', () => {
|
||||
'a|a'
|
||||
];
|
||||
|
||||
await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
|
||||
|
||||
for (const specialLibraryId of idsWithSpecialChars) {
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear();
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(specialLibraryId);
|
||||
await libraryDialog.getLabelText(libraryIdLabel).clear();
|
||||
await libraryDialog.getLabelText(libraryIdLabel).fill(specialLibraryId);
|
||||
await libraryDialog.page.keyboard.press(tabKeyString);
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(specialLibraryId);
|
||||
await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(specialLibraryId);
|
||||
expect(await libraryDialog.isErrorMessageDisplayed(libraryErrors.useNumbersAndLettersOnly), errorMessageNotPresent).toBe(true);
|
||||
await expect(libraryDialog.createButton).toBeDisabled();
|
||||
}
|
||||
});
|
||||
|
||||
test('[C280027] Duplicate library ID', async () => {
|
||||
await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear();
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(commonLibraryName);
|
||||
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getLabelText(libraryIdLabel).clear();
|
||||
await libraryDialog.getLabelText(libraryIdLabel).fill(commonLibraryName);
|
||||
await libraryDialog.page.keyboard.press(tabKeyString);
|
||||
await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(commonLibraryName);
|
||||
await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(commonLibraryName);
|
||||
|
||||
await expect(libraryDialog.createButton).toBeDisabled();
|
||||
expect(await libraryDialog.isErrorMessageDisplayed(libraryErrors.libraryIdIsNotAvailable), errorMessageNotPresent).toBe(true);
|
||||
});
|
||||
|
||||
test('[C280028] Create library using the ID of a library from the Trashcan', async () => {
|
||||
await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear();
|
||||
await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(commonTrashLibraryName);
|
||||
await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName);
|
||||
await libraryDialog.getLabelText(libraryIdLabel).clear();
|
||||
await libraryDialog.getLabelText(libraryIdLabel).fill(commonTrashLibraryName);
|
||||
await libraryDialog.page.keyboard.press(tabKeyString);
|
||||
|
||||
await expect(libraryDialog.createButton).toBeEnabled();
|
||||
|
Reference in New Issue
Block a user