jeudi 24 janvier 2019

How do i use/print the value inside a generic attribute in TestCafe

What I'm trying to do is print/use the value of the Polyline object.

<Polyline points="x,y x,y x,y x,y">

I've tried to get them with these methods:

This is util function

export const getPointAttribute = async () => {
  const polyline = s.polyline;
  const polylineData = ClientFunction(() => polyline().attributes, {
    dependencies: { polyline }
  });
  return polylineData 
}

This is inside the test script

test('', async (t) => {
   console.log(u.getPointAttribute())
}

or

test('', async (t) => {
   console.log(s.polyline.getAttribute('points'));
}

And I include my selectors external

import * as s from '../utilities/selectors';

Any help is appreciated!

Aucun commentaire:

Enregistrer un commentaire