Files
Detox/detox/test/e2e/01.sanity.test.js
2024-08-15 16:21:06 +03:00

33 lines
1006 B
JavaScript

/**
* Sanity suite
* ------------
*
* Tests in this suite ensure that the most basic functionality of Detox is
* working as expected: app launches, element matching, assertions, etc.
*
* @severity critical
* @tag sanity
*/
describe('Sanity', () => {
beforeEach(async () => {
await device.reloadReactNative();
await detox.traceCall('Navigate to sanity', element(by.text('Sanity')).tap());
});
it('should have welcome screen', async () => {
await expect(element(by.text('Welcome'))).toBeVisible();
await expect(element(by.text('Say Hello'))).toBeVisible();
await expect(element(by.text('Say World'))).toBeVisible();
});
it('should show hello screen after tap', async () => {
await element(by.text('Say Hello')).tap();
await expect(element(by.text('Hello!!!'))).toBeVisible();
});
it('should show world screen after tap', async () => {
await element(by.text('Say World')).tap();
await expect(element(by.text('World!!!'))).toBeVisible();
});
});