This commit is contained in:
tiago.kayaya
2021-07-15 08:56:55 +01:00
22 changed files with 105 additions and 40 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ npm-debug.log*
/platforms /platforms
/plugins /plugins
/www /www
/www0 /serve
/mobilefirst /mobilefirst
# Custom # Custom
+6
View File
@@ -15,6 +15,12 @@ module.exports = {
dumpio: true, dumpio: true,
headless: openChrome != 'true', headless: openChrome != 'true',
product: 'chrome', product: 'chrome',
args: [`--window-size=1200,1080`],
defaultViewport: {
width:1200,
height:1080
}
}, },
browserContext: 'default', browserContext: 'default',
} }
+5
View File
@@ -11937,6 +11937,11 @@
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
"integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=" "integrity": "sha1-4mifjzVvrWLMplo6kcXfX5VRaS8="
}, },
"faker": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/faker/-/faker-5.5.3.tgz",
"integrity": "sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g=="
},
"fast-deep-equal": { "fast-deep-equal": {
"version": "3.1.3", "version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+1
View File
@@ -70,6 +70,7 @@
"date-fns": "^2.17.0", "date-fns": "^2.17.0",
"depd": "^2.0.0", "depd": "^2.0.0",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"faker": "^5.5.3",
"global": "^4.4.0", "global": "^4.4.0",
"http-server": "^0.12.3", "http-server": "^0.12.3",
"ibm-mfp-web-push": "^8.0.2020052213", "ibm-mfp-web-push": "^8.0.2020052213",
+1 -1
View File
@@ -19,7 +19,7 @@ export class Event{
AppointmentState: number; AppointmentState: number;
TimeZone: string; TimeZone: string;
Organizer: string; Organizer: string;
Categories: string; Category: string;
HasAttachments: boolean; HasAttachments: boolean;
EventRecurrence?: EventRecurrence; EventRecurrence?: EventRecurrence;
+2 -2
View File
@@ -1,12 +1,12 @@
/* import { Image } from './image'; */ /* import { Image } from './image'; */
export class Publication{ export class Publication{
DateIndex: Date; DateIndex: Date | string;
DocumentId:string; DocumentId:string;
ProcessId:string; ProcessId:string;
Title: string; Title: string;
Message: string; Message: string;
DatePublication: Date; DatePublication: Date | string;
OriginalFileName?: string; OriginalFileName?: string;
FileBase64?:string; FileBase64?:string;
FileExtension?: string; FileExtension?: string;
@@ -74,7 +74,7 @@
<div *ngIf="Form && validateFrom" > <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message"> <div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message">
{{ postEvent.Categories }} {{ postEvent.Category }}
<div *ngIf="Form.get('CalendarName').errors?.required"> <div *ngIf="Form.get('CalendarName').errors?.required">
Campo obrigatório. Campo obrigatório.
</div> </div>
@@ -88,8 +88,8 @@
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*" <ion-select placeholder="Selecione tipo de evento*"
[(ngModel)]="postEvent.Categories" [(ngModel)]="postEvent.Category"
selectedText="{{postEvent.Categories}}" selectedText="{{postEvent.Category}}"
interface="action-sheet" interface="action-sheet"
Cancel-text="Cancelar" required> Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option> <ion-select-option value="Reunião">Reunião</ion-select-option>
@@ -103,7 +103,7 @@
<div *ngIf="Form && validateFrom" > <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message"> <div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Categories}} {{ postEvent.Category}}
<div *ngIf="Form.get('Categories').errors?.required"> <div *ngIf="Form.get('Categories').errors?.required">
Campo obrigatório. Campo obrigatório.
</div> </div>
@@ -162,7 +162,7 @@ export class EditEventPage implements OnInit {
CalendarName: new FormControl(this.postEvent.CalendarName, [ CalendarName: new FormControl(this.postEvent.CalendarName, [
Validators.required Validators.required
]), ]),
Categories: new FormControl(this.postEvent.Categories, [ Categories: new FormControl(this.postEvent.Category, [
Validators.required Validators.required
]), ]),
IsRecurring: new FormControl(this.postEvent.IsRecurring, [ IsRecurring: new FormControl(this.postEvent.IsRecurring, [
@@ -90,7 +90,7 @@
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*" <ion-select placeholder="Selecione tipo de evento*"
[(ngModel)]="postEvent.Categories" [(ngModel)]="postEvent.Category"
interface="action-sheet" interface="action-sheet"
Cancel-text="Cancelar" required> Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option> <ion-select-option value="Reunião">Reunião</ion-select-option>
@@ -104,7 +104,7 @@
<!-- <div *ngIf="Form && validateFrom" > <!-- <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message"> <div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Categories }} {{ postEvent.Category }}
<div *ngIf="Form.get('Categories').errors?.required"> <div *ngIf="Form.get('Categories').errors?.required">
Campo obrigatório. Campo obrigatório.
</div> </div>
@@ -114,7 +114,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0, AppointmentState: 0,
TimeZone: '', TimeZone: '',
Organizer: '', Organizer: '',
Categories: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: {Type:'-1'}, EventRecurrence: {Type:'-1'},
}; };
@@ -136,7 +136,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0, AppointmentState: 0,
TimeZone: '', TimeZone: '',
Organizer: '', Organizer: '',
Categories: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: {Type:'-1'}, EventRecurrence: {Type:'-1'},
}; };
@@ -207,7 +207,7 @@ export class NewEventPage implements OnInit {
Date: new FormControl(this.dateValid, [ Date: new FormControl(this.dateValid, [
Validators.required Validators.required
]), ]),
Categories: new FormControl(this.postEvent.Categories, [ Categories: new FormControl(this.postEvent.Category, [
Validators.required Validators.required
]), ]),
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
@@ -88,7 +88,7 @@
<ion-select placeholder="Selecione tipo de evento*" <ion-select placeholder="Selecione tipo de evento*"
class="d-block d-md-none" class="d-block d-md-none"
[(ngModel)]="postData.Categories" [(ngModel)]="postData.Category"
interface="action-sheet" interface="action-sheet"
Cancel-text="Cancelar" required> Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option> <ion-select-option value="Reunião">Reunião</ion-select-option>
@@ -100,7 +100,7 @@
<mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required> <mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > --> <!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="postData.Categories" > <mat-select [(ngModel)]="postData.Category" >
<mat-option value="Reunião"> <mat-option value="Reunião">
Reunião Reunião
</mat-option> </mat-option>
@@ -146,7 +146,7 @@ export class BookMeetingModalPage implements OnInit {
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000))); this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
this.postData.Categories = 'Reunião' this.postData.Category = 'Reunião'
} }
ngOnInit() { ngOnInit() {
@@ -208,7 +208,7 @@ export class BookMeetingModalPage implements OnInit {
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
Validators.required Validators.required
]), ]),
Categories: new FormControl(this.postData.Categories, [ Categories: new FormControl(this.postData.Category, [
Validators.required Validators.required
]), ]),
@@ -249,7 +249,7 @@ export class BookMeetingModalPage implements OnInit {
AppointmentState: 0, AppointmentState: 0,
TimeZone: 'UTC', TimeZone: 'UTC',
Organizer: null, Organizer: null,
Categories: 'Reunião', Category: 'Reunião',
HasAttachments: true, HasAttachments: true,
EventRecurrence: null, EventRecurrence: null,
} }
@@ -3,7 +3,7 @@
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)"> <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> </ion-refresher>
@@ -215,6 +215,8 @@ export class NewPublicationPage implements OnInit {
} }
} }
else { else {
this.publication = { this.publication = {
DateIndex: new Date(), DateIndex: new Date(),
DocumentId:null, DocumentId:null,
+2 -2
View File
@@ -33,7 +33,7 @@ export class ToastService {
notification.innerHTML = ` notification.innerHTML = `
<div class="main-content width-100 pa-20"> <div class="main-content width-100 pa-20">
<p class="message d-flex align-center"> <p class="message d-flex align-center success">
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon> <ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
<p class="text">{{ message }}</p> <p class="text">{{ message }}</p>
</p> </p>
@@ -65,7 +65,7 @@ export class ToastService {
notification.innerHTML = ` notification.innerHTML = `
<div class="main-content width-100 pa-20"> <div class="main-content width-100 pa-20">
<p class="message d-flex align-center"> <p class="message d-flex align-center faild">
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon> <ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
<p class="text">{{ message }}</p> <p class="text">{{ message }}</p>
</p> </p>
@@ -87,7 +87,7 @@
<mat-form-field appearance="none" floatLabel="never" class="width-100" required> <mat-form-field appearance="none" floatLabel="never" class="width-100" required>
<!-- <input matInput type="text" > --> <!-- <input matInput type="text" > -->
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Categories" > <mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Category" >
<mat-option value="Reunião"> <mat-option value="Reunião">
Reunião Reunião
</mat-option> </mat-option>
@@ -204,7 +204,7 @@ export class EditEventPage implements OnInit {
Validators.required, Validators.required,
]), ]),
CalendarName: new FormControl(this.postEvent.CalendarName), CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories, [ Categories: new FormControl(this.postEvent.Category, [
Validators.required Validators.required
]), ]),
dateStart: new FormControl(this.dateStart, [ dateStart: new FormControl(this.dateStart, [
@@ -74,7 +74,7 @@
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required> <mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > --> <!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.Categories" > <mat-select [(value)]="postEvent.Category" >
<mat-option value="Reunião"> <mat-option value="Reunião">
Reunião Reunião
</mat-option> </mat-option>
@@ -139,8 +139,6 @@ export class NewEventPage implements OnInit {
this.getRecurrenceTypes(); this.getRecurrenceTypes();
if(!this.restoreTemporaryData()){ if(!this.restoreTemporaryData()){
// clear // clear
this.eventBody = { BodyType : "1", Text : ""}; this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody; this.postEvent.Body = this.eventBody;
@@ -169,7 +167,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0, AppointmentState: 0,
TimeZone: '', TimeZone: '',
Organizer: '', Organizer: '',
Categories: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: {Type:'-1'}, EventRecurrence: {Type:'-1'},
}; };
@@ -191,7 +189,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0, AppointmentState: 0,
TimeZone: '', TimeZone: '',
Organizer: '', Organizer: '',
Categories: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: {Type:'-1'}, EventRecurrence: {Type:'-1'},
}; };
@@ -238,7 +236,7 @@ export class NewEventPage implements OnInit {
Validators.required, Validators.required,
]), ]),
CalendarName: new FormControl(this.postEvent.CalendarName), CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories, [ Categories: new FormControl(this.postEvent.Category, [
Validators.required Validators.required
]), ]),
dateStart: new FormControl(this.postEvent.StartDate, [ dateStart: new FormControl(this.postEvent.StartDate, [
@@ -147,7 +147,7 @@ export class NewPublicationPage implements OnInit {
} }
async save(){ async save() {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
@@ -188,7 +188,7 @@ export class NewPublicationPage implements OnInit {
} }
} }
else{ else if (!this.publication.OriginalFileName) {
this.publication = { this.publication = {
DateIndex: this.publication.DateIndex, DateIndex: this.publication.DateIndex,
@@ -197,9 +197,9 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title, Title: this.pub.Title,
Message: this.pub.Message, Message: this.pub.Message,
DatePublication: this.publication.DatePublication, DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName, // OriginalFileName: this.publication.OriginalFileName,
FileBase64: this.publication.FileBase64, // FileBase64: this.publication.FileBase64,
FileExtension: 'jpeg', // FileExtension: 'jpeg',
} }
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -219,13 +219,15 @@ export class NewPublicationPage implements OnInit {
} }
else { else {
let time = new Date()
this.publication = { this.publication = {
DateIndex: new Date(), DateIndex: time,
DocumentId:null, DocumentId:null,
ProcessId:this.folderId, ProcessId:this.folderId,
Title: this.pub.Title, Title: this.pub.Title,
Message: this.pub.Message, Message: this.pub.Message,
DatePublication: new Date(), DatePublication: time,
OriginalFileName: this.capturedImageTitle, OriginalFileName: this.capturedImageTitle,
FileBase64: this.capturedImage, FileBase64: this.capturedImage,
FileExtension: 'jpeg', FileExtension: 'jpeg',
@@ -120,7 +120,7 @@ export class ViewPublicationsPage implements OnInit {
publicationType: publicationType, publicationType: publicationType,
folderId: folderId, folderId: folderId,
}, },
cssClass: 'new-publication', cssClass: 'new-publication modal modal-desktop',
backdropDismiss: false backdropDismiss: false
}); });
await modal.present(); await modal.present();
+51
View File
@@ -1,6 +1,8 @@
import { environment } from '../src/environments/environment' import { environment } from '../src/environments/environment'
import { loginTest } from './login.spec' import { loginTest } from './login.spec'
import * as faker from 'faker';
faker.locale = "pt_PT";
describe('Puppeteer tests', () => { describe('Puppeteer tests', () => {
@@ -45,6 +47,55 @@ describe('Puppeteer tests', () => {
// wait for component // wait for component
await page.waitForSelector('app-new-event') await page.waitForSelector('app-new-event')
// subject
await page.type('app-new-event .ion-item-container input', faker.commerce.productDescription() )
// Location
await page.type('app-new-event .container-div:nth-child(2) input', faker.address.state()+" "+faker.address.city() )
// Select Calendar
await page.click('app-new-event .container-div:nth-child(3) .mat-form-field-flex')
await page.waitForSelector('.cdk-overlay-connected-position-bounding-box')
await page.click('.cdk-overlay-connected-position-bounding-box mat-option')
// select event type
await page.click('app-new-event .container-div:nth-child(4) .mat-form-field-flex')
await page.waitForSelector('.cdk-overlay-connected-position-bounding-box')
await page.click('.cdk-overlay-connected-position-bounding-box mat-option')
// select start day
await page.click('app-new-event .container-div:nth-child(5) button')
await page.waitForSelector('.cdk-overlay-connected-position-bounding-box')
await page.click('.mat-calendar-next-button')
let selectedFDay = Math.floor(Math.random()*(25-1+1)+1);
let days = await page.$$(` .mat-calendar-body-cell `)
await days[selectedFDay].click()
await page.click('.cdk-overlay-connected-position-bounding-box .actions button')
// select end day
await page.click('app-new-event .container-div:nth-child(6) button')
await page.waitForSelector('.cdk-overlay-connected-position-bounding-box')
await page.click('.mat-calendar-next-button')
days = await page.$$(` .mat-calendar-body-cell `)
await days[selectedFDay+1].click()
await page.click('.cdk-overlay-connected-position-bounding-box .actions button')
// await page.click('app-new-event .container-div:nth-child(7) .mat-form-field-flex')
// await page.waitForSelector('.cdk-overlay-connected-position-bounding-box')
// await page.click('.cdk-overlay-connected-position-bounding-box mat-option')
await page.click('app-new-event .container-div:nth-child(8) .add-people')
await page.waitForSelector('app-attendee-modal .ng-star-inserted:nth-child(2)')
await page.click('app-attendee-modal .ng-star-inserted:nth-child(2)')
// save
await page.click('app-attendee-modal ion-footer ion-buttons:nth-child(2)')
// save
let buttons = await page.$$('app-new-event ion-footer ion-buttons')
buttons[1].click()
await page.waitForSelector('.notification .success')
expect(3 + 2).toBe(5); expect(3 + 2).toBe(5);
},30000); },30000);