...
 
Commits (24)
......@@ -9,7 +9,7 @@ stages:
- prepare
- review
- deploy:staging
- test:e2e
- qa
- deploy:canary
- deploy:production
- cleanup
......@@ -34,9 +34,13 @@ lint:
- prettier --check "src/**/*.scss"
- prettier --check "src/**/*.html"
e2e:chrome:
############
# QA Stage #
############
qa:e2e:
image: cypress/browsers:chrome67
stage: test:e2e
stage: qa
variables:
CYPRESS_INSTALL_BINARY: 3.4.1
script:
......@@ -63,6 +67,17 @@ e2e:chrome:
- cache/Cypress
allow_failure: true #manual inspection in case of timeouts
qa:manual:
stage: qa
script:
- echo "Manually approved"
when: manual
only:
refs:
- master
- test/gitlab-ci
allow_failure: false
###############
# Build Stage #
###############
......
......@@ -56,8 +56,8 @@ POSITIONAL=()
# set default arguments
url="http://localhost"
username="minds_cypress_tests"
pro_username="minds_cypress_tests_pro"
pro_password="123123213"
pro_username="minds_pro_cypress_tests"
pro_password=""
env=""
_video=false
while [[ $# -gt 0 ]]
......
This diff is collapsed.
context('Boost Creation', () => {
const duplicateError = "There's already an ongoing boost for this entity";
const postContent = "Test boost, please reject..." + Math.random().toString(36).substring(8);
const postContent = "Testing, please reject..." + Math.random().toString(36).substring(8);
const nonParticipationError = 'Boost target should participate in the Rewards program.'
beforeEach(() => {
......@@ -11,15 +11,15 @@ context('Boost Creation', () => {
.route("GET", '**/api/v2/search/suggest/**').as('suggest');
cy.getCookie('minds_sess')
.then((sessionCookie) => {
if (sessionCookie === null) {
return cy.login(true);
}
});
.then((sessionCookie) => {
if (sessionCookie === null) {
return cy.login(true);
}
});
cy.visit('/newsfeed/subscriptions')
cy.visit(`/${Cypress.env().username}/`)
.location('pathname')
.should('eq', `/newsfeed/subscriptions`);
.should('eq', `/${Cypress.env().username}/`);
});
// Revoke all boosts visible on the screen -
......@@ -28,10 +28,20 @@ context('Boost Creation', () => {
cy.visit('/boost/console/newsfeed/history');
cy.contains('Revoke')
.click({multiple: true});
})
});
before(() => {
cy.getCookie('minds_sess')
.then((sessionCookie) => {
if (sessionCookie === null) {
return cy.login(true);
}
});
cy.post(postContent);
});
it('should redirect a user to buy tokens when clicked', () => {
openTopModal();
openModal(postContent);
cy.get('m-boost--creator-payment-methods li h5 span')
.contains('Buy Tokens')
......@@ -41,13 +51,11 @@ context('Boost Creation', () => {
.should('eq', `/token`);
});
it('should allow a user to make an offchain boost for 5000 tokens', () => {
cy.post(postContent);
openTopModal();
it('should allow a user to make an offchain boost for 500 tokens', () => {
openModal(postContent);
cy.get('.m-boost--creator-section-amount input')
.type(5000);
.type(500);
cy.get('m-overlay-modal > div.m-overlay-modal > m-boost--creator button')
.click()
......@@ -64,9 +72,9 @@ context('Boost Creation', () => {
});
it('should error if the boost is a duplicate', () => {
openTopModal();
openModal(postContent);
cy.get('.m-boost--creator-section-amount input')
.type(5000);
.type(500);
cy.get('m-overlay-modal > div.m-overlay-modal > m-boost--creator button')
.click()
......@@ -83,7 +91,7 @@ context('Boost Creation', () => {
});
it('should display an error if boost offer receiver has not signed up for rewards', () => {
openTopModal();
openModal(postContent);
cy.get('h4')
.contains('Offers')
......@@ -103,9 +111,17 @@ context('Boost Creation', () => {
.contains(nonParticipationError);
});
function openTopModal() {
cy.get('#boost-actions')
.first()
/*
* Finds the post containing the post content,
* then gets the parent entity before m-newsfeed__entity.
* Following that, we get all of the children, and look
* for the one that contains Boost, and clicks.
*/
function openModal(postText) {
cy.contains(postText)
.parentsUntil('m-newsfeed__entity')
.children()
.contains('Boost')
.click()
.wait('@balance').then((xhr) => {
expect(xhr.status).to.equal(200);
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
*/
import generateRandomId from '../support/utilities';
context('Notification', () => {
context.skip('Notification', () => {
//secondary user for testing.
const username = generateRandomId();
......
......@@ -43,28 +43,22 @@ context('Onboarding', () => {
.contains(welcomeText);
});
it('should allow a user to register', () => {
//select topics
cy.get(getTopic(3)).click().should('have.class', 'selected')
cy.get(getTopic(4)).click().should('have.class', 'selected')
cy.get(getTopic(5)).click().should('have.class', 'selected')
it('should allow a user to run through onboarding modals', () => {
//select topics
cy.get(getTopic(3)).click().should('have.class', 'selected')
cy.get(getTopic(4)).click().should('have.class', 'selected')
cy.get(getTopic(5)).click().should('have.class', 'selected')
//click
cy.get(nextButton).click();
});
it('should skip over subscribed channels', () => {
//click
cy.get(nextButton).click();
//TODO: Skipped over for now as subscribed channels is not working on staging environment.
cy.get(nextButton).click();
});
it('should let a user change their display name and description', () => {
cy.get(nameField).clear().type(name);
cy.get(descriptionfield).type(description);
cy.get(nextButton).click();
});
it('should allow a user to select their country', () => {
//set dialcode
cy.get(countryDropdown).click();
cy.get(ukOption).click();
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,9 +20,9 @@ context('Subscription', () => {
cy.route("POST", "**/api/v1/subscribe/*").as("subscribe");
cy.route("DELETE", "**/api/v1/subscribe/*").as("unsubscribe");
cy.visit(`/${user}`);
cy.visit(`/${user}/`);
cy.location('pathname')
.should('eq', `/${user}`);
.should('eq', `/${user}/`);
});
it('should allow a user to subscribe to another', () => {
......
......@@ -247,7 +247,9 @@ export class EmbedImage {
if ($image.tagName === 'SPAN') {
$image = $image.parentNode.querySelector('img');
} else if ($image.tagName !== 'IMG') {
}
if (!$image || $image.tagName !== 'IMG') {
return;
}
......
......@@ -184,7 +184,10 @@
[src]="[
{
res: '360',
uri: 'api/v1/media/' + comment.custom_data.guid + '/play',
uri:
'api/v1/media/' +
comment.custom_data.guid +
'/play?s=comment',
type: 'video/mp4'
}
]"
......
......@@ -356,9 +356,15 @@ export class CommentComponent implements OnChanges {
this.comment.modal_source_url = this.router.url;
this.overlayModal
.create(MediaModalComponent, this.comment, {
class: 'm-overlayModal--media',
})
.create(
MediaModalComponent,
{
entity: this.comment,
},
{
class: 'm-overlayModal--media',
}
)
.present();
}
}
......@@ -375,9 +375,15 @@ export class CommentComponentV2
this.comment.modal_source_url = this.router.url;
this.overlayModal
.create(MediaModalComponent, this.comment, {
class: 'm-overlayModal--media',
})
.create(
MediaModalComponent,
{
entity: this.comment,
},
{
class: 'm-overlayModal--media',
}
)
.present();
}
}
......@@ -296,7 +296,7 @@
height="300px"
[muted]="false"
[poster]="activity.custom_data.thumbnail_src"
[src]="[{ 'res': '360', 'uri': 'api/v1/media/' + activity.custom_data.guid + '/play', 'type': 'video/mp4' }]"
[src]="[{ 'res': '360', 'uri': 'api/v1/media/' + activity.custom_data.guid + '/play?s=activity', 'type': 'video/mp4' }]"
[guid]="activity.custom_data.guid"
[playCount]="activity['play:count']"
[torrent]="[{ res: '360', key: activity.custom_data.guid + '/360.mp4' }]"
......
......@@ -115,11 +115,11 @@ export class MindsVideoDirectHttpPlayer
return this.player.nativeElement;
}
play() {
async play() {
const player = this.getPlayer();
try {
player.play();
await player.play();
} catch (e) {
console.log(e);
}
......@@ -135,11 +135,11 @@ export class MindsVideoDirectHttpPlayer
}
}
toggle() {
async toggle() {
const player = this.getPlayer();
if (player.paused) {
this.play();
await this.play();
} else {
this.pause();
}
......
<ng-container *ngIf="current">
<m-video--direct-http-player
*ngIf="current.type === 'direct-http'"
*ngIf="current.type === 'direct-http' || true"
class="m-video--player"
[src]="current.src"
[poster]="poster"
......@@ -18,7 +18,7 @@
></m-video--direct-http-player>
<m-video--torrent-player
*ngIf="current.type === 'torrent'"
*ngIf="current.type === 'torrent' && false"
class="m-video--player"
[src]="current.src"
[poster]="poster"
......@@ -39,7 +39,7 @@
<i
*ngIf="
(!playerRef.isPlaying() && !playerRef.isLoading()) ||
(isActivity && metadataLoaded && !playerRef.isPlaying())
(shouldPlayInModal && !playerRef.isPlaying())
"
class="material-icons minds-video-play-icon"
(click)="clickedVideo()"
......
......@@ -435,9 +435,9 @@ export class MindsVideoComponent implements OnDestroy {
}
clickedVideo() {
if (!this.metadataLoaded) {
return;
}
// if (!this.metadataLoaded) {
// return;
// }
const isNotTablet = Math.min(screen.width, screen.height) < 768;
......
......@@ -56,7 +56,7 @@
[src]="[
{
res: '360',
uri: 'api/v1/media/' + entity.entity_guid + '/play',
uri: 'api/v1/media/' + entity.entity_guid + '/play?s=modal',
type: 'video/mp4'
}
]"
......
......@@ -170,6 +170,11 @@ m-overlay-modal {
m-video {
position: static;
video {
width: 100%;
height: 100%;
}
.minds-video-bar-full {
.m-video--progress-bar {
padding-right: 0;
......
......@@ -109,7 +109,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
routerSubscription: Subscription;
@Input('entity') set data(params: MediaModalParams) {
this.entity = JSON.parse(JSON.stringify(params.entity)); // deep clone
this.entity = params.entity && JSON.parse(JSON.stringify(params.entity)); // deep clone
this.redirectUrl = params.redirectUrl || null;
}
......@@ -144,13 +144,19 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this.entity.title ||
`${this.entity.ownerObj.name}'s post`;
this.entity.guid = this.entity.entity_guid || this.entity.guid;
this.thumbnail = this.entity.thumbnails.xlarge;
this.thumbnail = this.entity.thumbnails
? this.entity.thumbnails.xlarge
: null;
switch (this.entity.custom_type) {
case 'video':
this.contentType = 'video';
this.entity.width = this.entity.custom_data.dimensions.width;
this.entity.height = this.entity.custom_data.dimensions.height;
this.entity.width = this.entity.custom_data.dimensions
? this.entity.custom_data.dimensions.width
: 1280;
this.entity.height = this.entity.custom_data.dimensions
? this.entity.custom_data.dimensions.height
: 720;
this.entity.thumbnail_src = this.entity.custom_data.thumbnail_src;
break;
case 'batch':
......
......@@ -13,7 +13,7 @@ export class MessengerSounds {
};
play(sound: string) {
if (this.canPlay()) this.sounds[sound].play();
// if (this.canPlay()) this.sounds[sound].play();
}
canPlay() {
......
......@@ -114,9 +114,9 @@ export class NewsfeedBoostRotatorComponent {
if (this.currentPosition >= this.boosts.length) {
this.currentPosition = 0;
}
if (this.currentPosition === 0) {
this.recordImpression(this.currentPosition, true);
}
// if (this.currentPosition === 0) {
// this.recordImpression(this.currentPosition, true);
// }
});
}
......
......@@ -12,7 +12,7 @@
[src]="[
{
res: '360',
uri: 'api/v1/media/' + entity.guid + '/play',
uri: 'api/v1/media/' + entity.guid + '/play?s=tile',
type: 'video/mp4'
}
]"
......