본문 바로가기

2. Automation/2.6 Detox

iOS typeText() TextInput 필드에 텍스트를 입력하기 위해 쓰는 typeText 는 Simulator에서 키패드가 출력되어야함.await element(by.id(TestIds.browseView.searchTextFiled)).typeText(`bart\n`); Simulator keyboard toggle 사용 하기 Simulator > Hardware 메뉴 > Keyboard > Toggle Software Keyboard를 선택. 추가적으로 Use the Same keyboard Language as macOS를 킬 경우, 내가 테스트로 입력해야되는 단어 또는 문장이 영어인데, macOS가 한글 키보드 사용중이라, Simulator 의 키보드도 한글로 출력되어 입력이 실패될 가능성이 높음. 추가적으로,Tex.. 더보기
Detox iOS System Pop up Control Detox에서 Inspector가 되지 않는 Button 컨트를을 하려면, Xcode 에서 Debug View Hierarchy를 조회하여, 제어해야 한다. 이후 by.type 으로 제어하면 됨. 특히나 React-navigation 등의 뒤로가기 버튼을 제어할 때도 해당 방법으로 적용해야 함.await element(by.type('_UIButtonBarButton')).tap(); 더보기
Detox react-native automation testing framework E2E (end to end) 테스트를 지원하는 React Native Javascript test framework. React Native이다보니 당연히 cross-platform을 지원함. 아래 예제 코드를 보아하니 Jasmine과 유사 ㅎ예제 코드describe('Login flow', () => { it('should login successfully', async () => { await device.reloadReactNative(); await expect(element(by.id('email'))).toBeVisible(); await element(by.id('email')).typeText('john@example.com'); await element(by.id('password')).. 더보기