Skip to content

Commit

Permalink
Fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishbowler committed Jul 17, 2020
1 parent 664c0f0 commit ed23f93
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion e2e/tests/assorted/02-broadcast.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Broadcast room', () => {
await waitFor(element(by.id('create-channel-view'))).toExist().withTimeout(5000);
await element(by.id('create-channel-name')).replaceText(`broadcast${ data.random }`);
await sleep(2000);
await element(by.id('create-channel-broadcast')).tap();
await element(by.id('create-channel-broadcast')).longPress(); //https://github.com/facebook/react-native/issues/28032
if (device.getPlatform() === 'ios') { //Because this tap is FLAKY on iOS
await expect(element(by.id('create-channel-broadcast'))).toHaveValue('1')
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/assorted/05-joinpublicroom.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const data = require('../../data');
const { navigateToLogin, login, mockMessage, tapBack, sleep, searchRoom } = require('../../helpers/app');

const testuser = data.users.regular
const room = data.channels.detoxpublic;
const room = data.channels.detoxpublic.name;

async function navigateToRoom() {
await sleep(2000);
Expand Down
97 changes: 52 additions & 45 deletions e2e/tests/onboarding/02-legal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,61 @@ const { navigateToRegister, navigateToLogin } = require('../../helpers/app');

describe('Legal screen', () => {

before(async() => {
await device.launchApp({ newInstance: true });
await navigateToLogin();
});

it('should have legal button on login', async() => {
await waitFor(element(by.id('login-view-more'))).toBeVisible().withTimeout(60000);
});

it('should navigate to legal from login', async() => {
await waitFor(element(by.id('login-view-more'))).toBeVisible().withTimeout(60000);
await element(by.id('login-view-more')).tap();
});

it('should have legal button on register', async() => {
await device.launchApp({ newInstance: true });
await navigateToRegister();
await waitFor(element(by.id('register-view-more'))).toBeVisible().withTimeout(60000);
});

it('should navigate to legal from register', async() => {
await waitFor(element(by.id('register-view-more'))).toBeVisible().withTimeout(60000);
});

it('should have legal screen', async() => {
await expect(element(by.id('legal-view'))).toBeVisible();
describe('From Login', () => {
before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToLogin();
});

it('should have legal button on login', async() => {
await waitFor(element(by.id('login-view-more'))).toBeVisible().withTimeout(60000);
});

it('should navigate to legal from login', async() => {
await expect(element(by.id('login-view-more'))).toBeVisible();
await element(by.id('login-view-more')).tap();
await waitFor(element(by.id('legal-view'))).toBeVisible().withTimeout(4000)
});
});

it('should have terms of service button', async() => {
await expect(element(by.id('legal-terms-button'))).toBeVisible();
});
describe('From Register', () => {
before(async() => {
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
await navigateToRegister();
});

it('should have privacy policy button', async() => {
await expect(element(by.id('legal-privacy-button'))).toBeVisible();
});
it('should have legal button on register', async() => {
await waitFor(element(by.id('register-view-more'))).toBeVisible().withTimeout(60000);
});


// We can't simulate how webview behaves, so I had to disable :(
// it('should navigate to terms', async() => {
// await element(by.id('legal-terms-button')).tap();
// await waitFor(element(by.id('terms-view'))).toBeVisible().withTimeout(2000);
// await expect(element(by.id('terms-view'))).toBeVisible();
// });
it('should navigate to legal from register', async() => {
await expect(element(by.id('register-view-more'))).toBeVisible();
await element(by.id('register-view-more')).tap();
await waitFor(element(by.id('legal-view'))).toBeVisible().withTimeout(4000);
});

it('should have terms of service button', async() => {
await expect(element(by.id('legal-terms-button'))).toBeVisible();
});

// it('should navigate to privacy', async() => {
// await tapBack();
// await element(by.id('legal-privacy-button')).tap();
// await waitFor(element(by.id('privacy-view'))).toBeVisible().withTimeout(2000);
// await expect(element(by.id('privacy-view'))).toBeVisible();
// });
it('should have privacy policy button', async() => {
await expect(element(by.id('legal-privacy-button'))).toBeVisible();
});

// We can't simulate how webview behaves, so I had to disable :(
/*
it('should navigate to terms', async() => {
await element(by.id('legal-terms-button')).tap();
await waitFor(element(by.id('terms-view'))).toBeVisible().withTimeout(2000);
await expect(element(by.id('terms-view'))).toBeVisible();
});
it('should navigate to privacy', async() => {
await tapBack();
await element(by.id('legal-privacy-button')).tap();
await waitFor(element(by.id('privacy-view'))).toBeVisible().withTimeout(2000);
await expect(element(by.id('privacy-view'))).toBeVisible();
});
*/
});
});
2 changes: 1 addition & 1 deletion e2e/tests/room/04-roominfo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('Room info screen', () => {
await element(by.type('UIScrollView')).atIndex(1).swipe('up');
await element(by.id('room-info-edit-view-t')).tap();
await sleep(1000);
await element(by.id('room-info-edit-view-ro')).tap();
await element(by.id('room-info-edit-view-ro')).longPress(); //https://github.com/facebook/react-native/issues/28032
await sleep(1000);
await element(by.id('room-info-edit-view-react-when-ro')).tap();
await sleep(1000);
Expand Down

0 comments on commit ed23f93

Please sign in to comment.