1

I have an element like <span class="percent-complete-bar" style="width: 85%; background: green;"></span> and I want to check if the style attribute contains width: xx%; with a regex like r'width: \d{1,3}%;'

await bar.attributes['style']

returns width: 85%; background: green;

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567

1 Answers1

2
expect(await bar.attributes['style'], matches(r'width: \d{1,3}%;'));
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567