From b4c7183f64c327cc6acca7dc8ee7b8d4e79aea58 Mon Sep 17 00:00:00 2001 From: Szabolcs Deme Date: Thu, 21 Dec 2023 01:55:12 +0100 Subject: [PATCH 1/5] Adding documentation about HTML validation rule changing --- Lombiq.Tests.UI/Docs/Configuration.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Lombiq.Tests.UI/Docs/Configuration.md b/Lombiq.Tests.UI/Docs/Configuration.md index 933dc2d2c..cc7562cfe 100644 --- a/Lombiq.Tests.UI/Docs/Configuration.md +++ b/Lombiq.Tests.UI/Docs/Configuration.md @@ -57,6 +57,28 @@ Recommendations and notes for such configuration: - If you have several UI test projects it can be cumbersome to maintain a _TestConfiguration.json_ file for each. Instead you can set the value of the `LOMBIQ_UI_TESTING_TOOLBOX_SHARED_TEST_CONFIGURATION` environment variable to the absolute path of a central configuration file and then each project will look it up. If you place an individual _TestConfiguration.json_ into a test directory it will still take precedence in case you need special configuration for just that one. - `MaxParallelTests` sets how many UI tests should run at the same time. It is an important property if you want to run your UI tests in parallel, check out the inline documentation in [`OrchardCoreUITestExecutorConfiguration`](../Services/OrchardCoreUITestExecutorConfiguration.cs). +### HTML validation configuration + +If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` (e.g. `TestName.htmlvalidate.json`), then you can change the configuration to use that: + +```cs + changeConfiguration: configuration => configuration.HtmlValidationConfiguration.HtmlValidationOptions = + configuration.HtmlValidationConfiguration.HtmlValidationOptions + .CloneWith(validationOptions => validationOptions.ConfigPath = + Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestName.htmlvalidate.json"))); +``` + +Make sure to also include the `root` attribute and set it to `true` inside the custom `.htmlvalidate.json` and include it in the test project like this: + +```xml + + + PreserveNewest + true + + + ``` + ## Multi-process test execution UI tests are executed in parallel by default for the given test execution process (see the [xUnit documentation](https://xunit.net/docs/running-tests-in-parallel.html)). However, if you'd like multiple processes to execute tests like when multiple build agents run tests for separate branches on the same build machine then you'll need to tell each process which build agent they are on. This is so clashes on e.g. network port numbers can be prevented. From 27281ae67e93bdb0bad006e6af04273bb559c1f6 Mon Sep 17 00:00:00 2001 From: Szabolcs Deme <80963259+DemeSzabolcs@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:12:33 +0100 Subject: [PATCH 2/5] Update Lombiq.Tests.UI/Docs/Configuration.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Krisztián Németh --- Lombiq.Tests.UI/Docs/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Tests.UI/Docs/Configuration.md b/Lombiq.Tests.UI/Docs/Configuration.md index cc7562cfe..cc8e30561 100644 --- a/Lombiq.Tests.UI/Docs/Configuration.md +++ b/Lombiq.Tests.UI/Docs/Configuration.md @@ -59,7 +59,7 @@ Recommendations and notes for such configuration: ### HTML validation configuration -If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` (e.g. `TestName.htmlvalidate.json`), then you can change the configuration to use that: +If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` file (e.g. `TestName.htmlvalidate.json`), then you can change the configuration to use that: ```cs changeConfiguration: configuration => configuration.HtmlValidationConfiguration.HtmlValidationOptions = From ed36f7170089c7c0b9859034612b721551b45310 Mon Sep 17 00:00:00 2001 From: Szabolcs Deme <80963259+DemeSzabolcs@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:12:41 +0100 Subject: [PATCH 3/5] Update Lombiq.Tests.UI/Docs/Configuration.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Krisztián Németh --- Lombiq.Tests.UI/Docs/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.Tests.UI/Docs/Configuration.md b/Lombiq.Tests.UI/Docs/Configuration.md index cc8e30561..97256093a 100644 --- a/Lombiq.Tests.UI/Docs/Configuration.md +++ b/Lombiq.Tests.UI/Docs/Configuration.md @@ -68,7 +68,7 @@ If you want to change some HTML validation rules from only a few specific tests, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestName.htmlvalidate.json"))); ``` -Make sure to also include the `root` attribute and set it to `true` inside the custom `.htmlvalidate.json` and include it in the test project like this: +Make sure to also include the `root` attribute and set it to `true` inside the custom `.htmlvalidate.json` file and include it in the test project like this: ```xml From 15e43e2597d40d13a66b8b7f65fa4736b0d34810 Mon Sep 17 00:00:00 2001 From: Szabolcs Deme Date: Tue, 16 Jan 2024 16:21:38 +0100 Subject: [PATCH 4/5] Adding example json file --- Lombiq.Tests.UI/Docs/Configuration.md | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Lombiq.Tests.UI/Docs/Configuration.md b/Lombiq.Tests.UI/Docs/Configuration.md index 97256093a..ec2b99f76 100644 --- a/Lombiq.Tests.UI/Docs/Configuration.md +++ b/Lombiq.Tests.UI/Docs/Configuration.md @@ -59,7 +59,33 @@ Recommendations and notes for such configuration: ### HTML validation configuration -If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` file (e.g. `TestName.htmlvalidate.json`), then you can change the configuration to use that: +If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` file (e.g. `TestName.htmlvalidate.json`). For example: + +```json +{ + "extends": [ + "html-validate:recommended" + ], + + "rules": { + "attribute-boolean-style": "off", + "element-required-attributes": "off", + "no-trailing-whitespace": "off", + "no-inline-style": "off", + "no-implicit-button-type": "off", + "wcag/h30": "off", + "wcag/h32": "off", + "wcag/h36": "off", + "wcag/h37": "off", + "wcag/h67": "off", + "wcag/h71": "off" + }, + + "root": true +} +``` + +Then you can change the configuration to use that: ```cs changeConfiguration: configuration => configuration.HtmlValidationConfiguration.HtmlValidationOptions = From c00afbc8b40b3bd4dff9e58b3c9c3b2f186889ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20N=C3=A9meth?= Date: Wed, 17 Jan 2024 00:13:08 +0100 Subject: [PATCH 5/5] File names should be wrapped with underscore --- Lombiq.Tests.UI/Docs/Configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lombiq.Tests.UI/Docs/Configuration.md b/Lombiq.Tests.UI/Docs/Configuration.md index fa024a23a..64bc537cb 100644 --- a/Lombiq.Tests.UI/Docs/Configuration.md +++ b/Lombiq.Tests.UI/Docs/Configuration.md @@ -59,7 +59,7 @@ Recommendations and notes for such configuration: ### HTML validation configuration -If you want to change some HTML validation rules from only a few specific tests, you can create a custom `.htmlvalidate.json` file (e.g. `TestName.htmlvalidate.json`). For example: +If you want to change some HTML validation rules from only a few specific tests, you can create a custom _.htmlvalidate.json_ file (e.g. _TestName.htmlvalidate.json_). For example: ```json { @@ -94,7 +94,7 @@ Then you can change the configuration to use that: Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestName.htmlvalidate.json"))); ``` -Make sure to also include the `root` attribute and set it to `true` inside the custom `.htmlvalidate.json` file and include it in the test project like this: +Make sure to also include the `root` attribute and set it to `true` inside the custom _.htmlvalidate.json_ file and include it in the test project like this: ```xml