Merge pull request #13209 from umbraco/v11/bugfix/fix-more-unstable-acceptance-tests
V11: fix more unstable acceptance tests
This commit is contained in:
14
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
generated
14
tests/Umbraco.Tests.AcceptanceTest/package-lock.json
generated
@@ -8,7 +8,7 @@
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@umbraco/json-models-builders": "^1.0.0",
|
||||
"@umbraco/playwright-testhelpers": "^1.0.4",
|
||||
"@umbraco/playwright-testhelpers": "^1.0.10",
|
||||
"camelize": "^1.0.0",
|
||||
"dotenv": "^16.0.2",
|
||||
"faker": "^4.1.0",
|
||||
@@ -138,9 +138,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@umbraco/playwright-testhelpers": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.4.tgz",
|
||||
"integrity": "sha512-OBAUzscj+v1w0TwUcWAUeUou6t1wz/7ZXDhMPq6gL8jzAXSFobWRShfC4zqCiWoGLZ8721UN55Q01WFyWiuOSg==",
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.10.tgz",
|
||||
"integrity": "sha512-4NTuMbbNWGcawZIuYnDdPUGN4W2F9iw0EvsyJ2Pr5rYj8Rg1PCu2MXW77r27fGhfr31PYDEL6RSL9zp8SyxfJg==",
|
||||
"dependencies": {
|
||||
"@umbraco/json-models-builders": "^1.0.0",
|
||||
"camelize": "^1.0.0",
|
||||
@@ -1064,9 +1064,9 @@
|
||||
}
|
||||
},
|
||||
"@umbraco/playwright-testhelpers": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.4.tgz",
|
||||
"integrity": "sha512-OBAUzscj+v1w0TwUcWAUeUou6t1wz/7ZXDhMPq6gL8jzAXSFobWRShfC4zqCiWoGLZ8721UN55Q01WFyWiuOSg==",
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@umbraco/playwright-testhelpers/-/playwright-testhelpers-1.0.10.tgz",
|
||||
"integrity": "sha512-4NTuMbbNWGcawZIuYnDdPUGN4W2F9iw0EvsyJ2Pr5rYj8Rg1PCu2MXW77r27fGhfr31PYDEL6RSL9zp8SyxfJg==",
|
||||
"requires": {
|
||||
"@umbraco/json-models-builders": "^1.0.0",
|
||||
"camelize": "^1.0.0",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@umbraco/json-models-builders": "^1.0.0",
|
||||
"@umbraco/playwright-testhelpers": "^1.0.4",
|
||||
"@umbraco/playwright-testhelpers": "^1.0.10",
|
||||
"camelize": "^1.0.0",
|
||||
"dotenv": "^16.0.2",
|
||||
"faker": "^4.1.0",
|
||||
|
||||
@@ -290,11 +290,14 @@ test.describe('Content tests', () => {
|
||||
await umbracoUi.setEditorHeaderName(newNodeName);
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.rollback));
|
||||
// Not a very nice selector, but there's sadly no alternative :(
|
||||
await page.locator('.-selectable.cursor-pointer').first().click();
|
||||
// Sadly can't use the button by label key here since there's another one in the DOM
|
||||
// Sadly can't use the button by label key here since there's another one in the DOM
|
||||
const helpText = await page.locator('[key="rollback_diffHelp"]');
|
||||
await expect(helpText).toBeVisible();
|
||||
await page.locator('[action="vm.rollback()"]').click();
|
||||
|
||||
await umbracoUi.refreshContentTree();
|
||||
@@ -663,10 +666,10 @@ test.describe('Content tests', () => {
|
||||
.build();
|
||||
|
||||
const alias = AliasHelper.toAlias(name);
|
||||
|
||||
|
||||
// Save grid and get the ID
|
||||
const dataType = await umbracoApi.dataTypes.save(grid)
|
||||
|
||||
|
||||
// Create a document type using the data type
|
||||
const docType = new DocumentTypeBuilder()
|
||||
.withName(name)
|
||||
@@ -690,7 +693,7 @@ test.describe('Content tests', () => {
|
||||
.build();
|
||||
|
||||
await umbracoApi.content.save(contentNode);
|
||||
|
||||
|
||||
// Ugly wait but we have to wait for cache to rebuild
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
@@ -719,7 +722,7 @@ test.describe('Content tests', () => {
|
||||
// Save and publish
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
|
||||
|
||||
const expected = `
|
||||
<div class="umb-grid">
|
||||
<div class="grid-section">
|
||||
|
||||
@@ -48,6 +48,7 @@ test.describe('DataTypes', () => {
|
||||
// Save
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
|
||||
// Assert
|
||||
const expected = `<p style="color:000000" > Lorem ipsum dolor sit amet </p>`;
|
||||
@@ -158,6 +159,7 @@ test.describe('DataTypes', () => {
|
||||
await umbracoUi.setEditorHeaderName('UrlPickerContent');
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
await page.locator('.umb-node-preview-add').click();
|
||||
|
||||
// Should really try and find a better way to do this, but umbracoTreeItem tries to click the content pane in the background
|
||||
|
||||
@@ -255,6 +255,7 @@ test.describe('Modelsbuilder tests', () => {
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.submit));
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
|
||||
// Update the template
|
||||
await umbracoUi.clickElement(umbracoUi.getTreeItem("settings", ["templates", docTypeName]));
|
||||
@@ -264,12 +265,14 @@ test.describe('Modelsbuilder tests', () => {
|
||||
await editor.type("<p>@Model.Bod")
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save))
|
||||
await umbracoUi.isSuccessNotificationVisible();
|
||||
await page.locator('span:has-text("×")').click();
|
||||
|
||||
// Navigate to the content section and update the content
|
||||
await umbracoUi.goToSection(ConstantHelper.sections.content);
|
||||
await umbracoUi.refreshContentTree();
|
||||
await umbracoUi.clickElement(umbracoUi.getTreeItem("content", [contentName]));
|
||||
await page.locator("#bod").type("Fancy body text");
|
||||
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish))
|
||||
|
||||
await umbracoApi.content.verifyRenderedContent("/", "<h1>" + propertyValue + "</h1><p>Fancy body text</p>", true);
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ test.describe('Packages', () => {
|
||||
|
||||
// Navigate pack to packages and Assert the file is created
|
||||
// Waits until the button download is visible
|
||||
await page.locator('[label-key="general_download"]').isVisible();
|
||||
await expect(await page.locator('[label-key="general_download"]')).toBeVisible({timeout: 60000});
|
||||
|
||||
// Checks if the packages was created
|
||||
const doesExist = await umbracoApi.packages.doesNameExist(packageName);
|
||||
await expect(doesExist).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user