Protractor for React Applications
Hi,
Can I use Protractor with Jasmine for testing React applications(Widget based application). will it be difficult to maintain protractors test for long run projects?
Thanks, Mangesh
You can do it for sure. Just don't wait for Angular add in protractor config in the onPrepare block:
onPrepare: async () => {
...
await browser.waitForAngularEnabled(false);
...
}
Thank you
sort of specific question better to ask on Stack Overflow.
Can anyone share basic protractor - Cucumber BDD framework for React application
@mangeshkhaire14,
You can try out Protractor-React-Selector!
protractor-react-selector is a lightweight plugin to help you to locate web elements in your REACT app using props and states.
You need to use React Dev Tool to identify the component names in that case.
Here is an example:
Suppose your react app:
const MyComponent = ({ someBooleanProp }) => (
<div>My Component {someBooleanProp ? 'show this' : ''} </div>
)
const App = () => (
<div id='root'>
<MyComponent />
<MyComponent someBooleanProp={true} />
</div>
)
ReactDOM.render(<App />, document.getElementById('root'))
Then you can simply identify the react element like:
element(by.react('MyComponent', { someBooleanProp: true }))
If you want to check out some amazing examples, visit here
Hope it will help!