Get help with testing, discuss unit testing strategies etc.


Post by nuridesengin »

Hello there,

During UI test I got a lot of WARN on console during clicking a checkbox on grid. I cannot set different id for each element so I need to ignore those WARN messages. Is this possible somehow? Here is CLI results;
Testing Grid: Edit button, Menu button, Scrolling left > right, Clicking/selecting random row/cell
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component
    [WARN] # Your component query: ">> button[itemId=editBtn]" returned more than 1 component

Post by nickolay »

Hi,

That indicates the test is fragile and only works by luck. The component you are targeting happens to be the 1st one in the list of similar ones. Strongly recommended to make the query more specific to target only 1 component.

If you feel you want to disable it anyway, you can do that by modifying source code in the "siesta-all.js"

Here's the relevant place:
                    var text        = R.get('multipleComponentMatch').replace('{component}', component);

                    if (this.harness.failOnMultipleComponentMatches) {
                        this.fail(text);
                    } else {
                        this.warn(text);
                    }
(Need to comment out the "warn")

Post by nuridesengin »

well followed your advice and tried to improve query for editBtn. Hopefully will work better =)

Thanks for advice.

Post Reply