YJ.Kim
YJ.Kim

Reputation: 21

How can I select & filtering using webdriverio.react$$

I am new webdriverio and react. I am learning a look at the official documentation the following. https://webdriver.io/docs/api/browser/react$$.html

it('should calculate 7 * 6', () => {
    browser.url('https://ahfarmer.github.io/calculator/');

    const orangeButtons = browser.react$$('t', {
        props: { orange: true }
    })
    console.log(orangeButtons.map((btn) => btn.getText())); // prints "[ '÷', 'x', '-', '+', '=' ]"
});

But I could not understand the selector of 't'. What is the 't'?

It seems that there is no 't' tag in target html. https://ahfarmer.github.io/calculator/

Also I tried to select orange buttons as the following.

console.log(browser.react$$('Button',{
  props: { orange: true }
}).map((obj) => obj.getText()));

But it was not worked.

How can I select using tag name "Button"?

Thank you in advance.

Upvotes: 0

Views: 800

Answers (1)

YJ.Kim
YJ.Kim

Reputation: 21

I resolved it myself.

Because it's getting minified.

https://github.com/facebook/react-devtools/issues/239

Upvotes: 1

Related Questions