-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Description
Describe the bug
An #if DEBUG
in file LoginStepDefinitions.cs is not escaped, leading to it not being present in the generated code.
Code snippet:
var options = new BrowserTypeLaunchOptions();
#if DEBUG
options.Headless = false;
options.SlowMo = 500;
#endif
var browser = await playwright.Chromium.LaunchAsync(options);
To Reproduce
Steps to reproduce the behavior:
dotnet new install Clean.Architecture.Solution.Template::9.0.12
- Create directory, e.g.
MyProjectInstantiation
cd MyProjectInstantiation
dotnet new ca-sln
- Open file
tests/Web.AcceptanceTests/StepDefinitions/LoginStepDefinitions.cs
- The
#if DEBUG
inBeforeLoginScenario
is not present (line 20):
var options = new BrowserTypeLaunchOptions();
var browser = await playwright.Chromium.LaunchAsync(options);
Expected behavior
The template should generate the #if DEBUG
:
var options = new BrowserTypeLaunchOptions();
#if DEBUG
options.Headless = false;
options.SlowMo = 500;
#endif
var browser = await playwright.Chromium.LaunchAsync(options);
Screenshots
After instantiation, line 20 is missing the #if DEBUG
:
Additional context
To fix this, surround the #if DEBUG
with //-:cnd:noEmit
and //+:cnd:noEmit
as described in the template wiki:
var options = new BrowserTypeLaunchOptions();
//-:cnd:noEmit
#if DEBUG
options.Headless = false;
options.SlowMo = 500;
#endif
//+:cnd:noEmit
var browser = await playwright.Chromium.LaunchAsync(options);
Metadata
Metadata
Assignees
Labels
No labels