Skip to content
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

Merged
merged 4 commits into from
Mar 21, 2017

Conversation

VasilyStrelyaev
Copy link
Contributor

\cc @DevExpress/testcafe-docs


```js
const myTable = Selector('.my-table').addCustomMethods({
getCellText: (table, rowIndex, columnIndex) => {
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Contributor

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

@testcafe-build-bot
Copy link
Collaborator

❌ Tests for the commit 8e27982 have failed. See details.

}
});

await myTable.getCellText(2,5);
Copy link
Contributor

@inikulin inikulin Mar 20, 2017

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

@VasilyStrelyaev
Copy link
Contributor Author

FPR

Copy link
Contributor

@inikulin inikulin left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extending selectors maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

Copy link
Contributor

@inikulin inikulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@inikulin inikulin merged commit 21321c4 into DevExpress:master Mar 21, 2017
@VasilyStrelyaev VasilyStrelyaev deleted the add-custom-methods branch March 21, 2017 13:37
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this pull request Dec 18, 2019
* [docs] Describe adding custom methods to selector

* Add assertion to an example

* Use arrow function in an example

* Change section name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants