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
/plugins
/www
/www0
/serve
/mobilefirst
# Custom
+6
View File
@@ -15,6 +15,12 @@ module.exports = {
dumpio: true,
headless: openChrome != 'true',
product: 'chrome',
args: [`--window-size=1200,1080`],
defaultViewport: {
width:1200,
height:1080
}
},
browserContext: 'default',
}
+5
View File
@@ -11937,6 +11937,11 @@
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.0.tgz",
"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": {
"version": "3.1.3",
"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",
"depd": "^2.0.0",
"dotenv": "^10.0.0",
"faker": "^5.5.3",
"global": "^4.4.0",
"http-server": "^0.12.3",
"ibm-mfp-web-push": "^8.0.2020052213",
+1 -1
View File
@@ -19,7 +19,7 @@ export class Event{
AppointmentState: number;
TimeZone: string;
Organizer: string;
Categories: string;
Category: string;
HasAttachments: boolean;
EventRecurrence?: EventRecurrence;
+2 -2
View File
@@ -1,12 +1,12 @@
/* import { Image } from './image'; */
export class Publication{
DateIndex: Date;
DateIndex: Date | string;
DocumentId:string;
ProcessId:string;
Title: string;
Message: string;
DatePublication: Date;
DatePublication: Date | string;
OriginalFileName?: string;
FileBase64?:string;
FileExtension?: string;
@@ -74,7 +74,7 @@
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('CalendarName').invalid " class="input-errror-message">
{{ postEvent.Categories }}
{{ postEvent.Category }}
<div *ngIf="Form.get('CalendarName').errors?.required">
Campo obrigatório.
</div>
@@ -88,8 +88,8 @@
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*"
[(ngModel)]="postEvent.Categories"
selectedText="{{postEvent.Categories}}"
[(ngModel)]="postEvent.Category"
selectedText="{{postEvent.Category}}"
interface="action-sheet"
Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option>
@@ -103,7 +103,7 @@
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Categories}}
{{ postEvent.Category}}
<div *ngIf="Form.get('Categories').errors?.required">
Campo obrigatório.
</div>
@@ -162,7 +162,7 @@ export class EditEventPage implements OnInit {
CalendarName: new FormControl(this.postEvent.CalendarName, [
Validators.required
]),
Categories: new FormControl(this.postEvent.Categories, [
Categories: new FormControl(this.postEvent.Category, [
Validators.required
]),
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
@@ -90,7 +90,7 @@
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*"
[(ngModel)]="postEvent.Categories"
[(ngModel)]="postEvent.Category"
interface="action-sheet"
Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option>
@@ -104,7 +104,7 @@
<!-- <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Categories').invalid " class="input-errror-message">
{{ postEvent.Categories }}
{{ postEvent.Category }}
<div *ngIf="Form.get('Categories').errors?.required">
Campo obrigatório.
</div>
@@ -114,7 +114,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: 'Reunião',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -136,7 +136,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: 'Reunião',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -207,7 +207,7 @@ export class NewEventPage implements OnInit {
Date: new FormControl(this.dateValid, [
Validators.required
]),
Categories: new FormControl(this.postEvent.Categories, [
Categories: new FormControl(this.postEvent.Category, [
Validators.required
]),
participantes: new FormControl(this.taskParticipants, [
@@ -88,7 +88,7 @@
<ion-select placeholder="Selecione tipo de evento*"
class="d-block d-md-none"
[(ngModel)]="postData.Categories"
[(ngModel)]="postData.Category"
interface="action-sheet"
Cancel-text="Cancelar" required>
<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>
<!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="postData.Categories" >
<mat-select [(ngModel)]="postData.Category" >
<mat-option value="Reunião">
Reunião
</mat-option>
@@ -146,7 +146,7 @@ export class BookMeetingModalPage implements OnInit {
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
this.postData.Categories = 'Reunião'
this.postData.Category = 'Reunião'
}
ngOnInit() {
@@ -208,7 +208,7 @@ export class BookMeetingModalPage implements OnInit {
participantes: new FormControl(this.taskParticipants, [
Validators.required
]),
Categories: new FormControl(this.postData.Categories, [
Categories: new FormControl(this.postData.Category, [
Validators.required
]),
@@ -249,7 +249,7 @@ export class BookMeetingModalPage implements OnInit {
AppointmentState: 0,
TimeZone: 'UTC',
Organizer: null,
Categories: 'Reunião',
Category: 'Reunião',
HasAttachments: true,
EventRecurrence: null,
}
@@ -3,7 +3,7 @@
</ion-header>
<ion-content>
<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>
@@ -215,6 +215,8 @@ export class NewPublicationPage implements OnInit {
}
}
else {
this.publication = {
DateIndex: new Date(),
DocumentId:null,
+2 -2
View File
@@ -33,7 +33,7 @@ export class ToastService {
notification.innerHTML = `
<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>
<p class="text">{{ message }}</p>
</p>
@@ -65,7 +65,7 @@ export class ToastService {
notification.innerHTML = `
<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>
<p class="text">{{ message }}</p>
</p>
@@ -87,7 +87,7 @@
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
<!-- <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">
Reunião
</mat-option>
@@ -204,7 +204,7 @@ export class EditEventPage implements OnInit {
Validators.required,
]),
CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories, [
Categories: new FormControl(this.postEvent.Category, [
Validators.required
]),
dateStart: new FormControl(this.dateStart, [
@@ -74,7 +74,7 @@
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.Categories" >
<mat-select [(value)]="postEvent.Category" >
<mat-option value="Reunião">
Reunião
</mat-option>
@@ -139,8 +139,6 @@ export class NewEventPage implements OnInit {
this.getRecurrenceTypes();
if(!this.restoreTemporaryData()){
// clear
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
@@ -169,7 +167,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: 'Reunião',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -191,7 +189,7 @@ export class NewEventPage implements OnInit {
AppointmentState: 0,
TimeZone: '',
Organizer: '',
Categories: 'Reunião',
Category: 'Reunião',
HasAttachments: false,
EventRecurrence: {Type:'-1'},
};
@@ -238,7 +236,7 @@ export class NewEventPage implements OnInit {
Validators.required,
]),
CalendarName: new FormControl(this.postEvent.CalendarName),
Categories: new FormControl(this.postEvent.Categories, [
Categories: new FormControl(this.postEvent.Category, [
Validators.required
]),
dateStart: new FormControl(this.postEvent.StartDate, [
@@ -147,7 +147,7 @@ export class NewPublicationPage implements OnInit {
}
async save(){
async save() {
this.injectValidation()
this.runValidation()
@@ -188,8 +188,8 @@ export class NewPublicationPage implements OnInit {
}
}
else{
else if (!this.publication.OriginalFileName) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId:this.publication.DocumentId,
@@ -197,9 +197,9 @@ export class NewPublicationPage implements OnInit {
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
FileBase64: this.publication.FileBase64,
FileExtension: 'jpeg',
// OriginalFileName: this.publication.OriginalFileName,
// FileBase64: this.publication.FileBase64,
// FileExtension: 'jpeg',
}
const loader = this.toastService.loading()
@@ -218,14 +218,16 @@ export class NewPublicationPage implements OnInit {
}
}
else {
let time = new Date()
this.publication = {
DateIndex: new Date(),
DateIndex: time,
DocumentId:null,
ProcessId:this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: new Date(),
DatePublication: time,
OriginalFileName: this.capturedImageTitle,
FileBase64: this.capturedImage,
FileExtension: 'jpeg',
@@ -120,7 +120,7 @@ export class ViewPublicationsPage implements OnInit {
publicationType: publicationType,
folderId: folderId,
},
cssClass: 'new-publication',
cssClass: 'new-publication modal modal-desktop',
backdropDismiss: false
});
await modal.present();
+51
View File
@@ -1,6 +1,8 @@
import { environment } from '../src/environments/environment'
import { loginTest } from './login.spec'
import * as faker from 'faker';
faker.locale = "pt_PT";
describe('Puppeteer tests', () => {
@@ -44,7 +46,56 @@ describe('Puppeteer tests', () => {
await page.click('ion-content ion-row .cy-add-event')
// wait for component
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);
},30000);