CodeceptJS
CodeceptJS copied to clipboard
So many methods not working with a React Locator.
What are you trying to achieve?
Seems like react locators only work fine with I.click and I.seeElement. I get different errors when using other methods like waitForVisible, waitForElement, moveCursorTo, focus, scrollTo whenever I pass a react locator.
How to reproduce
There is this file called react_test.js in codecept's repo at location examples\react_test.js. Just change the content and use any of above methods.
Example change the code to below code
Feature('React Apps');
Data([{ a: 1, toString: () => 'a' }, { b: 2, toString: () => 'b' }]).Scenario('try react app', ({ I }) => {
I.amOnPage('https://codecept.io/test-react-calculator/');
I.click('7');
I.waitForVisible({ react: 't', props: { name: '5' } });
I.seeElement({ react: 't', props: { name: '5' } });
I.click('button', { react: 't', props: { name: '2' } });
I.click('button', { react: 't', props: { name: '+' } });
I.click('button', { react: 't', props: { name: '9' } });
I.click('button', { react: 't', props: { name: '=' } });
I.seeElement({ react: 't', props: { value: '81' } });
});
Getting this error with above code
Different methods throw different errors.
Details
- CodeceptJS version: 3.5.14
- NodeJS Version: v18.13.0
- Operating System: Windows
- playwright
This issue is stale because it has been open for 90 days with no activity.