score:4
you should await the call inside the console.log:
test('', async (t) => {
console.log(await s.polyline.getattribute('points'));
}
or
test('', async (t) => {
console.log(await s.polyline.getattribute('points'));
}
score:1
i've managed to get it working with a utility function for the ones who are interested.
export function getpoints(object: selector) : promise<string> {
return object.getattribute('points');
}
this makes it easier and cleaner to work with the data.
import * as u from '../utilities/functions';
import * as s from '../utilities/selectors';
console.log(await u.getpoints( s.polyline ));
thanks for the help guys!
score:4
your getpointattribute
function returns the polylinedata
object that is an instance if the clientfunction type (which is, in turn, based on promises). that's why when you log u.getpointattribute()
, you get these messages. all you need to do is to use the await
keyword before calling the clientfunction. please see the following code:
const polylinedata = clientfunction(() => polyline().attributes, {
dependencies: { polyline }
});
await polylinedata();
refer to the following article to get more information https://devexpress.github.io/testcafe/documentation/test-api/obtaining-data-from-the-client/
i would also like to mention that you do not need to use async
in your getpointattribute
function.
Source: stackoverflow.com
Related Query
- How do i use/print the value inside a generic attribute in TestCafe
- how to capture the props value inside the event attribute function when use the map function on it
- how to print the elements value inside an object react using es6
- React - How to use the current state value as a variable so i can set as a index inside an array
- React - How to print the value of an input onChange inside the component
- How to use useState inside useEffect, accessing the updated useState value on component mount?
- How to use setState() in React to blank/clear the value of an array
- How to use router.replace inside the client side of your app?
- How to use setFieldValue and pass the value as props between components
- how to use useRef for the attribute htmlFor?
- Next.js - How to add a <link> tag inside the <head> with literal onload attribute string value?
- How to use the updated value in redux store immediately after the action is dispatched in react js functional components
- How does s% reference the title attribute inside the Helmet component?
- How can you use the 'this' keyword inside of a function signature to set a default parameter?
- How to use the global data from React inside Apollo client's initialization?
- how to use fresh state inside the useeffect, but execute cleanup on unmount only
- How to use the :first-of-type rule inside a styled-components/emotion partial?
- How to get value from useState inside the function
- How can i use the value that is been returned by my reducer
- How should i get the value from custom attribute in react element?
- how could i return the value inside of a foreach javascript
- How i can use the handleSubmit inside my component?
- How do I use the spread operator to update a state value in React?
- How to use setState to update the property of an object inside an array the right way in class component?
- Recharts: how is it possible to show only the value of ONE data point inside a Tooltip?
- How to fix the error "react use hook cannot be called inside a callback function" using react?
- How to show a certain value inside the input tag in reactjs?
- How to Use State inside the function in React JS?
- How to use the imported image in React within a function inside a class?
- How do I pass up the value inside of react-autosuggest to the parent component?
More Query from same tag
- Unable to find an element with the text: "myText" error when using react-testing-library
- prevent render attempt if item not loaded from state yet
- AFC Repeater and wp-rest api in React.js
- Check type of React component
- React setting state inside List of list on a const instead of a state
- Jquery to React js
- Data becomes undefined in usequery of apollo client only when refreshing the page in the browser
- Typescript Error: Type '{ props: IDrink; }' is not assignable to type 'IntrinsicAttributes & IDrink'
- Firebase React Binding
- Why does my Auth.currentAuthenticatedUser() method return updated state after I reload and not when the useEffect's dependency runs (or login/logout)?
- Props received after api hit in Redux loading two times results in React Hooks
- how to map a new post in react with axios?
- react leaflet -layer control -satellite view
- How to type a custom pilet api?
- Diferrence between running a function and call a function that return a function
- React tabulator ref becomes null on rerendering
- react hook form's getValues() returning undefined
- Navigate to anther component while on-form submit and passing the data to navigating component react Js
- Duplicate object on array when using .forEach
- Push and join methods dont work correctly
- Why is myreact component not displaying on mobile
- "setProps()" not triggering "useEffect" in Jest
- I am making a CRUD web application in React using axios. I'm getting the following error: "TypeError: Object(...) is not a function"
- Webpack and programmatically injected content scripts
- Rendering external HTML/React components dynamically in React
- Styling the disabled option in react-select
- Is this a good way to pass props to child component in React?
- Images always appear broken when using webpack react
- Function inside function in react.js
- How to remove one specific query parameter from URL in Next.js?