-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/v14/dev' into release/14.0
- Loading branch information
Showing
15 changed files
with
161 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Umbraco.Web.UI.Client
updated
16 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Settings/Language/Language.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
import {test} from '@umbraco/playwright-testhelpers'; | ||
import {expect} from "@playwright/test"; | ||
|
||
test.describe('Language tests', () => { | ||
const languageName = 'Arabic'; | ||
const isoCode = 'ar'; | ||
const defaultLanguageName = 'English (United States)'; | ||
const defaultLanguageIsoCode = 'en-US'; | ||
|
||
test.beforeEach(async ({umbracoApi, umbracoUi}) => { | ||
await umbracoUi.goToBackOffice(); | ||
await umbracoApi.language.ensureNameNotExists(languageName); | ||
}); | ||
|
||
test.afterEach(async ({umbracoApi}) => { | ||
await umbracoApi.language.ensureNameNotExists(languageName); | ||
}); | ||
|
||
test('can add language @smoke', async ({umbracoApi, umbracoUi}) => { | ||
// Arrange | ||
await umbracoUi.language.goToSettingsTreeItem('Language'); | ||
|
||
// Act | ||
await umbracoUi.language.clickCreateLink(); | ||
await umbracoUi.language.chooseLanguageByName(languageName); | ||
await umbracoUi.language.clickSaveButton(); | ||
|
||
// Assert | ||
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy(); | ||
// Verify the created language displays in the list | ||
await umbracoUi.language.clickLanguageRoot(); | ||
await umbracoUi.language.isLanguageNameVisible(languageName, true); | ||
}); | ||
|
||
test('can update default language option @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'); | ||
|
||
// Act | ||
await umbracoUi.language.clickLanguageByName(languageName); | ||
await umbracoUi.language.switchDefaultLanguageOption(); | ||
await umbracoUi.language.clickSaveButton(); | ||
|
||
// Assert | ||
const languageData = await umbracoApi.language.get(isoCode); | ||
expect(languageData.isDefault).toBe(true); | ||
|
||
// Clean | ||
// To delete this language, you need to change en-US to be default language | ||
const defaultLanguageData = await umbracoApi.language.get(defaultLanguageIsoCode); | ||
defaultLanguageData.isDefault = true; | ||
await umbracoApi.language.update(defaultLanguageIsoCode, defaultLanguageData); | ||
}); | ||
|
||
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'); | ||
|
||
// Act | ||
await umbracoUi.language.clickLanguageByName(languageName); | ||
await umbracoUi.language.switchMandatoryLanguageOption(); | ||
await umbracoUi.language.clickSaveButton(); | ||
|
||
// Assert | ||
const languageData = await umbracoApi.language.get(isoCode); | ||
expect(languageData.isMandatory).toBe(true); | ||
}); | ||
|
||
test('can delete language @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'); | ||
|
||
// 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); | ||
}); | ||
|
||
// TODO: Remove skip when the add fallback language function works | ||
test.skip('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'); | ||
|
||
// Act | ||
await umbracoUi.language.clickLanguageByName(languageName); | ||
await umbracoUi.language.removeFallbackLanguageByName(defaultLanguageName); | ||
await umbracoUi.language.clickSaveButton(); | ||
|
||
// Act | ||
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}) => { | ||
// Arrange | ||
await umbracoApi.language.create(languageName, false, false, isoCode, null); | ||
expect(await umbracoApi.language.doesExist(isoCode)).toBeTruthy(); | ||
await umbracoUi.language.goToSettingsTreeItem('Language'); | ||
|
||
// Act | ||
await umbracoUi.language.clickLanguageByName(languageName); | ||
await umbracoUi.language.clickAddFallbackLanguageButton(); | ||
await umbracoUi.language.selectFallbackLanguageByName(defaultLanguageName); | ||
await umbracoUi.language.clickSaveButton(); | ||
|
||
// Act | ||
const languageData = await umbracoApi.language.get(isoCode); | ||
expect(languageData.fallbackIsoCode).toBe(defaultLanguageIsoCode); | ||
}); | ||
}); | ||
|