-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(assertions): add "Then I see hash" and "Then I see hash contains"
- Loading branch information
1 parent
a336ace
commit 87adae3
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Then } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
/** | ||
* Then I see hash: | ||
* | ||
* ```gherkin | ||
* Then I see hash {string} | ||
* ``` | ||
* | ||
* @example | ||
* | ||
* ```gherkin | ||
* Then I see hash "#hash" | ||
* ``` | ||
* | ||
* @remarks | ||
* | ||
* The URL hash includes the `#` character. | ||
* | ||
* @see | ||
* | ||
* - {@link Then_I_see_hash_contains | Then I see hash contains} | ||
*/ | ||
export function Then_I_see_hash(hash: string) { | ||
cy.hash().should('equal', hash); | ||
} | ||
|
||
Then('I see hash {string}', Then_I_see_hash); | ||
|
||
/** | ||
* Then I see hash contains: | ||
* | ||
* ```gherkin | ||
* Then I see hash contains {string} | ||
* ``` | ||
* | ||
* @example | ||
* | ||
* ```gherkin | ||
* Then I see hash contains "hash" | ||
* ``` | ||
* | ||
* @see | ||
* | ||
* - {@link Then_I_see_hash | Then I see hash} | ||
*/ | ||
export function Then_I_see_hash_contains(hash: string) { | ||
cy.hash().should('contain', hash); | ||
} | ||
|
||
Then('I see hash contains {string}', Then_I_see_hash_contains); |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './hash'; | ||
export * from './text'; | ||
export * from './url'; |