Skip to content
Merged
8 changes: 4 additions & 4 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.42",
"@umbraco/playwright-testhelpers": "^17.0.10",
"@umbraco/playwright-testhelpers": "^17.0.11",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"node-fetch": "^2.6.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,10 @@
await umbracoUi.content.clickAddBlockElementButton();
await umbracoUi.content.clickBlockElementWithName(elementTypeName);
await umbracoUi.content.enterTextstring(inputText);
await umbracoUi.content.clickCreateModalButton();

Check warning on line 149 in tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/BlockList/ContentWithBlockList.spec.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Code Health Review (main)

❌ Getting worse: Code Duplication

introduced similar code in: 'can set the label of block element in the content','cannot add number of block element greater than the maximum amount'. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
await umbracoUi.content.clickAddBlockElementButton();
await umbracoUi.content.clickTextButtonWithName(elementTypeName);
await umbracoUi.content.enterTextstring(inputText);
await umbracoUi.content.clickCreateModalButton();

// Assert
await umbracoUi.content.doesFormValidationMessageContainText('Maximum 1 entries, you have entered 1 too many.');
await umbracoUi.content.isAddBlockElementButtonVisible(false);
});

test('can set the label of block element in the content', async ({umbracoApi, umbracoUi}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ test('can delete a dictionary item', async ({umbracoApi, umbracoUi}) => {
// Assert
await umbracoUi.dictionary.waitForDictionaryToBeDeleted();
await umbracoUi.dictionary.isErrorNotificationVisible(false);
expect(await umbracoApi.dictionary.doesNameExist(dictionaryName)).toBeFalsy();
// Verify the dictionary item does not display in the tree
await umbracoUi.dictionary.isDictionaryTreeItemVisible(dictionaryName, false);
// Verify the dictionary item does not display in the list
await umbracoUi.reloadPage();
await umbracoUi.dictionary.doesDictionaryCollectionContainText('No items');
expect(await umbracoApi.dictionary.doesNameExist(dictionaryName)).toBeFalsy();
});

test('can create a dictionary item in a dictionary', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ test('can enable validation for a property in a document type', {tag: '@release'
// Act
await umbracoUi.documentType.goToDocumentType(documentTypeName);
await umbracoUi.documentType.clickEditorSettingsButton();
await umbracoUi.documentType.selectValidationOption('');
await umbracoUi.documentType.selectValidationOption('.+');
await umbracoUi.documentType.enterRegEx(regex);
await umbracoUi.documentType.enterRegExMessage(regexMessage);
await umbracoUi.documentType.clickSubmitButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test('can set up validation for a property in a media type', {tag: '@release'},
// Act
await umbracoUi.mediaType.goToMediaType(mediaTypeName);
await umbracoUi.mediaType.clickEditorSettingsButton();
await umbracoUi.mediaType.selectValidationOption('');
await umbracoUi.mediaType.selectValidationOption('.+');
await umbracoUi.mediaType.enterRegEx(regex);
await umbracoUi.mediaType.enterRegExMessage(regexMessage);
await umbracoUi.mediaType.clickSubmitButton();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NotificationConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {ConstantHelper, NotificationConstantHelper, test} from '@umbraco/playwright-testhelpers';

const userPassword = '0123456789';
let testUserCookieAndToken = {cookie: "", accessToken: "", refreshToken: ""};
Expand All @@ -21,7 +21,7 @@ for (const userGroup of userGroups) {
await umbracoApi.user.updatePassword(userId, userPassword);
testUserCookieAndToken = await umbracoApi.user.loginToUser(userName, userEmail, userPassword);
await umbracoUi.goToBackOffice();
await umbracoUi.currentUserProfile.waitForNetworkToBeIdle();
await umbracoUi.currentUserProfile.isBackOfficeMainVisible();

// Act
await umbracoUi.currentUserProfile.clickCurrentUserAvatarButton();
Expand Down
Loading