Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6543793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:23:17+00:00 2026-05-25T11:23:17+00:00

My app has permissions, and certain tests need to not be run when a

  • 0

My app has permissions, and certain tests need to not be run when a particular permission is on, and some tests need to be run when that same permission is on.

Is there a way to do this? or do I need to use a different framework?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:23:17+00:00Added an answer on May 25, 2026 at 11:23 am

    The standard way of excluding ‘tests’ in Cucumber is to add a tag to them to identify them, then when invoking Cucumber you specify which tags to include/exclude. In your example, you could tag a specific scenario:

    @needs_permission
    Scenario: View users billing information
    

    Or tag the whole feature:

    @needs_permission
    Feature: Administrative area
        Scenario: View users billing information
    

    Or tag certain examples in a scenario outline:

    Scenario Outline: Visit a page
        Given I visit "<page>"
    
    Examples: Don't need permission
        | page    |
        | index   |
        | sitemap |
    
    @needs_permission
    Examples: Do need permission
        | page  |
        | admin |
    

    Now, when you run Cucumber, you can exclude those tags if necessary:

    When the permission is on and you want to run all tests:

    cucumber .
    

    When the permission is off and you want to exclude the tests that need it:

    cucumber . -t ~@needs_permission
    

    An alternative which I have used with mixed results, if you really don’t know ahead of time, is to mark a step as pending if it doesn’t apply given the current scenario, e.g.

    Given /^I visit some page which needs permission$/ do
        pending "Permissions aren't enabled - skipping" unless permissions_enabled?
    end
    

    This will mark the step as ‘pending’ which really means ‘not fully implemented’, which isn’t ideal, especially if you have many such steps – it can be difficult to ensure that other unimplemented steps don’t accidentally creep in and get hidden by all the ones you’ve deliberately marked as such.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app has some table cells that vary in height. The cells can also
My app has a Permission model and permissions table with an email field. Existing
I need to delete an application (MyApp.app), which has read only permissions in all
My app has several buttons which trigger different events. The user should NOT be
My app has SEND_SMS and RECEIVE_SMS permissions, by publishing it gets android.hardware.telephony requirement. As
My app has not caught up to the new changes in facebook's oauth. Before,
I'm building a Facebook app that has (as part of its function) a display
When i check whether use has liked my page or not.My app is getting
The App I need to implement a web app that will be used by
My app has authentication and for the user to be able to edit some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.