Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get tags of scenario to be executed, before driver instantiation #3213

Open
dragos-panzaru-md opened this issue Aug 4, 2023 · 0 comments

Comments

@dragos-panzaru-md
Copy link

dragos-panzaru-md commented Aug 4, 2023

I have a custom driver implementation:
`

      MutableCapabilities caps = new MutableCapabilities();

       if (<scenario tags contains a specific tag>) {

            caps.setCapability("autoGrantPermissions", "true");

        }

        caps.setCapability("platformName", "Android");

        caps.setCapability("appium:platformVersion", "^([7-9]|1[0-1]).*");

        caps.setCapability("appium:newCommandTimeout", 90);

        caps.setCapability("appium:deviceType", "phone");

        caps.setCapability("appium:deviceName", "^(Samsung).*");

        caps.setCapability("appium:automationName", "UiAutomator2");

        caps.setCapability("appium:ignoreUnimportantViews", false);

        caps.setCapability("appium:app", "storage:" + System.getenv("APP_ID"));

        MutableCapabilities sauceOptions = new MutableCapabilities();

        sauceOptions.setCapability("appiumVersion", "2.0.0");

        sauceOptions.setCapability("build", buildName);

        sauceOptions.setCapability("tunnelName", "tunnel_name");

        sauceOptions.setCapability("tunnelOwner", System.getenv("SAUCE_USERNAME"));

        sauceOptions.setCapability("phoneOnly", true);

        caps.setCapability("sauce:options", sauceOptions);

        return new AndroidDriver(new URL(URL), caps);

`
When running tests in parallel, is there a way to get the tags of the scenario to be executed, before driver instantiation, so that I can set the "autoGrantPermissions" capability accordingly. E.g if a scenario is tagged @LocationServices I don't want to set autoGrantPermissions to true, but otherwise set it to true.
I am using latest serenity version 3.9.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant