Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

iOS Smoke Test (e2e testing) #95

Merged
merged 6 commits into from
Jun 12, 2017
Merged

iOS Smoke Test (e2e testing) #95

merged 6 commits into from
Jun 12, 2017

Conversation

delianides
Copy link
Contributor

@delianides delianides commented Jun 4, 2017

A very basic PR for running detox with rock-native. Right now detox really doesn't like being run with anything less than 7.6 but we could push it through babel to get async/await support. I was able to get jest to connect with detox but was having issues with exports. detox.init is supposed to include the expectation library but since jest has its own which is also exported under expect it doesn't seem to work.

You can get this working with mocha by following these steps:

  • make sure you're running node 7.6 nvm use/install 7.6
  • install fbsimctl, brew tap facebook/fb
    export CODE_SIGNING_REQUIRED=NO && brew install fbsimctl --HEAD
  • run npm i to get mocha and detox
  • install the detox-cli tools npm install -g detox-cli
  • start the react-native server yarn start
  • start the graphql-lambda server yarn server
  • run detox build && detox test

I didn't have any issues running the project on 7.6.

Notes:

  • Follow detox#143 for more information on running jest with detox.
  • Initial android support was added as PR today with detox#148

@mention-bot
Copy link

@delianides, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jbaxleyiii, @JakeDawkins and @richarddubay to be potential reviewers.

@newspringweb
Copy link

newspringweb commented Jun 4, 2017

Warnings
⚠️

Please assign someone to merge this PR, and optionally include people who should review.

⚠️

No Changelog changes!

Generated by 🚫 dangerJS

@delianides
Copy link
Contributor Author

FYI these tests will probably fail on CI for right now.

Copy link
Member

@richarddubay richarddubay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got these tests to run locally. Also updated the snapshots. But the smoke tests fail on CI. I guess we'd need some work to make that happen.


describe("Rock Native End-to-End", () => {
beforeEach(async () => {
await device.reloadReactNative();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dang all of these globals suck

});

it('should tap increment', async () => {
await element(by.id('increment')).multiTap(2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is awesome

Copy link

@jbaxleyiii jbaxleyiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@delianides since jest won't work currently, can you setup npm scripts for running these tests? Add the needed dev deps like detox?

We should be able to tell jest to ignore these files until that PR for support is done.

Any idea what CI support looks like?

@delianides
Copy link
Contributor Author

@jbaxleyiii ...and tell jest to ignore the e2e/ directory?

@jbaxleyiii
Copy link

@delianides yep!

@codecov
Copy link

codecov bot commented Jun 8, 2017

Codecov Report

Merging #95 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #95   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files          32       32           
  Lines         179      179           
  Branches       17       17           
=======================================
  Hits          178      178           
  Misses          1        1
Impacted Files Coverage Δ
src/layouts/Horizontal/horizontal.native.js 100% <ø> (ø) ⬆️
src/layouts/Vertical/vertical.native.js 100% <ø> (ø) ⬆️
src/blocks/HelloWorld/helloWorld.native.js 100% <100%> (ø) ⬆️
src/blocks/Counter/counter.native.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a3b7cb...fd92747. Read the comment docs.

Copy link
Contributor

@JakeDawkins JakeDawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests have been moved to /src/__tests__/e2e. I changed the yarn e2e comment to run detox build && detox test and configured jest to ignore all e2e matching files/folders

@jbaxleyiii jbaxleyiii merged commit 3abb015 into master Jun 12, 2017
@jbaxleyiii jbaxleyiii deleted the feature-smoke-test branch June 12, 2017 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants