Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszm22 committed Jan 2, 2023
1 parent bc70302 commit d1a238f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
3 changes: 3 additions & 0 deletions packages/rn-tester-e2e/README-addTestAndExecute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester-e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand Down
17 changes: 8 additions & 9 deletions packages/rn-tester-e2e/e2e-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
};
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester-e2e/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { beforeEach, afterEach, jest } from '@jest/globals';


jest.setTimeout(40000);
jest.retryTimes(2);
jest.retryTimes(3);

let driver;
const config = {
Expand Down
4 changes: 2 additions & 2 deletions packages/rn-tester-e2e/test/specs/buttonCancel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
6 changes: 3 additions & 3 deletions packages/rn-tester-e2e/test/specs/buttonSubmit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});

0 comments on commit d1a238f

Please sign in to comment.