react-native-webview.git

123456789101112131415161718192021222324252627
  1. // import {Platform} from 'react-native';
  2. describe('WebView basic test', () => {
  3. beforeEach(async () => {
  4. await device.launchApp({newInstance: true});
  5. });
  6. it('should not have a redbox visible', async () => {
  7. // check iOS
  8. expect(element(by.type('RCTRedBox'))).toNotExist();
  9. // TODO: check Android
  10. });
  11. it('should have a webview', async () => {
  12. await expect(element(by.id('test_webview'))).toBeVisible();
  13. });
  14. it('should respond to injectJavaScript', async () => {
  15. const hello = await element(by.id('hello'));
  16. await expect(hello).toHaveText('No hello yet');
  17. await element(by.id('test_trigger_button')).tap();
  18. await waitFor(hello)
  19. .toHaveText('Hello from the webview!')
  20. .withTimeout(10000);
  21. });
  22. });