-
-
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.
refactor(queries): modularize last from element
- Loading branch information
1 parent
6476752
commit 6c4be41
Showing
3 changed files
with
38 additions
and
34 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
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,37 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor'; | ||
|
||
import { getCypressElement, setCypressElement } from '../utils'; | ||
|
||
/** | ||
* When I get last element: | ||
* | ||
* ```gherkin | ||
* When I get last element | ||
* ``` | ||
* | ||
* @example | ||
* | ||
* ```gherkin | ||
* When I get last element | ||
* ``` | ||
* | ||
* @remarks | ||
* | ||
* This follows steps like {@link When_I_find_links_by_text | "When I find links by text"} and precedes steps like {@link When_I_click | "When I click"}. For example: | ||
* | ||
* ```gherkin | ||
* When I find links by text "Link" | ||
* And I get last element | ||
* And I click | ||
* ``` | ||
* | ||
* @see | ||
* | ||
* - {@link When_I_get_nth_element | When I get nth element} | ||
* - {@link When_I_get_first_element | When I get first element} | ||
*/ | ||
export function When_I_get_last_element() { | ||
setCypressElement(getCypressElement().last()); | ||
} | ||
|
||
When('I get last element', When_I_get_last_element); |