Is there a way to execute tagged Feature/Scenario/Examples in Webdriverio-cucumber/boilerplate?

Hey there! I could use some assistance. I'm attempting to execute a specific scenario using Cucumber tags with the expression below:

npx wdio run wdio.conf.js --cucumberOpts.tagExpression='@sanity and @stage'

However, when I run the command above, nothing seems to happen. I have defined the tag '@Tag' at the feature level and expected all scenarios within the feature file to be executed. Can someone lend a hand?

npx wdio run wdio.conf.js --cucumberOpts.tagExpression='@Tag'

Example:
@sanity
Feature: Automated Testing
    As a user, I want to perform automated login on a website
    Scenario: Login with test credentials
        Given I navigate to "<Link>"
        Then I expect the page title to be "iCRM Login"
        When I enter "<Username>" into the input field "#loginEmail"
        And  I click the button "[role=button]"
        And  I enter "<Password>" into the input field "#Password1"
        Then I click the button "//button[contains(text(),'Log In')]"
        Then I wait for element "//body/div[@id='wrap']/div[4]/div[2]/div[2]/div[3]/div[3]" to display for 10000ms
        @stage
        Examples:
            | Username                        | Password | Link                       |
            | [email protected]       | test5#   | https://test.com/icrm/index.html |
        @Live
    Examples:
       | Username                        | Password | Link                                              |
        | [email protected] | Virtua5# | https://testlinkslive.com/icrm/index.html 

|

Answer №1

An error has been identified in your Feature file that needs to be corrected.

When using Examples: for parameterization of scenarios, each scenario utilizing examples must be labeled with a Scenario Outline before the scenario title.

The format should resemble the following:

  @sanity
  Feature: ICRM test
  As a user, I want to login with test website

  Scenario Outline: login with credentials
    Given I open the url "<Link>"

    .... other steps

    Then I wait on element "//body/div[@id='wrap']/div[4]/div[2]/div[2]/div[3]/div[3]" for 10000ms to be displayed
    @ex1
    @stage
    @test
    Examples:
      | Username              | Password | Link                              |
      | <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d3a0b2beb6b6a1fdb9bca0bbba93a7b6a0a7fdb0bcbe">[email protected]</a> | stage5#  | https://stage.com/icrm/index.html |
    @ex2
    @live
    @test
    Examples:
      | Username              | Password | Link                                      |
      | <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d1a2b0bcb4b4a3ffbbbea2b9b891a5b4a2a5ffb2bebc">[email protected]</a> | virtua5# | https://testlinkslive.com/icrm/index.html |
    @ex3
    @adhoc
    @test
    Examples:
      | Username              | Password | Link                             |
      | <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b485a565e5e491551544853527b4f5e484f15585456">[email protected]</a> | test5#   | https://test.com/icrm/index.html |

Now, to only run the scenario example tagged with @stage, use the command:

npx wdio run wdio.conf.js --cucumberOpts.tagExpression='@sanity and @stage'

Cucumber Options Summary

{"@sanity"} - runs the scenario with all 3 examples
{"not @live"} - excludes the scenario example tagged with @live (@ex2 in this case)
{"@live or @stage"} - runs scenarios tagged with @live and @stage (in this case, @ex1 & @ex2)
{"@test and @adhoc"} - runs the scenario with both @adhoc and @test tags (@ex3 in this case)
{"@test and (@stage or @adhoc)"} - runs scenarios tagged with @test+@stage and @test+@adhoc (@ex1 & @ex3 in this case)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

An error occurred: The property 'toUpperCase' cannot be read of an undefined Observable in an uncaught TypeError

Encountering an issue during the development of a mobile app using the ionic framework for a movie application. After finding an example on Github, I attempted to integrate certain functions and designs into my project. The problem arises with the 'S ...

How to start Angular2 prototype with an object literal

