Skip to content
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

Revert "Include UI tests for blocks with Appium" #803

Merged
merged 1 commit into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 3 additions & 118 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,15 @@ commands:
- restore_cache:
name: Restore Yarn Cache
keys:
- yarn-v2-{{ arch }}-{{ checksum "yarn.lock" }}
- yarn-{{ checksum "yarn.lock" }}
- run:
name: Yarn Install
command: YARN_CACHE_FOLDER=~/.cache/yarn yarn install --frozen-lockfile
command: yarn install --frozen-lockfile
- save_cache:
name: Save Yarn Cache
key: yarn-v2-{{ arch }}-{{ checksum "yarn.lock" }}
key: yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
build-android:
steps:
- run:
name: Change initial HTML file
command: |
cp ./bin/tmp/initial-device-tests-html.js ./src/app/initial-html.js
- run:
name: Bundle Debug android
command: yarn bundle:android:test
- run:
name: Gradle assemble debug android apk
command: |
cd android
./gradlew clean
./gradlew assembleDebug
build-ios:
steps:
- run:
name: Change initial HTML file
command: |
cp ./bin/tmp/initial-device-tests-html.js ./src/app/initial-html.js
- run:
name: Bundle iOS
command: |
yarn bundle:ios:test
- run:
name: Generate .app file
command: |
set +e
yarn react-native run-ios --configuration Release

jobs:
checks:
Expand Down Expand Up @@ -77,87 +47,6 @@ jobs:
- run:
name: Run Checks
command: bin/ci-checks-js.sh
android-device-checks:
docker:
- image: circleci/android:api-27-node8-alpha
steps:
- checkout
- run:
name: Checkout Gutenberg
command: |
git submodule init
git submodule update --recursive
- yarn-install
- run:
name: Accept Licenses
command: |
yes | sdkmanager --licenses > /dev/null
sleep 10
sdkmanager --update
background: true
- run:
name: Set Environment Variables
command: |
echo 'export TEST_RN_PLATFORM=android' >> $BASH_ENV
echo 'export TEST_ENV=sauce' >> $BASH_ENV
- build-android
- run:
name: Upload apk to sauce labs
command: |
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg.apk?overwrite=true --data-binary @./android/app/build/outputs/apk/debug/app-debug.apk
- run:
name: Run Device Tests
command: yarn device-tests
ios-device-checks:
macos:
xcode: "10.0"
steps:
- checkout
- run:
name: Checkout Gutenberg
command: |
git submodule init
git submodule update --recursive
- run: yarn clean:install
- run:
name: Set Environment Variables
command: |
echo 'export TEST_RN_PLATFORM=ios' >> $BASH_ENV
echo 'export TEST_ENV=sauce' >> $BASH_ENV
- restore_cache:
name: Restore Dependencies Cache
keys:
- dependencies-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
checksum "yarn.lock" }}
- dependencies-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}
- dependencies-
- run:
name: Yarn preios
command: yarn preios
- save_cache:
name: Save Dependencies Cache
key: dependencies-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
checksum "yarn.lock" }}
paths:
- react-native-aztec/ios/Carthage
- ~/.rncache
- build-ios
- run:
name: Zip up .app file
command: |
cp ./ios/main.jsbundle ./ios/build/Gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/main.jsbundle
cd ./ios/build/Gutenberg/Build/Products/Release-iphonesimulator/
zip -r ./Gutenberg.app.zip ./gutenberg.app
mv ./Gutenberg.app.zip ../../../../../../Gutenberg.app.zip
cd ../../../../../../
- run:
name: Upload .app to sauce labs
command: |
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg.app.zip?overwrite=true --data-binary @./Gutenberg.app.zip
- run:
name: Run Device Tests
command: |
yarn device-tests

workflows:
gutenberg-mobile:
Expand All @@ -173,7 +62,3 @@ workflows:
name: Test Android
platform: android
check-tests: true
- ios-device-checks:
name: Test iOS on Device
- android-device-checks:
name: Test Android on Device
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ yarn-error.log*
*.apk
*.ap_
.gradle/
android/app/src/main/assets/

# files for the dex VM
*.dex
Expand Down Expand Up @@ -96,8 +95,4 @@ buck-out/
!.vscode/extensions.json

*.pot

# e2e output log
appium-out.log

bin/wp-cli.phar
bin/wp-cli.phar
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,6 @@ Then, open `chrome://inspect` in Chrome to attach the debugger (look into the "R

This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test.js` extension to have the files loaded by jest. See an example test [here](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/app/App.test.js). The [jest documentation](https://facebook.github.io/jest/docs/en/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/en/tutorial-react-native.html).

## UI Tests

This repository uses appium to run UI tests. The tests live in `__device-tests__` and are written using Appium to run tests against simulators and real devices. To run these you'll need to check off a few things:

* For now you'll need run `yarn start`, and then either `yarn ios` or `yarn android` at least once before trying to run the tests on the respective platform
* [Appium cli](https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md) installed and available globally, I'd also recommend using [appium doctor](https://github.com/appium/appium-doctor) to ensure all of appium's dependencies are good to go. You don't have to worry about starting the server yourself, the tests handle starting the server on port 4728, just be sure that the port is free or feel free to change the port number in the test file.
* For iOS a simulator should automatically launch but for Android you'll need to have an emulator fired up and running.

After those are checked off to run the UI tests on ios run

`yarn test:ui:ios`

and for android run,

`yarn test:ui:android`

Alternatively if you're experiencing problems that seem to be related to the tests starting the appium server, for example errors that say `Connection Refused`, `Connection Reset` or `The requested environment is not available`. Sorry about that this is still a WIP, you can manually start the appium server via [appium desktop](https://github.com/appium/appium-desktop) or the cli, then change the port number in the tests while commenting out the `beforeAll` and `afterAll` block.

## Static analysis and code style

Expand Down
73 changes: 0 additions & 73 deletions __device-tests__/blocks/block-interaction.js

This file was deleted.

56 changes: 0 additions & 56 deletions __device-tests__/blocks/paragraph-block-interaction.js

This file was deleted.

74 changes: 0 additions & 74 deletions __device-tests__/gutenberg-editor.test.js

This file was deleted.

Loading