Publication

This commit is contained in:
Peter Maquiran
2021-07-14 15:38:58 +01:00
parent 8c859834aa
commit 81f10a377c
7 changed files with 47 additions and 26 deletions
+24 -2
View File
@@ -8,19 +8,41 @@ describe('Puppeteer tests', () => {
// await page.goto(process.env.PUPPETEER_HOST)
})
test('Login', async()=> {
await loginTest(page)
},30000)
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
await page.waitForSelector('ion-app')
await loginTest(page)
// wait for footer button
await page.click('ion-tab-bar ion-tab-button:nth-child(2)')
await page.waitForSelector('app-agenda')
// click add event
await page.click('ion-content ion-row .cy-add-event')
// wait for component
await page.waitForSelector('app-new-event')
expect(3 + 2).toBe(5);
},30000);
test('[table] Create Event', async () => {
await page.setViewport({width: 1200, height: 720});
await page.goto(process.env.PUPPETEER_HOST); // wait until page load
await page.waitForSelector('ion-app')
// wait for footer button
await page.click('ion-tab-bar ion-tab-button:nth-child(2)')
await page.waitForSelector('app-agenda')
// click add event
await page.click('ion-content ion-row .cy-add-event')
//
// wait for component
await page.waitForSelector('app-new-event')
expect(3 + 2).toBe(5);
+4 -12
View File
@@ -45,16 +45,12 @@ export const loginTest = async (page) => {
}
}
describe('Puppeteer tests', () => {
beforeAll(async () => {
// await page.goto(process.env.PUPPETEER_HOST)
})
test('[table] Clear Code button and set pin', async () => {
const pathname = await page.evaluate( () => window.location.pathname)
@@ -67,11 +63,11 @@ describe('Puppeteer tests', () => {
await page.evaluate( () => {
let a: HTMLInputElement = document.querySelector('input[type="text"]')
a.value = ''
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);
@@ -105,9 +101,5 @@ describe('Puppeteer tests', () => {
expect(3 + 2).toBe(5);
},30000);
});