Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 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 @@ -20,7 +20,7 @@
},
"dependencies": {
"@umbraco/json-models-builders": "^1.0.2",
"@umbraco/playwright-testhelpers": "^1.0.19",
"@umbraco/playwright-testhelpers": "^1.0.20",
"camelize": "^1.0.0",
"faker": "^4.1.0",
"form-data": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ test.describe('BlockListEditorContent', () => {
});

test('can update content with a block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

await createContentWithOneBlockListEditor(umbracoApi, null);

await umbracoUi.goToSection(ConstantHelper.sections.content);
Expand All @@ -150,14 +148,9 @@ test.describe('BlockListEditorContent', () => {

// Assert
await umbracoUi.isSuccessNotificationVisible();

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can delete a block list editor in content', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

await createContentWithOneBlockListEditor(umbracoApi, null);

await umbracoUi.goToSection(ConstantHelper.sections.content);
Expand All @@ -179,14 +172,9 @@ test.describe('BlockListEditorContent', () => {

// Checks if the content is actually deleted
await expect(page.locator('[ui-sortable="vm.sortableOptions"]').nth(0)).not.toBeVisible();

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can copy block list content and paste it', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

await createContentWithOneBlockListEditor(umbracoApi, null);

await umbracoUi.goToSection(ConstantHelper.sections.content);
Expand All @@ -210,14 +198,9 @@ test.describe('BlockListEditorContent', () => {
await expect(page.locator('.umb-block-list__block--view')).toHaveCount(2);
await page.locator('.umb-block-list__block--view').nth(1).click();
await expect(page.locator('[id="sub-view-0"] >> [name="textbox"]')).toHaveValue('aliasTest');

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can copy block list content and paste it into another group with the same block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

const element = await umbracoApi.documentTypes.createDefaultElementType(elementName, elementAlias);

const dataType = await createDefaultBlockList(umbracoApi, blockListName, element);
Expand Down Expand Up @@ -268,14 +251,9 @@ test.describe('BlockListEditorContent', () => {
await expect(page.locator('[data-element="group-aTheBlockListGroupTheSecond"] >> .umb-block-list__block--view')).toHaveCount(1);
await page.locator('[data-element="group-aTheBlockListGroupTheSecond"] >> .umb-block-list__block--view').click();
await expect(page.locator('[id="sub-view-0"] >> [name="textbox"]')).toHaveValue('aliasTest');

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can set a minimum of required blocks in content with a block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

const element = await umbracoApi.documentTypes.createDefaultElementType(elementName, elementAlias);

const dataTypeBlockList = new BlockListDataTypeBuilder()
Expand Down Expand Up @@ -310,14 +288,9 @@ test.describe('BlockListEditorContent', () => {

// Assert
await umbracoUi.getSuccessNotification();

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can set a maximum of required blocks in content with a block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

const element = await umbracoApi.documentTypes.createDefaultElementType(elementName, elementAlias);

const dataTypeBlockList = new BlockListDataTypeBuilder()
Expand Down Expand Up @@ -378,14 +351,9 @@ test.describe('BlockListEditorContent', () => {

// Assert
await umbracoUi.getSuccessNotification();

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can use inline editing mode in content with a block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.content.deleteAllContent();

const element = await umbracoApi.documentTypes.createDefaultElementType(elementName, elementAlias);

const dataTypeBlockList = new BlockListDataTypeBuilder()
Expand All @@ -412,15 +380,11 @@ test.describe('BlockListEditorContent', () => {

// Assert
await expect(page.locator('[ui-sortable="vm.sortableOptions"]').nth(0).locator('[data-element="property-title"]')).toBeVisible();

// Clean
await umbracoApi.content.deleteAllContent();
});

test('can see rendered content with a block list editor', async ({page, umbracoApi, umbracoUi}) => {
await umbracoApi.templates.ensureNameNotExists(documentName);
await umbracoApi.partialViews.ensureNameNotExists(elementName + '.cshtml');
await umbracoApi.content.deleteAllContent();

const element = new DocumentTypeBuilder()
.withName(elementName)
Expand Down Expand Up @@ -516,6 +480,5 @@ test.describe('BlockListEditorContent', () => {
// Clean
await umbracoApi.templates.ensureNameNotExists(documentName);
await umbracoApi.partialViews.ensureNameNotExists(elementAlias + '.cshtml');
await umbracoApi.content.deleteAllContent();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ test.describe('DataTypes', () => {
// Assert
const expected = `<p style="color:000000" > Lorem ipsum dolor sit amet </p>`;
await expect(umbracoApi.content.verifyRenderedContent('/', expected, true)).toBeTruthy();
await expect(await page.locator('.umb-button__overlay')).not.toBeVisible();
await expect(await page.locator('.umb-button__overlay')).not.toBeVisible({timeout: 10000});

// Pick another colour to verify both work
await page.locator('.btn-FF0000').click();

// Save
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
await umbracoUi.isSuccessNotificationVisible();
await expect(await page.locator('.umb-button__overlay')).not.toBeVisible();
await expect(await page.locator('.umb-button__overlay')).not.toBeVisible({timeout: 10000});

// Assert
const expected2 = '<p style="color:FF0000">Lorem ipsum dolor sit amet</p>';
Expand Down Expand Up @@ -174,7 +174,7 @@ test.describe('DataTypes', () => {

// Assert
await expect(await umbracoUi.getErrorNotification()).not.toBeVisible();

// Testing if the edits match the expected results
const expected = '<a href="/">UrlPickerContent</a>';
await expect(await umbracoApi.content.verifyRenderedContent('/', expected, true)).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test.describe('Vary by culture for TextBox', () => {
// Assert
await page.locator('.umb-variant-switcher__toggle').click();
await page.locator('.umb-variant-switcher__name-wrapper', {hasText: "English (United States)"}).hover();
await page.locator('[role="button"]', {hasText: "Open in split view"}).click();
await page.locator('[role="menuitem"]', {hasText:'English'}).locator('[role="button"]', {hasText: "Open in split view"}).click();
await expect(page.locator('[name="textbox"]').first()).toHaveValue(daValue);
await expect(page.locator('[name="textbox"]').nth(1)).toHaveValue(enValue);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ test.describe('Languages', () => {
// Save and assert success
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
await umbracoUi.isSuccessNotificationVisible();
// await expect(umbracoApi.languages.exists(culture)).toBe(true);

const doesExistDA = await umbracoApi.languages.exists(culture);
await expect(doesExistDA).toBe(true);

// Cleanup
await umbracoApi.languages.ensureCultureNotExists(culture);
});
Expand All @@ -45,17 +49,27 @@ test.describe('Languages', () => {

// Enter language tree and select the language we just created
await umbracoUi.clickElement(umbracoUi.getTreeItem('settings', ['languages']));

// Assert there are 3 languages
await expect(await page.locator('tbody > tr')).toHaveCount(3);

// Assert that the 2 languages exists
// DA
let doesExistDA = await umbracoApi.languages.exists(language1);
await expect(doesExistDA).toBe(true);
// EN
let doesExistEN = await umbracoApi.languages.exists(language2);
await expect(doesExistEN).toBe(true);

// Delete UK Language
await page.locator('umb-button[label-key="general_delete"]').last().click();
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey('contentTypeEditor_yesDelete'));

// Assert there is only 2 languages
await expect(await page.locator('tbody > tr')).toHaveCount(2);

// Assert the da language still exists and that the uk is deleted
// DA
doesExistDA = await umbracoApi.languages.exists(language1);
await expect(doesExistDA).toBe(true);
// EN
doesExistEN = await umbracoApi.languages.exists(language2);
await expect(doesExistEN).toBe(false);

// Cleanup
await umbracoApi.languages.ensureCultureNotExists(language1);
await umbracoApi.languages.ensureCultureNotExists(language2);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ test.describe('Partial View Macro Files', () => {
await umbracoUi.setEditorHeaderName(name);

//Save
await page.locator('.btn-success').click();
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

//Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

//Clean up
await cleanup(umbracoApi, name);
Expand All @@ -55,12 +55,12 @@ test.describe('Partial View Macro Files', () => {

// Type name
await umbracoUi.setEditorHeaderName(name);

// Save
await page.locator('.btn-success').click();
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

// Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

// Clean
await cleanup(umbracoApi, name);
Expand All @@ -82,10 +82,10 @@ test.describe('Partial View Macro Files', () => {
await umbracoUi.setEditorHeaderName(name);

// Save
await page.locator('.btn-success').click();
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

// Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

// Clean
await cleanup(umbracoApi, name);
Expand Down Expand Up @@ -145,7 +145,7 @@ test.describe('Partial View Macro Files', () => {
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

// Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

await cleanup(umbracoApi, name);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test.describe('Partial Views', () => {
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

//Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

//Clean up
await umbracoApi.partialViews.ensureNameNotExists(fileName);
Expand All @@ -63,7 +63,7 @@ test.describe('Partial Views', () => {
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

// Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

// Clean up
await umbracoApi.partialViews.ensureNameNotExists(fileName);
Expand Down Expand Up @@ -135,7 +135,8 @@ test.describe('Partial Views', () => {
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));

// Assert
await umbracoUi.isSuccessNotificationVisible();
await umbracoUi.isSuccessNotificationVisible({timeout:10000});

// Clean
await umbracoApi.partialViews.ensureNameNotExists(fileName);
});
Expand Down