Fix agenda create event component

This commit is contained in:
Peter Maquiran
2021-07-14 14:29:03 +01:00
parent 5614fc38fd
commit 8c859834aa
4 changed files with 47 additions and 50 deletions
+1
View File
@@ -11,6 +11,7 @@
"e2e": "ng e2e",
"nice": "node server.js",
"test": "jest --detectOpenHandles --runInBand",
"test:prof": "ionic build --prod && npm run test",
"dev": "lite-server --baseDir=www"
},
"private": true,
@@ -99,7 +99,6 @@ export class NewEventPage implements OnInit {
Form: FormGroup;
validateFrom = false
public options = [
{ value: true, label: 'True' },
{ value: false, label: 'False' }
@@ -110,14 +109,10 @@ export class NewEventPage implements OnInit {
public stepMinutes = [1, 5, 10, 15, 20, 25];
public stepSeconds = [1, 5, 10, 15, 20, 25];
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh"));
showLoader = false
get dateOccurrence () {
return this.dateControlOccurrence.value
}
@@ -133,6 +128,7 @@ export class NewEventPage implements OnInit {
) {
this.dateAdapter.setLocale('pt');
this.loggeduser = userService.ValidatedUser;
this.postEvent = new Event();
this.postEvent.StartDate = new Date();
this.postEvent.EndDate = new Date(new Date().getTime() + 15 * 60000);
@@ -144,7 +140,7 @@ export class NewEventPage implements OnInit {
if(!this.restoreTemporaryData()){
// clear
this.postEvent = new Event();
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
+1 -1
View File
@@ -8,7 +8,7 @@ describe('Puppeteer tests', () => {
// await page.goto(process.env.PUPPETEER_HOST)
})
test('[table] create event', async () => {
test('[table] Open create event component', async () => {
await page.setViewport({width: 1200, height: 720});
await page.goto(process.env.PUPPETEER_HOST); // wait until page load
+40 -40
View File
@@ -48,62 +48,62 @@ export const loginTest = async (page) => {
describe('Puppeteer tests', () => {
beforeAll(async () => {
// await page.goto(process.env.PUPPETEER_HOST)
beforeAll(async () => {
// await page.goto(process.env.PUPPETEER_HOST)
})
})
test('[table] Clear Code button and set pin', async () => {
test('[table] Clear Code button and set pin', async () => {
const pathname = await page.evaluate( () => window.location.pathname)
if (pathname == '/') {
const pathname = await page.evaluate( () => window.location.pathname)
if (pathname == '/') {
// const browser = await puppeteer.launch({headless: false});
await page.setViewport({width: 1200, height: 720});
await page.goto(process.env.PUPPETEER_HOST); // wait until page load
await page.waitForSelector('.btn-ok')
// const browser = await puppeteer.launch({headless: false});
await page.setViewport({width: 1200, height: 720});
await page.goto(process.env.PUPPETEER_HOST); // wait until page load
await page.waitForSelector('.btn-ok')
await page.evaluate( () => {
let a: HTMLInputElement = document.querySelector('input[type="text"]')
a.value = ''
await page.evaluate( () => {
let a: HTMLInputElement = document.querySelector('input[type="text"]')
a.value = ''
let b: HTMLInputElement = document.querySelector('input[type="password"')
b.value = ''
})
let b: HTMLInputElement = document.querySelector('input[type="password"')
b.value = ''
})
await page.type('input[type="text"]', environment.defaultuser);
await page.type('input[type="password"]', environment.defaultuserpwd);
// click and wait for navigation
await Promise.all([
page.click('.btn-ok'),
// page.waitForNavigation({ waitUntil: 'networkidle0' }),
]);
await page.type('input[type="text"]', environment.defaultuser);
await page.type('input[type="password"]', environment.defaultuserpwd);
// click and wait for navigation
await Promise.all([
page.click('.btn-ok'),
// page.waitForNavigation({ waitUntil: 'networkidle0' }),
]);
await page.waitForSelector('.circle')
// define code
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
await page.waitForSelector('.circle')
// define code
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
// clear code
await page.click('.cy-clear')
// clear code
await page.click('.cy-clear')
// define code
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
// define code
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
await page.click('.circle')
await page.waitForSelector('.div-profile')
await page.click('.div-profile')
await page.waitForSelector('.div-profile')
await page.click('.div-profile')
}
}
expect(3 + 2).toBe(5);
},30000);
expect(3 + 2).toBe(5);
},30000);