export abstract class GridColumn { public field?: string; public sortField?: string; public header?: string; public footer?: string; public sortable?: any = true; public editable?: boolean = false; public filter?: boolean = true ...

Using SCSS variables in TypeScript inside a Vue project

Has anyone had experience with importing SASS (scss) variables into JavaScript in a TypeScript Vue 3 project? // @/assets/styles/colors.scss $white: #fff; // @/assets/styles/_exports.scss @import "./colors.scss"; :export { white: $white; } <templat ...

Angular - Implementing validation for maximum character length in ngx-intl-tel-input

Utilizing the ngx-intl-tel-input package in my Angular-12 project multistep has been quite promising. Below is a snippet of the code: Component: import { SearchCountryField, CountryISO, PhoneNumberFormat } from 'ngx-intl-tel-input'; expor ...

What could be causing the Properties Array to come back as undefined?

When attempting to add an item to an array stored in the properties, I am encountering an error: "Cannot read properties of undefined (reading 'value')." Within the props, the following interfaces are defined: ILinkItemProps.ts export interface ...

If you're setting up a new Next.js and Tailwind CSS application, you can use the flags -e or --example to start the project as a

After several attempts at creating a Next.js app with Tailwind CSS using JavaScript, I keep getting TypeScript files. How can I prevent this error? Despite following the usual commands for setting up a Next.js project, I am consistently ending up with Typ ...

Notify programmers about the potential risks associated with utilizing certain third-party components

Incorporating a 3rd party library into our codebase involves utilizing its components directly, although some are enclosed within internally created components. Is there a method available to alert developers when they try to use one of the wrapped compone ...

Can I assign a value from the tagModel to ngx-chips in an Angular project?

HTML code: <tag-input class="martop20 tag-adder width100 heightauto" [onAdding]="onAdding" (onAdd)="addInternalDomain($event)" type="text" Ts code: addInternalDomain(tagTex ...

Using the css function within styled-components

Struggling with implementing the media templates example from the documentation and figuring out how to type the arguments for the css function in plain JS: const sizes = { desktop: 992 } const media = Object.keys(sizes).reduce((acc, label) => { ...

Struggling with a Nextjs Stripe issue? The expected signature for payload does not match any found signatures

Struggling to integrate data from Stripe check out events into my orders database, facing issues with finding the signature while testing the web hook. Check out route: app/api/webhooks/checkout/route.ts import Cors from "micro-cors"; import { h ...

Querying Firebase to find documents that do not have a specific requested field present in all

My current project is using firebase. I am currently working on retrieving documents from firebase, but I have encountered a specific issue. The problem lies in the fact that I have older documents without a "hidden" field and newer documents with this fie ...

Exploring Angular 10's advanced forms: delving into three levels of nested form groups combined with

Project Link: Click here to view the project In my testForm, I have 3 levels of formGroup, with the last formGroup being an array of formGroups. I am trying to enable the price field when a checkbox is clicked. I am unsure how to access the price contro ...

Issue: Undefined default value property in TypescriptDescription: In Typescript,

export class EntityVM implements EntityModel { ... Properties... ... constructor(newEntity: EntityModel, isCollapsed = false) { ... Properties... ... this.isCollapsed = isCollapsed; } } public myFunction(myEntity: EntityVM) { / ...

Having trouble accessing a JSON object with Typescript in an Angular 2 project

Something strange is happening with my code. I am working with a JSON object: {"login":"admin","name":"Admin"} And this is the relevant part of my code: private _userData: User; ... private getUserData() { this._userInfoService.getUserInfo() ...

How to integrate a chips feature in Angular 4 using Typescript

Struggling to incorporate a chips component into my Angular web application, which comprises Typescript, HTML, and CSS files. After grappling with this for weeks without success, I have yet to find the right solution. To review my current code, you can a ...

How can Mui typescript be extended with a unique wrapper that includes a `component` property?

I recently created a unique wrapper component: import Box, { BoxProps } from "@mui/material/Box"; type CustomWrapperProps = { id: string } & BoxProps const CustomWrapper = (props: CustomWrapperProps) => { const {id, children, ...rest ...

What is the process of extracting an observable from another observable using the pipe method?

Is there a more efficient way to convert an Observable of Observables into an array of Observables in my pipe method? Here is the scenario: // The type of "observables" is Observable<Observable<MyType>[]> const observables = this.http.get<M ...

Angular 2's Dependency Injection injects functions instead of objects

My application has a 'store' service that depends on a 'repo' service. The issue I'm facing is that the 'store' service is being injected correctly, but the 'repo' service it receives appears to be a function in ...

Top-notch approach for consolidating Typescript Declaration files into a single comprehensive file

Is there any efficient way to package declaration files together without using the module declaration approach? declare module "path/to/file" { ... } declare module "path/to/file/sub/file" { ... } and so on. I have encountere ...

Dismiss the Popover in Ionic 2

After opening a popover that redirects me to another page and then returning to the root page (popToRoot), I reload the data/dom upon an event and dismiss the popup once the json data is received from the server. Everything works smoothly with a lengthy ti ...