-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Describe adding custom methods to selector #1333
[docs] Describe adding custom methods to selector #1333
Conversation
|
||
```js | ||
const myTable = Selector('.my-table').addCustomMethods({ | ||
getCellText: (table, rowIndex, columnIndex) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCellText: (table, rowIndex, columnIndex) => table.rows[rowIndex].cells[columnIndex].innerText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like horizontal scroll bars below the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can start it from new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCellText: (table, rowIndex, columnIndex) =>
table.rows[rowIndex].cells[columnIndex].innerText
I like it more
} | ||
}); | ||
|
||
await myTable.getCellText(2,5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to show usage of that in assertions
FPR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\r-
@@ -38,7 +38,9 @@ This topic contains the following sections. | |||
* [Define Action Targets](#define-action-targets) | |||
* [Define Assertion Actual Value](#define-assertion-actual-value) | |||
* [Selector Timeout](#selector-timeout) | |||
* [Adding Custom Properties to Element State](#adding-custom-properties-to-element-state) | |||
* [Adding Custom Properties and Methods to the Element State](#adding-custom-properties-and-methods-to-the-element-state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extending selectors
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* [docs] Describe adding custom methods to selector * Add assertion to an example * Use arrow function in an example * Change section name
\cc @DevExpress/testcafe-docs