-
Notifications
You must be signed in to change notification settings - Fork 476
tests: Setup E2E #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tests: Setup E2E #979
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7b20889
initial appium setup
18528cb
appium setup + android test
4dcbdf8
ios
12459aa
ios working
b79001b
run e2e
6090983
wdio runner
9035c87
disable e2e on ci
a35be43
docs
1299309
last touches
1246fa5
last touches for real
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Install JS dependencies | ||
run: yarn | ||
|
@@ -32,17 +32,21 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Install JS dependencies | ||
run: | | ||
yarn | ||
- name: Test Next Storage | ||
uses: gradle/gradle-build-action@v2.4.2 | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: wrapper | ||
arguments: react-native-async-storage_async-storage:test | ||
build-root-directory: example/android | ||
- name: Build e2e binary | ||
run: | | ||
yarn build:e2e:android | ||
|
||
ios: | ||
name: iOS | ||
runs-on: macos-latest | ||
|
@@ -58,32 +62,22 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Set up environment | ||
run: | | ||
brew bundle --file=.github/Brewfile.ios --no-lock | ||
touch .watchmanconfig | ||
- name: Install JS dependencies | ||
run: | | ||
yarn | ||
- name: Bundle JS | ||
run: | | ||
yarn bundle:ios --dev false | ||
yarn bundle:ios | ||
- name: Install Pods | ||
run: | | ||
RCT_NEW_ARCH_ENABLED=1 pod install | ||
working-directory: example/ios | ||
- name: Boot simulator | ||
run: | | ||
./scripts/ios_e2e.sh 'run_simulator' | ||
- name: Build | ||
- name: Build e2e binary | ||
run: | | ||
yarn build:e2e:ios | ||
- name: Test | ||
if: false | ||
run: | | ||
yarn test:e2e:ios | ||
|
||
macos: | ||
name: macOS | ||
runs-on: macos-latest | ||
|
@@ -99,7 +93,7 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Install JS dependencies | ||
run: | | ||
|
@@ -118,6 +112,7 @@ jobs: | |
if: false | ||
run: | | ||
yarn test:e2e:macos | ||
|
||
windows: | ||
name: Windows | ||
runs-on: windows-2022 | ||
|
@@ -131,7 +126,7 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Install JS dependencies | ||
run: | | ||
|
@@ -142,6 +137,7 @@ jobs: | |
- name: Build | ||
run: | | ||
yarn react-native run-windows --release --arch x64 --logging --no-packager --no-launch --no-deploy --msbuildprops "BundleEntryFile=index.ts" --no-telemetry | ||
|
||
release: | ||
name: Release | ||
needs: [review, android, ios, macos, windows] | ||
|
@@ -155,7 +151,7 @@ jobs: | |
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
node-version: 18.16.1 | ||
cache: yarn | ||
- name: Install JS dependencies | ||
run: | | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { config as commonConfig } from './common.conf'; | ||
|
||
export const config: WebdriverIO.Config = { | ||
...commonConfig, | ||
capabilities: [ | ||
{ | ||
platformName: 'Android', | ||
maxInstances: 1, | ||
'appium:deviceName': 'Android Emulator', | ||
'appium:app': | ||
'example/android/app/build/outputs/apk/release/app-release.apk', | ||
'appium:automationName': 'UiAutomator2', | ||
'appium:newCommandTimeout': 240, | ||
'appium:appWaitActivity': | ||
'com.microsoft.reacttestapp.component.ComponentActivity', | ||
}, | ||
], | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { commands as cmd } from './commands'; | ||
import testCases from '../examples/tests'; | ||
|
||
describe('Async Storage functional tests', () => { | ||
it('should be visible', async () => { | ||
// wait until content loads, as android's waitForSelectorTimeout setting does not seem to work | ||
await new Promise((r) => setTimeout(r, 3000)); | ||
const el = await cmd.elementByLabel('functional-view'); | ||
await expect(await el.isExisting()).toEqual(true); | ||
}); | ||
|
||
const testNames = Object.keys(testCases); | ||
describe('storing / reading values', () => { | ||
for (const name of testNames) { | ||
it(`${name}`, async () => { | ||
const el = await cmd.elementByLabel(`test:${name}`); | ||
await expect(await el.getText()).toEqual('Pass'); | ||
}); | ||
} | ||
}); | ||
|
||
describe('storing / reading values with delegate', () => { | ||
for (const currentName of testNames) { | ||
const name = currentName + ' with delegate'; | ||
it(`${name}`, async () => { | ||
krizzu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const el = await cmd.elementByLabel(`test:${name}`); | ||
const label = await el.getText(); | ||
if (label === 'Skip') { | ||
return; | ||
} | ||
|
||
expect(label).toEqual('Pass'); | ||
}); | ||
} | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const testAppId = 'com.microsoft.ReactTestApp'; | ||
import { browser } from '@wdio/globals'; | ||
|
||
export const commands = { | ||
restartApp: async () => { | ||
await browser.terminateApp(testAppId); | ||
await browser.activateApp(testAppId); | ||
}, | ||
elementByLabel: async (id: string) => await $(`~${id}`), | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.