Skip to content

Commit

Permalink
V11: add test flakyness reporting (#13386)
Browse files Browse the repository at this point in the history
* update json-models-builders

* Add reporting to all before each loops

* Add commitId to env for pipelines

* Test reports correctly

* Bumb testhelper version

* Update playwright-testhelpers version

* Bumb playwright test-helper version

* Bumb playwright-testhelpers version

* Add AgentOs to yaml env

* Bumb playwright-testhelper version

* Try different AgentOS

* Revert "Try different AgentOS"

This reverts commit fc90620.

* Revert logo test

* Add missing semicolons

* Update package-lock.json

* Add reports to Blocklist tests

Co-authored-by: Zeegaan <[email protected]>
  • Loading branch information
Zeegaan and Zeegaan authored Nov 17, 2022
1 parent 9b13a26 commit 22bcc9b
Show file tree
Hide file tree
Showing 38 changed files with 86 additions and 53 deletions.
2 changes: 2 additions & 0 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ stages:
workingDirectory: tests/Umbraco.Tests.AcceptanceTest
env:
CI: true
CommitId: $(Build.SourceVersion)
AgentOs: $(Agent.OS)
- pwsh: |
docker logs $(dockerImageName) > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1
docker stop $(dockerImageName)
Expand Down
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.12",
"@umbraco/playwright-testhelpers": "^1.0.18",
"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 @@ -14,7 +14,8 @@ test.describe('BlockListEditorContent', () => {
// Won't work if I use the to alias for the elementAlias
const elementAlias = 'testElement';

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoApi.documentTypes.ensureNameNotExists(documentName);
await umbracoApi.documentTypes.ensureNameNotExists(elementName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ test.describe('BlockListEditorDataType', () => {

const elementAlias = AliasHelper.toAlias(elementName);

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoApi.documentTypes.ensureNameNotExists(documentName);
await umbracoApi.dataTypes.ensureNameNotExists(blockListName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ test.describe('BlockListEditorDocument', () => {
const blockListAlias = AliasHelper.toAlias(blockListName);
const elementAlias = AliasHelper.toAlias(elementName);

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoApi.documentTypes.ensureNameNotExists(documentName);
await umbracoApi.dataTypes.ensureNameNotExists(blockListName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { expect } from "@playwright/test";

test.describe('Umbraco Logo Information', () => {

test.beforeEach(async ({ page, umbracoApi }) => {
// TODO: REMOVE THIS WHEN SQLITE IS FIXED
// Wait so we don't bombard the API
await page.waitForTimeout(1000);
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {

test.describe('Content tests', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {ContentBuilder, DocumentTypeBuilder} from "@umbraco/json-models-builders

test.describe('Recycle bin', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ test.describe('Routing', () => {
const grandChildNodeName = "Grandchild";
const rootDocTypeName = "Test document type";

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoApi.content.deleteAllContent();
await umbracoApi.documentTypes.ensureNameNotExists(rootDocTypeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {

test.describe('DataTypes', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {ContentBuilder, DocumentTypeBuilder, DomainBuilder} from "@umbraco/json-

test.describe('Vary by culture for TextBox', () => {

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ test.describe('System Information', () => {
const enCulture = "en-US";
const dkCulture = "da-DK";

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoApi.users.setCurrentLanguage(enCulture);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {expect} from "@playwright/test";

test.describe('Languages', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { test, expect } from '@playwright/test';
import {expect } from '@playwright/test';
import {test} from "@umbraco/playwright-testhelpers";

test.describe('Login', () => {

test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await page.goto(process.env.URL + '/umbraco');
});
test('Login with correct username and password', async ({page}) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('media File Types', () => {

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoUi.goToSection(ConstantHelper.sections.media);
await umbracoApi.media.deleteAllMedia();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Media', () => {

test.beforeEach(async ({page, umbracoApi, umbracoUi}) => {
test.beforeEach(async ({page, umbracoApi, umbracoUi}, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await umbracoUi.goToSection(ConstantHelper.sections.media);
await umbracoApi.media.deleteAllMedia()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Packages', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Packages', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {

test.describe('Modelsbuilder tests', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test.describe('Packages', () => {
const packageName = "TestPackage";
const rootDocTypeName = "Test document type";
const nodeName = "1) Home";
test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import {expect} from "@playwright/test";
import {LabelDataTypeBuilder} from "@umbraco/json-models-builders";

test.describe('Data Types', () => {

test.beforeEach(async ({page, umbracoApi}) => {

test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {DocumentTypeBuilder} from "@umbraco/json-models-builders";

test.describe('Document types', () => {
test.beforeEach(async ({ page, umbracoApi }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {test, ApiHelpers, UiHelpers, ConstantHelper} from '@umbraco/playwright-t
import {expect} from "@playwright/test";

test.describe('Languages', () => {
test.beforeEach(async ({ page, umbracoApi }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {PartialViewMacroBuilder} from "@umbraco/json-models-builders";

test.describe('Macros', () => {

test.beforeEach(async ({ page, umbracoApi }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {expect} from "@playwright/test";

test.describe('Media types', () => {

test.beforeEach(async ({ page, umbracoApi }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Member Types', () => {
test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {PartialViewMacroBuilder} from "@umbraco/json-models-builders";

test.describe('Partial View Macro Files', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {PartialViewBuilder} from "@umbraco/json-models-builders";

test.describe('Partial Views', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Relation Types', () => {

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {expect} from "@playwright/test";
import {ScriptBuilder} from "@umbraco/json-models-builders";

test.describe('Scripts', () => {
test.beforeEach(async ({ page, umbracoApi }) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test.describe('Stylesheets', () => {
const name = "TestStylesheet";
const fileName = name + ".css";

test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';
import {TemplateBuilder} from "@umbraco/json-models-builders";

test.describe('Templates', () => {
test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const tabsDocTypeName = 'Tabs Test Document';
const tabsDocTypeAlias = AliasHelper.toAlias(tabsDocTypeName);

test.describe('Tabs', () => {

test.beforeEach(async ({ umbracoApi, page }) => {

test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {test} from '@umbraco/playwright-testhelpers';

test.describe('Tours', () => {
const timeout = 60000;
test.beforeEach(async ({page, umbracoApi}) => {
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
await resetTourData(umbracoApi);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import {ConstantHelper, test} from '@umbraco/playwright-testhelpers';

test.describe('Translation', () => {

test.beforeEach(async ({page, umbracoApi}) => {
// TODO: REMOVE THIS WHEN SQLITE IS FIXED
// Wait so we don't bombard the API
await page.waitForTimeout(1000);
test.beforeEach(async ({ page, umbracoApi }, testInfo) => {
await umbracoApi.report.report(testInfo);
await umbracoApi.login();
});

Expand Down
Loading

0 comments on commit 22bcc9b

Please sign in to comment.