-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from getgauge/stringparameterconversion
Handle empty parameter conversion
- Loading branch information
Showing
8 changed files
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Parameters | ||
|
||
## Check parameter conversion | ||
|
||
* Trimmed " " is the same as "" | ||
|
||
## Custom Parameters in steps | ||
|
||
* This step uses a custom parameter of type Person and value "{\"name\":\"John\",\"age\":30}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as assert from "node:assert"; | ||
import type { Person } from "@lib/Person"; | ||
import { Step } from "gauge-ts"; | ||
|
||
export default class Parameter { | ||
@Step("Trimmed <original> is the same as <expected>") | ||
public async checkTrimmedWord(original: string, expected: string) { | ||
assert.strictEqual(original.trim(), expected); | ||
} | ||
|
||
@Step("This step uses a custom parameter of type Person and value <person>") | ||
public async validatePerson(person: Person) { | ||
assert.strictEqual(person.name, "John"); | ||
assert.strictEqual(person.age, 30); | ||
assert.ok(person.isAdult()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.