Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V14 Fixing the failing smoke tests #16822

Merged
merged 21 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
01638f3
Added tests with empty name for Partial View, Stylesheet, Script and …
nhudinh0309 Jun 19, 2024
653c0c9
Added tests with non-empty folder for Partial View, Stylesheet, Script
nhudinh0309 Jun 19, 2024
f1c035f
Added tests to create a partial view in a folder in a folder
nhudinh0309 Jun 19, 2024
692541c
Moved goToSetting to Arrange
nhudinh0309 Jun 19, 2024
5b24d64
Fixed the failing tests and added the unhappy path tests
nhudinh0309 Jun 24, 2024
c60f388
Fixed the failing tests due to UI changes
nhudinh0309 Jun 24, 2024
27c62ee
Fixed format
nhudinh0309 Jun 24, 2024
277234a
Merge branch 'v14/dev' into v14/QA/add-advanced-scenarios
nhudinh0309 Jun 24, 2024
afdaaf4
Bumped version of test helper
nhudinh0309 Jun 24, 2024
56a8f5d
Run the tests for Settings in the pipeline
nhudinh0309 Jun 24, 2024
bcc599c
Merge branch 'v14/dev' into v14/QA/add-advanced-scenarios
nhudinh0309 Jul 1, 2024
1dee65b
Merge branch 'v14/dev' into v14/QA/add-advanced-scenarios
nhudinh0309 Jul 2, 2024
8160615
Merge branch 'v14/dev' into v14/QA/add-advanced-scenarios
nhudinh0309 Jul 3, 2024
050e31f
Merge branch 'v14/QA/add-advanced-scenarios' into v14/QA/fix-smoke-tests
nhudinh0309 Jul 25, 2024
85b07b7
Fixed the Member failing tests
nhudinh0309 Jul 26, 2024
ce75e5c
Fixed the Document Type Design Tab failing tests
nhudinh0309 Jul 26, 2024
e63639e
Fixed the Media Type Design Tab failing tests
nhudinh0309 Jul 26, 2024
be7ac85
Fixed the Script failing tests
nhudinh0309 Jul 26, 2024
26e4440
Bumped version of test helper
nhudinh0309 Jul 26, 2024
cdc81e4
Bumped version of test helper
nhudinh0309 Jul 26, 2024
c54b22d
Merge branch 'v14/dev' into v14/QA/fix-smoke-tests
nhudinh0309 Jul 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -22,7 +22,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^2.0.13",
"@umbraco/playwright-testhelpers": "^2.0.0-beta.68",
"@umbraco/playwright-testhelpers": "^2.0.0-beta.70",
"camelize": "^1.0.0",
"dotenv": "^16.3.1",
"faker": "^4.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ test('can edit password', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.member.clickMemberLinkByName(memberName);
await umbracoUi.member.clickChangePasswordButton();
await umbracoUi.member.enterNewPassword(updatedPassword);
await umbracoUi.member.enterConfirmPassword(updatedPassword);
await umbracoUi.member.enterPassword(updatedPassword);
await umbracoUi.member.enterConfirmNewPassword(updatedPassword);
await umbracoUi.member.clickSaveButton();

// Assert
Expand Down Expand Up @@ -173,9 +173,16 @@ test('can view member info', async ({umbracoApi, umbracoUi}) => {
// Assert
const memberData = await umbracoApi.member.get(memberId);
await umbracoUi.member.doesMemberInfoHaveValue('Failed login attempts', memberData.failedPasswordAttempts.toString());
await umbracoUi.member.doesMemberInfoHaveValue('Last lockout date', memberData.lastLoginDate == null ? 'never' : memberData.lastLoginDate);
await umbracoUi.member.doesMemberInfoHaveValue('Last login', memberData.lastLoginDate == null ? 'never' : memberData.lastLoginDate);
await umbracoUi.member.doesMemberInfoHaveValue('Password changed', new Date(memberData.lastPasswordChangeDate).toLocaleString());
await umbracoUi.member.doesMemberInfoHaveValue('Last lockout date', memberData.lastLoginDate == null ? 'Never' : memberData.lastLoginDate);
await umbracoUi.member.doesMemberInfoHaveValue('Last login', memberData.lastLoginDate == null ? 'Never' : memberData.lastLoginDate);
await umbracoUi.member.doesMemberInfoHaveValue('Password changed', new Date(memberData.lastPasswordChangeDate).toLocaleString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true,
}));
});

