mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Add funcional test and fix build
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ npm-debug.log*
|
|||||||
/platforms
|
/platforms
|
||||||
/plugins
|
/plugins
|
||||||
/www
|
/www
|
||||||
/www0
|
/serve
|
||||||
/mobilefirst
|
/mobilefirst
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|
||||||
}
|
}
|
||||||
Generated
+5
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user