...
 
Commits (15)
......@@ -3,7 +3,7 @@ import sleep from '../../src/common/helpers/sleep';
export default async(driver) => {
// select first image
const firstImage = await driver.waitForElementByAccessibilityId('Gallery Image 0', wd.asserters.isDisplayed, 5000);
const firstImage = await driver.waitForElementByAccessibilityId('Gallery image/jpeg', wd.asserters.isDisplayed, 5000);
await firstImage.click();
await sleep(3000);
......
......@@ -42,7 +42,7 @@ describe('Discovery post edit flow', () => {
it('should search for the post', async () => {
// select all list
const all = await driver.waitForElementByAccessibilityId('Discovery All', wd.asserters.isDisplayed, 1000);
const all = await driver.waitForElementByAccessibilityId('Discovery All', wd.asserters.isDisplayed, 5000);
await all.click();
await sleep(500);
......
......@@ -66,7 +66,7 @@ describe('Post flow tests', () => {
await driver.waitForElementByAccessibilityId('Newsfeed Screen', wd.asserters.isDisplayed, 10000);
// the first element of the list should be the post
const textElement = await driver.waitForElementByXPath('//android.view.ViewGroup[@content-desc="Newsfeed Screen"]/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[1]');
const textElement = await driver.waitForElementByXPath('//android.view.ViewGroup[@content-desc="Newsfeed Screen"]/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[2]');
expect(await textElement.text()).toBe(str);
});
......@@ -138,7 +138,7 @@ describe('Post flow tests', () => {
// get the Image touchable
const imageButton = await driver.waitForElementByAccessibilityId('Posted Image', wd.asserters.isDisplayed, 10000);
await imageButton.click();
const image = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView');
const image = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView');
const goBack = await driver.waitForElementByAccessibilityId('Go back button', wd.asserters.isDisplayed, 10000);
await goBack.click();
......
......@@ -27,9 +27,10 @@ describe('Top-bar tests', () => {
});
it('should open the boost console', async () => {
const button = await driver.waitForElementByAccessibilityId('boost-console button', wd.asserters.isDisplayed, 5000);
const button = await driver.waitForElementByAccessibilityId('boost-console button', wd.asserters.isDisplayed, 7000);
await button.click();
const textElement = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView');
const textElement = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView');
expect(await textElement.text()).toBe('Boost Console');
const back = await driver.waitForElementByXPath('//android.widget.Button[@content-desc="Go back"]/android.view.ViewGroup/android.widget.ImageView');
......@@ -39,10 +40,9 @@ describe('Top-bar tests', () => {
it('should open the users profile on clicking the profile avatar', async () => {
const button = await driver.waitForElementByAccessibilityId('topbar avatar button', wd.asserters.isDisplayed, 5000);
await button.click();
await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[1]/android.widget.ImageView');
await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[3]/android.widget.ImageView');
const back = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView')
back.click();
const back = await driver.waitForElementByXPath('/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[1]/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup[2]/android.widget.TextView'); back.click();
});
it('should open the menu when clicking the hamburger menu', async () => {
......
......@@ -39,7 +39,7 @@ exports[`blog card component should renders correctly 1`] = `
source={
Object {
"headers": Object {
"App-Version": "3.8.0-rc1",
"App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",
},
......
......@@ -165,7 +165,7 @@ exports[`blog view screen component should renders correctly 1`] = `
source={
Object {
"headers": Object {
"App-Version": "3.8.0-rc1",
"App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",
},
......
......@@ -32,7 +32,7 @@ exports[`channel header component owner should render correctly 1`] = `
source={
Object {
"headers": Object {
"App-Version": "3.8.0-rc1",
"App-Version": "3.8.0",
"Cache-Control": "no-cache, no-store, must-revalidate",
"Pragma": "no-cache",
},
......
......@@ -47,6 +47,10 @@ export default class Boost extends Component {
renderEntity() {
const entity = this.props.boost.entity;
if (!entity) {
return null;
}
switch (entity.type) {
case 'activity':
return <Activity entity={ActivityModel.create(entity)} hideTabs={true} navigation={this.props.navigation} />;
......
......@@ -132,7 +132,7 @@ export default class CaptureGallery extends PureComponent {
})
}
}
{...testID(`Gallery Image ${index}`)}
{...testID(`Gallery ${node.type}`)}
>
<Image
source={{ uri : node.image.uri }}
......
......@@ -413,8 +413,6 @@ export default class CapturePoster extends Component {
onNsfw = values => {
const nsfw = [...values];
this.setState({ nsfw });
creatorNsfwService.set(nsfw);
}
onShare = network => {
......
......@@ -30,12 +30,12 @@ class AttachmentService {
let promise;
if(file.type.includes('video')){
promise = this.uploadToS3(file,progress);
if (file.type.includes('video')) {
promise = this.uploadToS3(file, progress);
} else {
promise = api.upload('api/v1/media/', file, extra, progress);
}
return promise;
}
......@@ -44,31 +44,29 @@ class AttachmentService {
* 1) prepare request return lease with signed url
* 2) upload file to S3 with signed url
* 3) complete upload
* @param {any} file
* @param {function} progress
* @param {any} file
* @param {function} progress
*/
uploadToS3(file, progress){
// Prepare media and wait for lease => {media_type, guid}
let lease;
return new Cancelable((resolve, reject, onCancel) => {
api.put(`api/v2/media/upload/prepare/video`).then((response) => {
lease = response.lease
return new Cancelable(async (resolve, reject, onCancel) => {
const response = await api.put(`api/v2/media/upload/prepare/video`);
// upload file to s3
const uploadPromise = api.uploadToS3(lease, file, progress).then(async () => {
const uploadPromise = api.uploadToS3(response.lease, file, progress).then(async () => {
// complete upload and wait for status
const {status} = await api.put(`api/v2/media/upload/complete/${lease.media_type}/${lease.guid}`);
const {status} = await api.put(`api/v2/media/upload/complete/${response.lease.media_type}/${response.lease.guid}`);
// if false is returned, upload fails message will be showed
return status === 'success' ? {guid: lease.guid} : false;
return status === 'success' ? {guid: response.lease.guid} : false;
});
// handle cancel
onCancel((cb) => {
uploadPromise.cancel();
cb();
});
return uploadPromise;
});
resolve(uploadPromise);
}).catch( error => {
if (error.name !== 'CancelationError') {
logService.exception('[ApiService] upload', error);
......
export const Version = {
VERSION: '3.8.0-rc1',
BUILD: '20190723'
VERSION: '3.8.0',
BUILD: '20190806'
};
......@@ -236,8 +236,8 @@ export default class ActivityModel extends BaseModel {
@action
async updateActivity(data = {}) {
const list = this._list;
delete(this._list);
const list = this.__list;
delete(this.__list);
const entity = toJS(this);
this._list = list;
......