-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(examples): add an example of docstring usage
shows how to use docstrings, also fixes the custom param example re #64
- Loading branch information
Arthur Warnier
committed
Jan 7, 2022
1 parent
06e3ed8
commit 175925c
Showing
4 changed files
with
24 additions
and
1 deletion.
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,12 @@ | ||
Feature: Doc string feature | ||
|
||
I want to use a doc string in my test | ||
|
||
Scenario: Asserting page subtitle | ||
Given I opened TestCafe demo page | ||
Then I should see the following page subtitle | ||
""" | ||
This webpage is used as a sample in TestCafe tutorials. | ||
""" | ||
|
||
# this only works for v5.0.0 or above |
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,10 @@ | ||
import { Given, Then } from '@cucumber/cucumber'; | ||
import { Selector } from 'testcafe'; | ||
|
||
Given('I opened TestCafe demo page', async (t) => { | ||
await t.navigateTo('https://devexpress.github.io/testcafe/example/'); | ||
}); | ||
|
||
Then('I should see the following page subtitle', async (t, [], _, docString) => { | ||
await t.expect(Selector('header > p').textContent).contains(docString); | ||
}); |
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