gauge-java icon indicating copy to clipboard operation
gauge-java copied to clipboard

Cannot use pipe which has wrapped with double quotes ("|") for a table in spec file

Open osandadeshan opened this issue 7 years ago • 2 comments

Expected behavior

Should be able to use pipe which has wrapped with double quotes ("|") for a table in spec file

Actual behavior

Cannot use pipe which has wrapped with double quotes ("|") for a table in spec file

Steps to reproduce

  1. Write a java method for a data driven test
  2. In the spec table provide pipe symbol (|) Ex:
  • And the JSON Path Assertions for the response should be equal to the following
    JSON Path Value
    $.message error.validation
    $.description null
    $.fieldErrors[0].objectName
    $.fieldErrors[0].field question.media
    $.fieldErrors[0].message must match \"TEXT
  1. Try to run
  2. It will only take the string before the pipe symbol.

Gauge version

Gauge version: 0.9. Commit Hash: 724e6d

Plugins

csharp (0.10.1) flash (0.0.1) html-report (4.0.2) java (0.6.5) ruby (0.4.2) screenshot (0.0.1) spectacle (0.1.2) xml-report (0.2.0)

osandadeshan avatar Nov 30 '17 09:11 osandadeshan

Can you try changing that line to

|$.fieldErrors[0].message |must match "TEXT \|HTML \|IMAGE \|VIDEO \|AUDIO"    |

zabil avatar Nov 30 '17 10:11 zabil

Escape character will solve this problem. However formatting the spec removes the escape character - https://github.com/getgauge/gauge/issues/318. The problem will then re-occur.

sswaroopgupta avatar Dec 03 '17 00:12 sswaroopgupta