From d1a238f6977f86cd24bda800b55b95c3b2b59c5f Mon Sep 17 00:00:00 2001 From: Mateusz Michalec Date: Mon, 2 Jan 2023 13:17:35 +0100 Subject: [PATCH] fixes --- .../rn-tester-e2e/README-addTestAndExecute.md | 3 +++ packages/rn-tester-e2e/README.md | 4 ++-- packages/rn-tester-e2e/e2e-config.js | 17 ++++++++--------- packages/rn-tester-e2e/jest.setup.js | 2 +- .../test/specs/buttonCancel.test.js | 4 ++-- .../test/specs/buttonSubmit.test.js | 6 +++--- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/packages/rn-tester-e2e/README-addTestAndExecute.md b/packages/rn-tester-e2e/README-addTestAndExecute.md index f653fce5423682..9de25e2eb75f88 100644 --- a/packages/rn-tester-e2e/README-addTestAndExecute.md +++ b/packages/rn-tester-e2e/README-addTestAndExecute.md @@ -13,6 +13,9 @@ or 2. Open second terminal -> navigate to the react-native/packages/rn-tester-e2e -> MAKE SURE YOUR APPIUM HAS UIAUTOMATOR2 AND XCUITEST INSTALLED! type +>npm install appium@2.0.0-beta.40 -g +>appium driver install uiautomator2 +>appium driver install xcuitest >appium --base-path /wd/hub 3. Open third terminal -> navigate to the react-native/packages/rn-tester-e2e -> run all tests by typing >npm run ios diff --git a/packages/rn-tester-e2e/README.md b/packages/rn-tester-e2e/README.md index 49b51a3d2fcdfd..6d34416f6b848f 100644 --- a/packages/rn-tester-e2e/README.md +++ b/packages/rn-tester-e2e/README.md @@ -19,7 +19,7 @@ yarn clean-ios Build the app for not M1 mac user: 1. Install Bundler `gem install bundler`. We use bundler to install the right version of CocoaPods locally. -2. Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install` or `yarn setup-ios-hermes`. In order to use JSC instead of Hermes engine, run: `USE_HERMES=0 bundle exec pod install` or `yarn setup-ios-jsc` instead. +2. Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install` or `yarn setup-ios-hermes`. In order to use JSC instead of Hermes engine, run: `USE_HERMES=0 bundle exec pod install` or `` instead. 3. Open the generated `RNTesterPods.xcworkspace`. 4. Build the app. @@ -46,7 +46,7 @@ yarn start _Note: Building for the first time can take a while._ -Find the **RNTester.app** in `~/AndroidStudioProjects/{ProjectName}/app/build/intermediates/apk/debug/` and move the app to the following directory `/react-native/packages/rn-tester-e2e/apps` +Find the **RNTester.app** in `~/react-native/packages/rn-tester/android/app/build/outputs/apk/jsc/debug` and move the app to the following directory `/react-native/packages/rn-tester-e2e/apps` ## Usage diff --git a/packages/rn-tester-e2e/e2e-config.js b/packages/rn-tester-e2e/e2e-config.js index 334244960b1d72..429c1f366c9c5b 100644 --- a/packages/rn-tester-e2e/e2e-config.js +++ b/packages/rn-tester-e2e/e2e-config.js @@ -4,19 +4,18 @@ const path = require('path'); let capabilities; const android = { - platformName: 'Android', - platformVersion: '13.0', - deviceName: 'Pixel 6 API 33', - app: path.join(process.cwd(), '/apps/rn-tester.apk'), - automationName: 'UiAutomator2', - newCommandTimeout: 240, + 'platformName': 'Android', + 'appium:platformVersion': '13.0', + 'appium:deviceName': 'Pixel_3a_API_33_arm64-v8a', + 'appium:app': path.join(process.cwd(), '/apps/rn-tester.apk'), + 'appium:automationName': 'UiAutomator2', + 'appium:newCommandTimeout': 240, }; const ios = { 'platformName': 'iOS', - 'appium:platformVersion': '16.0', - 'appium:deviceName': 'iPhone 14 Pro Max', - //bundleId: 'org.reactjs.native.example.TestForE2E', + 'appium:platformVersion': '16.1', + 'appium:deviceName': 'iPhone 14 Pro', 'appium:automationName': 'XCUITest', 'appium:app': path.join(process.cwd(), '/apps/rn-tester.app'), }; diff --git a/packages/rn-tester-e2e/jest.setup.js b/packages/rn-tester-e2e/jest.setup.js index 25966ef58e2b23..f1a7446023aa62 100644 --- a/packages/rn-tester-e2e/jest.setup.js +++ b/packages/rn-tester-e2e/jest.setup.js @@ -4,7 +4,7 @@ import { beforeEach, afterEach, jest } from '@jest/globals'; jest.setTimeout(40000); -jest.retryTimes(2); +jest.retryTimes(3); let driver; const config = { diff --git a/packages/rn-tester-e2e/test/specs/buttonCancel.test.js b/packages/rn-tester-e2e/test/specs/buttonCancel.test.js index 1e49fd9589c72e..1f9328db1f34a9 100644 --- a/packages/rn-tester-e2e/test/specs/buttonCancel.test.js +++ b/packages/rn-tester-e2e/test/specs/buttonCancel.test.js @@ -7,7 +7,7 @@ describe('Test is checking cancel button', () => { expect(await componentsScreen.checkButtonComponentIsDisplayed()).toBeTruthy(); await componentsScreen.clickButtonComponent(); await buttonComponentScreen.clickCancelApplication(); - expect(await buttonComponentScreen.getAlertText()).toContain(cancelText); - await buttonComponentScreen.clikOKButton(); + expect(await buttonComponentScreen.getCancelAlertText()).toContain(cancelText); + await buttonComponentScreen.clickOkButton(); }); }); diff --git a/packages/rn-tester-e2e/test/specs/buttonSubmit.test.js b/packages/rn-tester-e2e/test/specs/buttonSubmit.test.js index 85a2d091ffe8fd..8f7f45d9f90d9c 100644 --- a/packages/rn-tester-e2e/test/specs/buttonSubmit.test.js +++ b/packages/rn-tester-e2e/test/specs/buttonSubmit.test.js @@ -7,7 +7,7 @@ describe('Test is checking submit button', () => { expect(await componentsScreen.checkButtonComponentIsDisplayed()).toBeTruthy(); await componentsScreen.clickButtonComponent(); await buttonComponentScreen.clickSubmitApplication(); - expect(await buttonComponentScreen.getAlertText()).toContain(submitText); - await buttonComponentScreen.clikOKButton(); + expect(await buttonComponentScreen.getSubmitAlertText()).toContain(submitText); + await buttonComponentScreen.clickOkButton(); }); -}); \ No newline at end of file +});