rquellh / testcafe-cucumber

Integration of TestCafe and CucumberJS
MIT License
95 stars 59 forks source link

Help with verifying the list row values #32

Closed praveenpl closed 5 years ago

praveenpl commented 5 years ago

I am using the testcafe with cucumber. I have the following list row values as shown in the image and I need to verify the values shown in the list as per the expected text. Screen Shot 2019-11-04 at 10 52 20 am

I am trying with below code where data is passed from the feature file,

for(let i = 0 ; i < 3 ; i++){         
        const fieldName = Selector("div.nba-meta-action>div.nba-row>div.nba-row-left").with({ boundTestRun: testController }).withText(data[i].field);
        testController.expect(fieldName.exists).ok();
        const fieldValue = Selector("div.nba-meta-action>div.nba-row>div.nba-row-right").with({ boundTestRun: testController }).withText(data[i].value);
        testController.expect(fieldValue.exists).ok();
    }

I get error as "errMsg: 'AssertionError: expected false to be truthy'".

Can someone please help here.

Thanks

praveenpl commented 5 years ago

I was able to get this working. I later found out that, need to switch to iframe before looking for the text.