test('can enable approved', async ({umbracoApi, umbracoUi}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ test('can add a description to a property in a document type', async ({umbracoAp
await umbracoUi.documentType.goToDocumentType(documentTypeName);
await umbracoUi.documentType.clickEditorSettingsButton();
await umbracoUi.documentType.enterPropertyEditorDescription(descriptionText);
await umbracoUi.documentType.clickUpdateButton();
await umbracoUi.documentType.clickSubmitButton();
await umbracoUi.documentType.clickSaveButton();

// Assert
Expand All @@ -360,7 +360,7 @@ test('can set is mandatory for a property in a document type', {tag: '@smoke'},
await umbracoUi.documentType.goToDocumentType(documentTypeName);
await umbracoUi.documentType.clickEditorSettingsButton();
await umbracoUi.documentType.clickMandatorySlider();
await umbracoUi.documentType.clickUpdateButton();
await umbracoUi.documentType.clickSubmitButton();
await umbracoUi.documentType.clickSaveButton();

// Assert
Expand All @@ -383,7 +383,7 @@ test('can enable validation for a property in a document type', async ({umbracoA
await umbracoUi.documentType.selectValidationOption('');
await umbracoUi.documentType.enterRegEx(regex);
await umbracoUi.documentType.enterRegExMessage(regexMessage);
await umbracoUi.documentType.clickUpdateButton();
await umbracoUi.documentType.clickSubmitButton();
await umbracoUi.documentType.clickSaveButton();

// Assert
Expand All @@ -403,7 +403,7 @@ test('can allow vary by culture for a property in a document type', {tag: '@smok
await umbracoUi.documentType.goToDocumentType(documentTypeName);
await umbracoUi.documentType.clickEditorSettingsButton();
await umbracoUi.documentType.clickVaryByCultureSlider();
await umbracoUi.documentType.clickUpdateButton();
await umbracoUi.documentType.clickSubmitButton();
await umbracoUi.documentType.clickSaveButton();

// Assert
Expand All @@ -422,7 +422,7 @@ test('can set appearance to label on top for a property in a document type', asy
await umbracoUi.documentType.goToDocumentType(documentTypeName);
await umbracoUi.documentType.clickEditorSettingsButton();
await umbracoUi.documentType.clickLabelAboveButton();
await umbracoUi.documentType.clickUpdateButton();
await umbracoUi.documentType.clickSubmitButton();
await umbracoUi.documentType.clickSaveButton();

// Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,36 @@ test.afterEach(async ({umbracoApi}) => {
await umbracoApi.language.ensureNameNotExists(languageName);
});

test.skip('can add language', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
test('can add language', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickCreateLink();
await umbracoUi.language.chooseLanguageByName(languageName);
await umbracoUi.language.clickSaveButton();

// Assert
await umbracoUi.language.isSuccessNotificationVisible();
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
// Verify the created language displays in the list
await umbracoUi.language.clickLanguageRoot();
await umbracoUi.language.clickLanguagesMenu();
await umbracoUi.language.isLanguageNameVisible(languageName, true);
});

test('can update default language option', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickLanguageByName(languageName);
await umbracoUi.language.switchDefaultLanguageOption();
await umbracoUi.language.clickSaveButton();

// Assert
await umbracoUi.language.isSuccessNotificationVisible();
const languageData = await umbracoApi.language.get(isoCode);
expect(languageData.isDefault).toBe(true);

Expand All @@ -57,14 +59,15 @@ test('can update mandatory language option', async ({umbracoApi, umbracoUi}) =>
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickLanguageByName(languageName);
await umbracoUi.language.switchMandatoryLanguageOption();
await umbracoUi.language.clickSaveButton();

// Assert
await umbracoUi.language.isSuccessNotificationVisible();
const languageData = await umbracoApi.language.get(isoCode);
expect(languageData.isMandatory).toBe(true);
});
Expand All @@ -73,49 +76,63 @@ test('can delete language', {tag: '@smoke'}, async ({umbracoApi, umbracoUi}) =>
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.removeLanguageByName(languageName);

// Assert
await umbracoUi.language.isSuccessNotificationVisible();
expect(await umbracoApi.language.doesExist(isoCode)).toBeFalsy();
// TODO: uncomment this when the front-end is ready. Currently the deleted language is not disappeared after deleting.
//await umbracoUi.language.isLanguageNameVisible(languageName, false);
await umbracoUi.language.isLanguageNameVisible(languageName, false);
});

// TODO: Remove skip when the add fallback language function works
test.skip('can remove fallback language', async ({umbracoApi, umbracoUi}) => {
test('can remove fallback language', async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickLanguageByName(languageName);
await umbracoUi.language.removeFallbackLanguageByName(defaultLanguageName);
await umbracoUi.language.clickSaveButton();

// Act
await umbracoUi.language.isSuccessNotificationVisible();
const languageData = await umbracoApi.language.get(isoCode);
expect(languageData.fallbackIsoCode).toBeFalsy();
});

// TODO: Remove skip when the add fallback language function works
test.skip('can add fallback language', async ({umbracoApi, umbracoUi}) => {
test('can add fallback language', async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode, null);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToSettingsTreeItem('Language');
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickLanguageByName(languageName);
await umbracoUi.language.clickAddFallbackLanguageButton();
await umbracoUi.language.clickChooseButton();
await umbracoUi.language.selectFallbackLanguageByName(defaultLanguageName);
await umbracoUi.language.clickSaveButton();

// Act
await umbracoUi.language.isSuccessNotificationVisible();
const languageData = await umbracoApi.language.get(isoCode);
expect(languageData.fallbackIsoCode).toBe(defaultLanguageIsoCode);
});

test('cannot add a language with duplicate ISO code', async ({umbracoApi, umbracoUi}) => {
// Arrange
await umbracoApi.language.create(languageName, false, false, isoCode);
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy();
await umbracoUi.language.goToLanguages();

// Act
await umbracoUi.language.clickCreateLink();
await umbracoUi.language.chooseLanguageByName(languageName);
await umbracoUi.language.clickSaveButton();

// Assert
await umbracoUi.language.isErrorNotificationVisible();
});
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test('can add a description to property in a media type', {tag: '@smoke'}, async
await umbracoUi.mediaType.goToMediaType(mediaTypeName);
await umbracoUi.mediaType.clickEditorSettingsButton();
await umbracoUi.mediaType.enterPropertyEditorDescription(descriptionText);
await umbracoUi.mediaType.clickUpdateButton();
await umbracoUi.mediaType.clickSubmitButton();
await umbracoUi.mediaType.clickSaveButton();

// Assert
Expand All @@ -118,7 +118,7 @@ test('can set a property as mandatory in a media type', {tag: '@smoke'}, async (
await umbracoUi.mediaType.goToMediaType(mediaTypeName);
await umbracoUi.mediaType.clickEditorSettingsButton();
await umbracoUi.mediaType.clickMandatorySlider();
await umbracoUi.mediaType.clickUpdateButton();
await umbracoUi.mediaType.clickSubmitButton();
await umbracoUi.mediaType.clickSaveButton();

// Assert
Expand All @@ -140,7 +140,7 @@ test('can set up validation for a property in a media type', async ({umbracoApi,
await umbracoUi.mediaType.selectValidationOption('');
await umbracoUi.mediaType.enterRegEx(regex);
await umbracoUi.mediaType.enterRegExMessage(regexMessage);
await umbracoUi.mediaType.clickUpdateButton();
await umbracoUi.mediaType.clickSubmitButton();
await umbracoUi.mediaType.clickSaveButton();

// Assert
Expand All @@ -159,7 +159,7 @@ test('can set appearance as label on top for property in a media type', async ({
await umbracoUi.mediaType.goToMediaType(mediaTypeName);
await umbracoUi.mediaType.clickEditorSettingsButton();
await umbracoUi.mediaType.clickLabelAboveButton();
await umbracoUi.mediaType.clickUpdateButton();
await umbracoUi.mediaType.clickSubmitButton();
await umbracoUi.mediaType.clickSaveButton();

// Assert
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

Check warning on line 1 in tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/PartialView/PartialView.spec.ts

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (v14/dev)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: 'can use query builder with Order By statement for a partial view','can use query builder with Where statement for a partial view'. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
import {expect} from "@playwright/test";

const partialViewName = 'TestPartialView';
Expand Down Expand Up @@ -30,7 +30,7 @@
expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeTruthy();
// Verify the new partial view is displayed under the Partial Views section
await umbracoUi.partialView.isPartialViewRootTreeItemVisibile(partialViewFileName);
})
});

test('can create a partial view from snippet', async ({umbracoApi, umbracoUi}) => {
// Arrange
Expand Down Expand Up @@ -279,3 +279,16 @@
// Clean
await umbracoApi.documentType.ensureNameNotExists(documentTypeName);
});

test('cannot create a partial view with an empty name', async ({umbracoApi, umbracoUi}) => {
// Act
await umbracoUi.partialView.clickActionsMenuAtRoot();
await umbracoUi.partialView.clickCreateButton();
await umbracoUi.partialView.clickNewEmptyPartialViewButton();
await umbracoUi.partialView.clickSaveButton();

// Assert
// TODO: Uncomment this when the front-end is ready. Currently there is no error displays.
//await umbracoUi.partialView.isErrorNotificationVisible();
expect(await umbracoApi.partialView.doesNameExist(partialViewFileName)).toBeFalsy();
});
Loading
Loading