0

My JSON file is:

specflow.actions.json file

{
  "target": {
    "defaultTimeout": 60,
    "headless": false,
    "traceDir": "traces"
  }
}

My custom json file I am willing to use for targetting different browsers and OS

{
  "BrowserTypes": [
      {
        "BrowserName": "Chrome",
        "OS": [ "Win10_Chrome", "Win11_Chrome", "Mac" ]
      },
      {
        "BrowserName": "Edge",
        "OS": [ "Win10_Chrome" ]
      },
      {
        "BrowserName": "Mobile",
        "OS": [ "IOS_Chrome", "Android_Chrome" ]
      }
    ],
    "DefaultBrowser": [ "Chrome", "Mobile" ],
    "DefaultEnvironment": "Demo"
}

I am new to Specflow playwright c# and I want to see how we can achieve Cross bowser testing. I have gone through the document provided at git, but I am unable to tweak the configuration at runtime.

I am expecting to control the configuration at runtime so that the test cases run for the defined browsers at run time

  • You are linking to the source code. Try this URL: https://github.com/SpecFlowOSS/SpecFlow.Actions/tree/main/Plugins/SpecFlow.Actions.Playwright - it is the root page for the plugin, which has a readme file. – Greg Burghardt Mar 14 '23 at 18:02
  • Based on the JSON structure in the link in my previous comment, it doesn't look like you cannot specify configurations for multiple browsers are the same time. – Greg Burghardt Mar 14 '23 at 18:06
  • @GregBurghardt - thanks for the update. I am willing to use the custom config.json file and structure mentioned instead of creating multiple specflow.actions.Target1.json for each targets. Is their any way I can use it so that my single test covers all the browsers with capabilities. – Kanchan Sharma Mar 16 '23 at 10:25
  • I think you misread my comment. It does not appear like you can use one config file for multiple browser configurations. It looks like you need one config file per browser. You will probably need to run each test once for each browser you wanted supported. – Greg Burghardt Mar 16 '23 at 12:23

0 Answers0