react-native-navigation的迁移库

ScreenStyle.test.js 1.1KB

12345678910111213141516171819202122232425262728
  1. const Utils = require('./Utils');
  2. const elementByLabel = Utils.elementByLabel;
  3. describe('screen style', () => {
  4. beforeEach(async () => {
  5. await device.relaunchApp();
  6. });
  7. it('declare a navigationOptions on container component', async () => {
  8. await elementByLabel('Push Options Screen').tap();
  9. await expect(element(by.label('Static Title').and(by.type('UILabel')))).toBeVisible();
  10. });
  11. it('change title on container component', async () => {
  12. await elementByLabel('Push Options Screen').tap();
  13. await expect(element(by.label('Static Title').and(by.type('UILabel')))).toBeVisible();
  14. await elementByLabel('Dynamic Options').tap();
  15. await expect(element(by.label('Dynamic Title').and(by.type('UILabel')))).toBeVisible();
  16. });
  17. it('set dynamic options with valid options will do something and not crash', async () => {
  18. // we have no way of testing individual styles for the screen
  19. await elementByLabel('Push Options Screen').tap();
  20. await elementByLabel('Dynamic Options').tap();
  21. await expect(element(by.label('Options Screen'))).toBeVisible();
  22. });
  23. });