Uros Matijasevic
Uros Matijasevic

Reputation: 11

How to use Scenario Outline in Gherkin when I have different amount of parameters

I am fairly new to Playwright and Gherkin, and I'm trying to implement a Scenario Outline in one of my tests, as the steps are mostly the same. However, I ran into an issue with validation when I need to check multiple values within a single step. To clarify, here is the setup of my scenario:

Background:
  Given I am "user"
  And I am logged in
  And I am on the "content-management" page

Scenario Outline: As a User, I want to be able to upload, import and export an environment containing unsupported entities
        When I upload files:
            | Name        |
            | <file_name> |
        Then I should see record with parameters:
            | Name   | Content Description   | Source Environment | Source Version
            | <Name> | <Content Description> | <Source Env>       | <Source Ver> |
        And I can find parent log message "<upload_log_message>"
        When I import environment with properties:
            | Property  | Value |
            | Activate  | Yes   |
            | Overwrite | No    |
        And I can confirm import
        Then I should see notification "Successfully imported the environment"
        And I can find parent log message "Env '<envID>/<envVer>': Import process completed in"
        And I can find child log message '<import_child_log>'
**EXAMPLES:**
 | file_name | Name  | Content Description |upload_log_message |import_child_log
 | ABC       | ABC   | ABC                 | ABC               | ABC <DEF> <GHI>

My question is about the import_child_log parameter. I would like to use more than one value (e.g., multiple placeholders such as , ) within this parameter. Is this possible, and if so, how can it be implemented?

I tried to use comma (,) or semicolon (;) as a separator, but it didn't work.. During the execution it was reading it as a single String like ABC, DEF, GHI...

Upvotes: 1

Views: 34

Answers (1)

unickq
unickq

Reputation: 3295

Because the import_child_log column value is a string. Use split(',')

Or use 3 rows in the examples

| file_name | Name  | Content Description |upload_log_message |import_child_log
| ABC       | ABC   | ABC                 | ABC               | ABC
| ABC       | ABC   | ABC                 | ABC               | DEF
| ABC       | ABC   | ABC                 | ABC               | GHI

Upvotes: 1

Related Questions