Skip to content

Commit

Permalink
Removing #spell-check-ignore-line comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Feb 19, 2025
1 parent 8c2c3bf commit 5657458
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI.Samples/Tests/RemoteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Lombiq.Tests.UI.Samples.Tests;
// While there may be some common code between local and remote tests, they cannot be the same, and the common code must
// be in a project independent of the web app (which is not the case here for the sake of simplicity):
// - In local tests, you have a much lower-level access to the app: E.g., you can access the Orchard Core log, use
// shortcuts with all kinds of backdoors, and you can communicate directly with the Orchard Core shell (not just via #spell-check-ignore-line
// shortcuts with all kinds of backdoors, and you can communicate directly with the Orchard Core shell (not just via
// web APIs). You can also save a snapshot of the site's database and media. None of these are available (for a good
// reason) when the app is deployed to a server: There, you interact with it just as any ordinary user.
// - For local tests, you need to build the web app and all its dependencies. For remote tests, you only need the test
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Task TimeShouldUpdate() =>
// Create a simple widget that shows the current date, so we can compare the effects of this feature.
await context.SignInDirectlyAsync();
await context.GoToAdminRelativeUrlAsync(
"/Contents/ContentTypes/LiquidWidget/Create?returnUrl=%2FAdmin%2FLayers&" + // #spell-check-ignore-line
"/Contents/ContentTypes/LiquidWidget/Create?returnUrl=%2FAdmin%2FLayers&" +
"LayerMetadata.Zone=Content&LayerMetadata.Position=1");
await context.FillInCodeMirrorEditorWithRetriesAsync(
By.CssSelector(".CodeMirror.cm-s-default"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static Task GenerateHttpEventUrlShouldWorkAsync(
{
await context.EnableFeatureDirectlyAsync(ShortcutsFeatureIds.Workflows);
await context.ExecuteRecipeDirectlyAsync("Lombiq.Tests.UI.Tests.UI.WorkflowShortcutsTests");
(await context.GenerateHttpEventUrlAsync("testworkflow000000", "testhttpevent00000")) // #spell-check-ignore-line
(await context.GenerateHttpEventUrlAsync("testworkflow000000", "testhttpevent00000"))
.ShouldStartWith("/workflows/Invoke?token=");
},
browser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Lombiq.Tests.UI.Attributes.Behaviors;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class SetsValueReliablyAttribute : ValueSetBehaviorAttribute
{
public override void Execute<TOwner>(IUIComponent<TOwner> component, string value) // #spell-check-ignore-line
public override void Execute<TOwner>(IUIComponent<TOwner> component, string value)
{
var element = component.Scope;
var driver = component.Context.Driver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static Task TestAuditTrailAsync(this UITestContext context) =>

await context.GoToAdminRelativeUrlAsync(auditTrailPath);

var auditTrailTestPageSuccessXpath = "//div[contains(@class, eventdata)]/small[contains(., 'was published')" + // #spell-check-ignore-line
var auditTrailTestPageSuccessXpath = "//div[contains(@class, eventdata)]/small[contains(., 'was published')" +
$" and contains(., 'of the Page')]/a[text()='{auditTrailTestPageTitle}']";

context.Exists(By.XPath(auditTrailTestPageSuccessXpath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static Task TestMediaOperationsAsync(this UITestContext context) =>

await context.GoToAdminRelativeUrlAsync(mediaPath);

context.UploadSamplePngByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
context.UploadSamplePngByIdOfAnyVisibility("fileupload");

// Workaround for pending uploads, until you make an action the page is stuck on "Uploads Pending".
context.WaitForPageLoad();
Expand All @@ -47,7 +47,7 @@ await context
context.WaitForPageLoad();
await context.GoToAdminRelativeUrlAsync(mediaPath);

context.UploadSamplePdfByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
context.UploadSamplePdfByIdOfAnyVisibility("fileupload");

// Workaround for pending uploads, until you make an action the page is stuck on "Uploads Pending".
context.WaitForPageLoad();
Expand All @@ -65,7 +65,7 @@ await context
await context.GoToAdminRelativeUrlAsync(mediaPath);

await context
.Get(By.CssSelector("#folder-tree .treeroot .folder-actions")) // #spell-check-ignore-line
.Get(By.CssSelector("#folder-tree .treeroot .folder-actions"))
.ClickReliablyAsync(context);

context.Get(By.Id("create-folder-name")).SendKeys("Example Folder");
Expand All @@ -79,8 +79,8 @@ await context.DoWithRetriesOrFailAsync(
.Safely())),
timeout: TimeSpan.FromMinutes(2));

context.UploadSamplePngByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
context.UploadSamplePdfByIdOfAnyVisibility("fileupload"); // #spell-check-ignore-line
context.UploadSamplePngByIdOfAnyVisibility("fileupload");
context.UploadSamplePdfByIdOfAnyVisibility("fileupload");
context.WaitForPageLoad();

var image = context.Get(By.XPath($"//span[contains(text(), '{imageName}')]"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public static Task TestWorkflowsAsync(this UITestContext context) =>
context.DragAndDropToOffset(By.XPath(taskXPath), 400, 0);

context.DragAndDrop(
By.XPath("//div[@class = 'jtk-endpoint jtk-endpoint-anchor jtk-draggable jtk-droppable']"), // #spell-check-ignore-line
By.XPath("//div[@class = 'jtk-endpoint jtk-endpoint-anchor jtk-draggable jtk-droppable']"),
By.XPath(taskXPath));

context.WaitElementToNotChange(By.ClassName("jtk-connector")); // #spell-check-ignore-line
context.WaitElementToNotChange(By.ClassName("jtk-connector"));

// We need to save the workflow early, because sometimes the editor, thus the startup task button can be
// buggy during UI testing (it won't be clicked, even if we check for its existence). This way it's
Expand Down
4 changes: 2 additions & 2 deletions Lombiq.Tests.UI/Constants/TestUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Lombiq.Tests.UI.Constants;
/// </summary>
public static class TestUser
{
public const string UserName = "TestUser"; // #spell-check-ignore-line
public const string Email = "testuser@example.com"; // #spell-check-ignore-line
public const string UserName = "TestUser";
public const string Email = "testuser@example.com";
public const string Password = DefaultUser.Password;
}
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Extensions/EmailUITestContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static async Task ConfigureSmtpSettingsAsync(
}

/// <summary>
/// Clicks reliably on an SMTP inbox row and attempts to switch to frame 0 with retries. // #spell-check-ignore-line
/// Clicks reliably on an SMTP inbox row and attempts to switch to frame 0 with retries.
/// If switching to the frame fails due to smtp4dev reloading, it logs the failure and retries up to the specified
/// maximum attempts.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ public static async Task RestartAsync(this IWebApplicationInstance webApplicatio
private static async Task AssertLogsAsync(
IWebApplicationInstance webApplicationInstance,
Expression<Func<IApplicationLogEntry, bool>> logEntryPredicate,
Action<IEnumerable<IApplicationLogEntry>, Expression<Func<IApplicationLogEntry, bool>>, string> shouldlyMethod, // #spell-check-ignore-line
Action<IEnumerable<IApplicationLogEntry>, Expression<Func<IApplicationLogEntry, bool>>, string> shouldlyMethod,
CancellationToken cancellationToken = default)
{
var logs = await webApplicationInstance.GetLogsAsync(cancellationToken);
var logContents = await logs.ToFormattedStringAsync();

foreach (var log in logs)
{
shouldlyMethod(await log.GetEntriesAsync(), logEntryPredicate, logContents); // #spell-check-ignore-line
shouldlyMethod(await log.GetEntriesAsync(), logEntryPredicate, logContents);
}
}
}
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
[assembly: SuppressMessage(
"Security",
"MA0009:Add regex evaluation timeout",
Justification = "Regexes in this project don't use user input.")] // #spell-check-ignore-line
Justification = "Regexes in this project don't use user input.")]
4 changes: 2 additions & 2 deletions Lombiq.Tests.UI/Helpers/FileUploadHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public static class FileUploadHelper

public static readonly string SamplePdfFileName = "document.pdf";
public static readonly string SamplePngFileName = "image.png";
public static readonly string SampleDocxFileName = "uploadingtestfiledocx.docx"; // #spell-check-ignore-line
public static readonly string SampleXlsxFileName = "uploadingtestfilexlsx.xlsx"; // #spell-check-ignore-line
public static readonly string SampleDocxFileName = "uploadingtestfiledocx.docx";
public static readonly string SampleXlsxFileName = "uploadingtestfilexlsx.xlsx";

public static readonly string SamplePdfPath = Path.Combine(BasePath, SamplePdfFileName);
public static readonly string SamplePngPath = Path.Combine(BasePath, SamplePngFileName);
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Models/UserRegistrationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static UserRegistrationParameters CreateDefault() =>
new()
{
UserName = "TestUser",
Email = "testuser@example.org", // #spell-check-ignore-line
Email = "testuser@example.org",
Password = DefaultUser.Password,
ConfirmPassword = DefaultUser.Password,
};
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/MonkeyTesting/GremlinsScripts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ internal string Build()
const customLogger = {{
log: function () {{
console.log.apply(null, arguments);
if (['click', 'dblclick', 'mouseup'].some(mouseAction => arguments[2] === mouseAction)) {{ // #spell-check-ignore-line
if (['click', 'dblclick', 'mouseup'].some(mouseAction => arguments[2] === mouseAction)) {{
var message = Array.prototype.slice.call(arguments, 2).join(' ');
sessionStorage.setItem('lastgremlinsclick', message);
}}
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/OrchardCoreUITestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class OrchardCoreUITestBase<TEntryPoint> : UITestBase
private const string AppFolder = nameof(AppFolder);

protected virtual Size StandardBrowserSize => CommonDisplayResolutions.Standard;
protected virtual Size MobileBrowserSize => CommonDisplayResolutions.NhdPortrait; // #spell-check-ignore-line
protected virtual Size MobileBrowserSize => CommonDisplayResolutions.NhdPortrait;

protected OrchardCoreUITestBase(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public SecurityScanConfiguration ConfigureActiveScanRule(int id, ScanRuleThresho
/// Controls the number of attacks that ZAP will perform. See <see
/// href="https://www.zaproxy.org/docs/desktop/ui/dialogs/scanpolicy/#strength">the official docs</see>.
/// </param>
public SecurityScanConfiguration ConfigureXssActiveScanRule(ScanRuleThreshold threshold, ScanRuleStrength strength) // #spell-check-ignore-line
public SecurityScanConfiguration ConfigureXssActiveScanRule(ScanRuleThreshold threshold, ScanRuleStrength strength)
{
ConfigureActiveScanRule(40026, threshold, strength, "Cross Site Scripting (DOM Based)");
return this;
Expand Down
12 changes: 5 additions & 7 deletions Lombiq.Tests.UI/SecurityScanning/ZapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public sealed class ZapManager : IAsyncDisposable
// https://hub.docker.com/r/zaproxy/zap-stable/tags.
// When updating this version, also regenerate the Automation Framework YAML config files so we don't miss any
// changes to those.
private const string _zapImage = "zaproxy/zap-stable:2.16.0"; // #spell-check-ignore-line
private const string _zapWorkingDirectoryPath = "/zap/wrk/"; // #spell-check-ignore-line
private const string _zapImage = "zaproxy/zap-stable:2.16.0";
private const string _zapWorkingDirectoryPath = "/zap/wrk/";
private const string _zapReportsDirectoryName = "reports";
private const string _zapHomeDirectoryName = "home";

Expand Down Expand Up @@ -114,10 +114,8 @@ public async Task<SecurityScanResult> RunSecurityScanAsync(

// Also see https://www.zaproxy.org/docs/docker/about/#automation-framework.

// Running a ZAP desktop in the browser with Webswing with the same config under Windows: #spell-check-ignore-line
#pragma warning disable S103 // Lines should not be too long
// docker run --add-host localhost:host-gateway -u zap -p 8080:8080 -p 8090:8090 -i softwaresecurityproject/zap-stable zap-webswing.sh #spell-check-ignore-line
#pragma warning restore S103 // Lines should not be too long
// Running a ZAP desktop in the browser with Webswing with the same config under Windows:
// docker run --add-host localhost:host-gateway -u zap -p 8080:8080 -p 8090:8090 -i softwaresecurityproject/zap-stable zap-webswing.sh

var cliParameters = new List<object> { "run" };

Expand Down Expand Up @@ -182,7 +180,7 @@ public async Task<SecurityScanResult> RunSecurityScanAsync(
.ExecuteAsync(_cancellationTokenSource.Token);

// Under the Ubuntu GitHub Actions runners, at this point, the report's folder (like
// "2025-01-22-ZAP-Report-localhost") will remain unwritable, but readable. No amount of sudo chmodding will fix #spell-check-ignore-line
// "2025-01-22-ZAP-Report-localhost") will remain unwritable, but readable. No amount of sudo chmodding will fix
// this, and it's not because any process is locking it. This shouldn't be much of an issue, though.

_testOutputHelper.WriteLineTimestampedAndDebug("Security scanning completed with the exit code {0}.", result.ExitCode);
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Services/AtataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static async Task<AtataScope> StartAtataScopeAsync(
.UseTestName(configuration.AtataConfiguration.TestName)
.UseBaseRetryTimeout(timeoutConfiguration.RetryTimeout)
.UseBaseRetryInterval(timeoutConfiguration.RetryInterval)
.PageSnapshots.UseCdpOrPageSourceStrategy() // #spell-check-ignore-line
.PageSnapshots.UseCdpOrPageSourceStrategy()
.UseArtifactsPathTemplate(contextId); // Necessary to prevent long paths, an issue under Windows.

if (configuration.BrowserConfiguration.Browser != Browser.None)
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Services/AzureBlobStorageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class AzureBlobStorageConfiguration
/// execution you can just delete the container (it'll be created if it doesn't exist). This configuration will be
/// automatically passed to the tested app.
/// </summary>
public string ContainerName { get; set; } = "lombiquitestingtoolbox"; // #spell-check-ignore-line
public string ContainerName { get; set; } = "lombiquitestingtoolbox";
}

public class AzureBlobStorageRunningContext
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Services/SqlServerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SqlServerRunningContext

public sealed class SqlServerManager : IAsyncDisposable
{
private const string DbSnapshotName = "Database.bak"; // #spell-check-ignore-line
private const string DbSnapshotName = "Database.bak";

private static readonly PortLeaseManager _portLeaseManager;
private static readonly SemaphoreSlim _semaphore = new(1, 1);
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Services/TeamCityMetadataReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private static string Escape(string value) => value
.Replace("'", "|'", StringComparison.Ordinal)
.Replace('\n', 'n')
.Replace("\r", "|r", StringComparison.Ordinal)
.Replace(@"\uNNNN", "|0xNNNN", StringComparison.Ordinal) // #spell-check-ignore-line
.Replace(@"\uNNNN", "|0xNNNN", StringComparison.Ordinal)
.Replace("[", "|[", StringComparison.Ordinal)
.Replace("]", "|]", StringComparison.Ordinal);
}
10 changes: 5 additions & 5 deletions Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Task<Func<ChromeDriver>> CreateDriverInnerAsync(string driverPath = null) =>

// Linux-specific setting, may be necessary for running in containers, see
// https://developers.google.com/web/tools/puppeteer/troubleshooting#tips for more information.
chromeConfig.Options.AddArgument("disable-dev-shm-usage"); // #spell-check-ignore-line
chromeConfig.Options.AddArgument("disable-dev-shm-usage");

// Disables the "self-XSS" warning in dev tools (when you have to type "allow pasting"), see
// https://developer.chrome.com/blog/self-xss and https://issues.chromium.org/issues/41491762 for
// details.
chromeConfig.Options.AddArgument("unsafely-disable-devtools-self-xss-warnings"); // #spell-check-ignore-line
chromeConfig.Options.AddArgument("unsafely-disable-devtools-self-xss-warnings");

// Disables the default search engine selector splash screen.
chromeConfig.Options.AddArgument("disable-search-engine-choice-screen");
Expand All @@ -64,7 +64,7 @@ Task<Func<ChromeDriver>> CreateDriverInnerAsync(string driverPath = null) =>
.SetCommonTimeouts(pageLoadTimeout);
});

var chromeWebDriverPath = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER"); // #spell-check-ignore-line
var chromeWebDriverPath = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
if (chromeWebDriverPath is { } driverPath && Directory.Exists(driverPath))
{
return CreateDriverInnerAsync(driverPath);
Expand Down Expand Up @@ -128,7 +128,7 @@ public static Task<Func<FirefoxDriver>> CreateFirefoxDriverAsync(BrowserConfigur

// For some reason FirefoxOptions does not expose the argument list like the Chromium-based driver
// options classes do.
const string argumentsFieldName = "firefoxArguments"; // #spell-check-ignore-line
const string argumentsFieldName = "firefoxArguments";
var arguments = typeof(FirefoxOptions)
.GetField(argumentsFieldName, BindingFlags.Instance | BindingFlags.NonPublic)?
.GetValue(options) as IList<string> ?? [];
Expand Down Expand Up @@ -156,7 +156,7 @@ private static TDriverOptions SetCommonChromiumOptions<TDriverOptions>(

// Disabling hardware acceleration to avoid hardware dependent issues in rendering and visual validation.
options.AddArgument("disable-accelerated-2d-canvas");
options.AddArgument("disable-gpu"); // #spell-check-ignore-line
options.AddArgument("disable-gpu");

// Setting font rendering to keep the text as they are for visual verification testing.
options.AddArgument("font-render-hinting=none");
Expand Down

0 comments on commit 5657458

Please sign in to comment.