Code Monkey home page Code Monkey logo

react-native-e2etest's People

Contributors

gantman avatar garthenweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-e2etest's Issues

How to disable the send notification pop up

I am following this tutorial to create a e2e test automation for my mobile app
However, every time I launch the iOS simulator, it will have a send notification popup

How do I get rid of this notification in my test code? I used device.launchApp with notifications YES does not work at all.

my code snippet:describe('Login Test', () => {

beforeAll(async () => {

try {

await driver.init(config, {launchApp: false});

await driver.sleep(2000);

await device.launchApp({permissions: {

notifications: 'YES'}});

} catch(err)

{

console.log(err);

}

});

node_modules/vargs/lib/vargs.js: arguments is a reserved word in strict mode (24:37

Thank you for putting this together. I was able to get it working based when directly cloning it but when I started trying to integrate it into my project I see the following error

 FAIL  __tests__/basic.e2e.js
  ● Test suite failed to run

/Repos/spoon/node_modules/vargs/lib/vargs.js: arguments is a reserved word in strict mode (24:37)
        22 | //   }
        23 | //
      > 24 | exports.Constructor = function Vargs(arguments) {
           |                                      ^
        25 |     this.array = Array.prototype.slice.call(arguments);
        26 |     this.__defineGetter__('length', function () {
        27 |         if (this.callbackGiven()) {

I know it's tangential to the project but I thought I'd ask if anything jumps out at you? It looks like vargs is an 8 year old dependency of the wd package, did you run into anything like this? I have a feeling it might have something to do with my babel settings.

Docs don't mention npm install

Its pretty obvious to most people, like myself that you need to run 'npm install' before you try to assemble the android app but you might want to mention it in the setup section of your app.

The error you get from gradle tells you there's a build tools issue but thats not the case at all.

Scroll Action

I'm writing an automation code using Appium fro react native application. Firstly can able to perform click action. Further, I need to find the element and click which is maybe on next screen, for this, I need to perform click action till I find that element.
Which method do I need to use, Do I need to set accessibility label for screen also?

can't find UI element using hasElementByAccessibilityId

import wd from 'wd';
import config from '../e2e-config';

const port = 4723;
const driver = wd.promiseChainRemote('localhost', port);
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;

describe('Login Test', () => {
// beforeAll(async () => await driver.init(config));
// afterAll(async () => await driver.quit());
beforeAll(async () => {
await driver.init(config);

 });

it('find the user login fields', async() => {
expect(await driver.hasElementByAccessibilityId('textUserName')).toBe(true);
});

I got this when I run
npm run test:e2e:ios

however this UI element is visible and I have attached a accessibilityLabel to it.
what could have caused this failure?

jest --testMatch="/tests//*e2e.js"

FAIL tests/login.e2e.js (10.889s)
Login Test
✕ find the user login fields (902ms)

● Login Test › find the user login fields

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

  18 |  
  19 |    it('find the user login fields', async() => {
> 20 |      expect(await driver.hasElementByAccessibilityId('textUserName')).toBe(true);
     |                                                                      

Appium in multi screen

Hi, Thanks for your information about appium.
I want to ask you something. Lets say I have 2 screens, Login Screen and Home Screen. Login Screen will loaded first then Home Screen
In Login screen I have accessibilityLabel fieldEmail and buttonLogin. In Home Screen I have accessibilityLabel buttonHome.
How to tell appium, we need access buttonHome when Home Screen loaded?

This is my code

/* eslint-disable no-undef */
import wd from 'wd'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000
const PORT = 4723
const config = {
  platformName: 'Android',
  deviceName: 'Pixel 3a XL API 29',
  app: '/Users/gandahalojasa/Documents/Project/Learn/Appium_React_Native/android/app/build/outputs/apk/debug/app-debug.apk'
}
const driver = wd.promiseChainRemote('localhost', PORT)

beforeAll(async () => {
  await driver.init(config)
  await driver.sleep(4000)
}) // Sometime for the app to load

test('login screen test', async () => {
  expect(await driver.hasElementByAccessibilityId('fieldEmail')).toBe(true)
  await driver.elementByAccessibilityId('fieldEmail').type('[email protected]')
  expect(await driver.hasElementByAccessibilityId('buttonLogin')).toBe(true)
  const element = await driver.elementByAccessibilityId('buttonLogin')
  await element.click()
  expect(await driver.hasElementByAccessibilityId('notHere')).toBe(false)
})

test('home screen test', async () => {
  expect(await driver.hasElementByAccessibilityId('buttonHome')).toBe(true)
  const element = await driver.elementByAccessibilityId('buttonHome')
  await element.click()
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.