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

test: Add detox with a simple e2e test #396

Merged
merged 20 commits into from
Apr 10, 2020
Merged
Prev Previous commit
Next Next commit
Give some buffer
  • Loading branch information
amaury1093 committed Apr 10, 2020
commit f6014dc67c589839cfc7ced076a5d3f451f300fe
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Run E2E Tests
run: |
# Start packager in background
yarn start &
yarn start >/dev/null &
PID=$(ps $! | tail -1 | awk '{print $1}')
# Run e2e test
yarn test:e2e
Expand Down
5 changes: 4 additions & 1 deletion e2e/locationDenied.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Sh**t! I Smoke. If not, see <https://www.gnu.org/licenses/>.

import { by, element, expect } from 'detox';
import { by, element, expect, waitFor } from 'detox';
import { reloadApp } from 'detox-expo-helpers';

import { testIds } from '../App/util/testId';
Expand All @@ -25,6 +25,9 @@ describe('Location denied', () => {
permissions: { location: 'never' },
});

waitFor(element(by.id(testIds.Error.screen)))
.toExist()
.withTimeout(30000);
await expect(element(by.id(testIds.Error.screen))).toBeVisible();
});

Expand Down