From cf68d499efaf8f937635d3e0a0fb01b87211a4f1 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Fri, 14 Oct 2022 23:58:47 +0200 Subject: [PATCH] Assert that the item is loaded before trying to click rollback --- .../tests/DefaultConfig/Content/content.spec.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts index 6362a583d9..c2b9be27aa 100644 --- a/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts +++ b/tests/Umbraco.Tests.AcceptanceTest/tests/DefaultConfig/Content/content.spec.ts @@ -295,7 +295,9 @@ test.describe('Content tests', () => { 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(); @@ -664,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) @@ -691,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); @@ -720,7 +722,7 @@ test.describe('Content tests', () => { // Save and publish await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish)); await umbracoUi.isSuccessNotificationVisible(); - + const expected = `