|
| 1 | +/** |
| 2 | + * Copyright (c) 2013-present, Facebook, Inc. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | + |
| 8 | +/* global device, element, by, expect */ |
| 9 | + |
| 10 | +describe('Sanity', () => { |
| 11 | + beforeEach(async () => { |
| 12 | + await device.reloadReactNative(); |
| 13 | + await element(by.label(`<Button> Simple React Native button component.`)).tap(); |
| 14 | + }); |
| 15 | + |
| 16 | + afterEach(async () => { |
| 17 | + //TODO - remove app state persistency, till then, we must go back to main screen, |
| 18 | + await element(by.label('Back')).tap(); |
| 19 | + }); |
| 20 | + |
| 21 | + it('Simple button should be tappable', async () => { |
| 22 | + await element(by.label('Press Me')).tap(); |
| 23 | + await expect(element(by.text('Simple has been pressed!'))).toBeVisible(); |
| 24 | + await element(by.text('OK')).tap(); |
| 25 | + }); |
| 26 | + |
| 27 | + it('Adjusted color button should be tappable', async () => { |
| 28 | + await element(by.label('Press Purple')).tap(); |
| 29 | + await expect(element(by.text('Purple has been pressed!'))).toBeVisible(); |
| 30 | + await element(by.text('OK')).tap(); |
| 31 | + }); |
| 32 | + |
| 33 | + it(`Two buttons with JustifyContent:'space-between' should be tappable`, async () => { |
| 34 | + await element(by.label('This looks great!')).tap(); |
| 35 | + await expect(element(by.text('Left has been pressed!'))).toBeVisible(); |
| 36 | + await element(by.text('OK')).tap(); |
| 37 | + |
| 38 | + await element(by.label('Ok!')).tap(); |
| 39 | + await expect(element(by.text('Right has been pressed!'))).toBeVisible(); |
| 40 | + await element(by.text('OK')).tap(); |
| 41 | + }); |
| 42 | + |
| 43 | + it('Disabled button should not interact', async () => { |
| 44 | + await element(by.label('I Am Disabled')).tap(); |
| 45 | + await expect(element(by.text('Disabled has been pressed!'))).toBeNotVisible(); |
| 46 | + }); |
| 47 | +}); |
0 commit comments