Testcafe react selector
vvedachalam opened this issue · 4 comments
Until I use TestCafe Selector to pick the web elements, it was working fine. After I changed to ReactSelector, and I use .with({ boundTestRun: testController }), it throws error saying CONST.with is not a function
Using TestCafe selector:
import { Role, Selector} from 'testcafe'
import { testController } from '../../support/testControllerHolder'
const CONTINUEBUTTON = 'div.eOiKsB button';
export class cPage{
getCButton(){
return Selector(CONTINUEBUTTON).with({ boundTestRun: testController });
}
}
IF I USE ReactSelector:
import { testController } from '../../support/testControllerHolder'
import {waitForReact, ReactSelector} from 'testcafe-react-selectors';
const CBUTTON=ReactSelector('RaisedButton');
export class cPage{
getCButton(){
return CBUTTON.with({ boundTestRun: testController });
}
}
Step Definition file:
Then(/^continue button is enabled$/, async() => {
await testController.expect(sitepage.getCButton().hasAttribute('disabled')).notOk();
})
When I used TestCafe-react-selector:
TypeError: CBUTTON.with is not a function
- When I change the pageObject code to:
import { testController } from '../../support/testControllerHolder'
import {waitForReact, ReactSelector} from 'testcafe-react-selectors';
const CBUTTON='RaisedButton';
export class cPage{
getCButton(){
return ReactSelector(CBUTTON).with({ boundTestRun: testController });
}
}
I get the following error:
TypeError: testcafe_react_selectors_1.ReactSelector(...).with is not a function
The issue 2 was captured already : #99
But this workaround is not working for me (NativeReactSelector is not recognised)
Hi @vvedachalam,
I've created a new issue in the testcafe repo - DevExpress/testcafe#2548.
You can track it to be informed of our progress.
Thanks @kirovboris. I will keep an eye
is the above issue fixed ?
That issue is not addressed yet.