Skip to content

Commit b1cbc92

Browse files
authored
Merge pull request #13209 from umbraco/v11/bugfix/fix-more-unstable-acceptance-tests
V11: fix more unstable acceptance tests
2 parents 000324a + b84dcf8 commit b1cbc92

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Umbraco.Tests.AcceptanceTest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@umbraco/json-models-builders": "^1.0.0",
23-
"@umbraco/playwright-testhelpers": "^1.0.4",
23+
"@umbraco/playwright-testhelpers": "^1.0.10",
2424
"camelize": "^1.0.0",
2525
"dotenv": "^16.0.2",
2626
"faker": "^4.1.0",

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,14 @@ test.describe('Content tests', () => {
290290
await umbracoUi.setEditorHeaderName(newNodeName);
291291
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
292292
await umbracoUi.isSuccessNotificationVisible();
293+
await page.locator('span:has-text("×")').click();
293294

294295
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.rollback));
295296
// Not a very nice selector, but there's sadly no alternative :(
296297
await page.locator('.-selectable.cursor-pointer').first().click();
297-
// Sadly can't use the button by label key here since there's another one in the DOM
298+
// Sadly can't use the button by label key here since there's another one in the DOM
299+
const helpText = await page.locator('[key="rollback_diffHelp"]');
300+
await expect(helpText).toBeVisible();
298301
await page.locator('[action="vm.rollback()"]').click();
299302

300303
await umbracoUi.refreshContentTree();
@@ -663,10 +666,10 @@ test.describe('Content tests', () => {
663666
.build();
664667

665668
const alias = AliasHelper.toAlias(name);
666-
669+
667670
// Save grid and get the ID
668671
const dataType = await umbracoApi.dataTypes.save(grid)
669-
672+
670673
// Create a document type using the data type
671674
const docType = new DocumentTypeBuilder()
672675
.withName(name)
@@ -690,7 +693,7 @@ test.describe('Content tests', () => {
690693
.build();
691694

692695
await umbracoApi.content.save(contentNode);
693-
696+
694697
// Ugly wait but we have to wait for cache to rebuild
695698
await page.waitForTimeout(1000);
696699

@@ -719,7 +722,7 @@ test.describe('Content tests', () => {
719722
// Save and publish
720723
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
721724
await umbracoUi.isSuccessNotificationVisible();
722-
725+
723726
const expected = `
724727
<div class="umb-grid">
725728
<div class="grid-section">

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/DataTypes/dataTypes.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ test.describe('DataTypes', () => {
4848
// Save
4949
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
5050
await umbracoUi.isSuccessNotificationVisible();
51+
await page.locator('span:has-text("×")').click();
5152

5253
// Assert
5354
const expected = `<p style="color:000000" > Lorem ipsum dolor sit amet </p>`;
@@ -158,6 +159,7 @@ test.describe('DataTypes', () => {
158159
await umbracoUi.setEditorHeaderName('UrlPickerContent');
159160
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
160161
await umbracoUi.isSuccessNotificationVisible();
162+
await page.locator('span:has-text("×")').click();
161163
await page.locator('.umb-node-preview-add').click();
162164

163165
// Should really try and find a better way to do this, but umbracoTreeItem tries to click the content pane in the background

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/ModelsBuilder/modelsbuilder.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ test.describe('Modelsbuilder tests', () => {
255255
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.submit));
256256
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save));
257257
await umbracoUi.isSuccessNotificationVisible();
258+
await page.locator('span:has-text("×")').click();
258259

259260
// Update the template
260261
await umbracoUi.clickElement(umbracoUi.getTreeItem("settings", ["templates", docTypeName]));
@@ -264,12 +265,14 @@ test.describe('Modelsbuilder tests', () => {
264265
await editor.type("<p>@Model.Bod")
265266
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.save))
266267
await umbracoUi.isSuccessNotificationVisible();
268+
await page.locator('span:has-text("×")').click();
267269

268270
// Navigate to the content section and update the content
269271
await umbracoUi.goToSection(ConstantHelper.sections.content);
270272
await umbracoUi.refreshContentTree();
271273
await umbracoUi.clickElement(umbracoUi.getTreeItem("content", [contentName]));
272274
await page.locator("#bod").type("Fancy body text");
275+
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish))
273276

274277
await umbracoApi.content.verifyRenderedContent("/", "<h1>" + propertyValue + "</h1><p>Fancy body text</p>", true);
275278

tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Packages/packages.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ test.describe('Packages', () => {
8888

8989
// Navigate pack to packages and Assert the file is created
9090
// Waits until the button download is visible
91-
await page.locator('[label-key="general_download"]').isVisible();
91+
await expect(await page.locator('[label-key="general_download"]')).toBeVisible({timeout: 60000});
92+
9293
// Checks if the packages was created
9394
const doesExist = await umbracoApi.packages.doesNameExist(packageName);
9495
await expect(doesExist).toBe(true);

0 commit comments

Comments
 (0)