Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
refactor(e2etest): optimize addressbook and tinebase tests
Browse files Browse the repository at this point in the history
Change-Id: I8134c1d19c36c1d911d8512b3c83477cc79bd6c7
Reviewed-on: http://gerrit.tine20.com/customers/18589
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Jenkins CI (http://ci.tine20.com/) <tine20-jenkins@metaways.de>
  • Loading branch information
Christian Feitl authored and pschuele committed Dec 2, 2020
1 parent 19ff645 commit 3400f38
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 64 deletions.
116 changes: 56 additions & 60 deletions tests/e2etests/src/testScreenshots/Addressbook/addressbook.test.js
Expand Up @@ -54,66 +54,60 @@ describe('Contacts', () => {
await popupWindow.close();
});

test('show map', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
let popupWindow = await lib.getNewWindow();
await popupWindow.waitFor('.x-tab-edge');
try {
await expect(popupWindow).toClick('span', {text: 'Karte'});
await popupWindow.waitFor(10000); // wait to load map
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/12_adressbuch_kontakt_karte.png'});
} catch (e) {
//console.log('Map musst enabled');
}
await popupWindow.close();
});
describe('editDialog', () => {
let popupWindow;

test('notes', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
let popupWindow = await lib.getNewWindow();
await popupWindow.waitFor('.x-tab-edge');
await expect(popupWindow).toClick('span', {text: new RegExp("Notizen.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/17_allgemein_hr_eingabemaske_neu_notiz.png'});
await expect(popupWindow).toClick('button', {text: 'Notizen hinzufügen'});
await popupWindow.waitFor('.x-window-bwrap .x-form-trigger.x-form-arrow-trigger');
await popupWindow.click('.x-window-bwrap .x-form-trigger.x-form-arrow-trigger');
//await popupWindow.waitFor(1000);
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/18_allgemein_hr_eingabemaske_neu_notiz_notiz.png'});
await expect(popupWindow).toClick('.x-window-bwrap button', 'Abbrechen');
await popupWindow.close();
});
test('open editDialog', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
popupWindow = await lib.getNewWindow();
await popupWindow.waitFor('.x-tab-edge');
});

test('attachments', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
var popupWindow = await lib.getNewWindow();
await popupWindow.waitFor('.x-tab-edge');
await expect(popupWindow).toClick('span', {text: new RegExp("Anhänge.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/22_allgemein_hr_mitarbeiter_anhang.png'});
await popupWindow.close();
});
test('show map', async () => {
try {
await expect(popupWindow).toClick('span', {text: 'Karte'});
await popupWindow.waitFor(10000); // wait to load map
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/12_adressbuch_kontakt_karte.png'});
} catch (e) {
await console.log('Map musst enabled');
}
});

test('relations', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
var popupWindow = await lib.getNewWindow();
await popupWindow.waitFor('.x-tab-edge');
await expect(popupWindow).toClick('span', {text: new RegExp("Verknüpfungen.*")});
await popupWindow.waitFor(3000);
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/23_allgemein_hr_mitarbeiter_verknuepfungen.png'});
let arrowtrigger = await popupWindow.$$('.x-form-arrow-trigger');
await arrowtrigger[9].click();
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/13_adressbuch_kontakt_bearbeiten_verknuepfung_links.png'});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/24_allgemein_hr_mitarbeiter_verknuepfungen_hinzu.png'});
await arrowtrigger[10].click();
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/14_adressbuch_kontakt_bearbeiten_verknuepfung_rechts.png'});
await popupWindow.close();
});
test('notes', async () => {
await expect(popupWindow).toClick('span', {text: new RegExp("Notizen.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/17_allgemein_hr_eingabemaske_neu_notiz.png'});
await expect(popupWindow).toClick('button', {text: 'Notizen hinzufügen'});
await popupWindow.waitFor('.x-window-bwrap .x-form-trigger.x-form-arrow-trigger');
await popupWindow.click('.x-window-bwrap .x-form-trigger.x-form-arrow-trigger');
//await popupWindow.waitFor(1000);
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/18_allgemein_hr_eingabemaske_neu_notiz_notiz.png'});
await expect(popupWindow).toClick('.x-window-bwrap button', 'Abbrechen');
});

test('history', async () => {
await expect(page).toClick('.x-grid3-row-first', {clickCount: 2});
var popupWindow = await lib.getNewWindow();
await expect(popupWindow).toClick('span', {text: new RegExp("Historie.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/21_allgemein_hr_mitarbeiter_historie.png'});
await popupWindow.close();
test('attachments', async () => {
await expect(popupWindow).toClick('span', {text: new RegExp("Anhänge.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/22_allgemein_hr_mitarbeiter_anhang.png'});
});

test('relations', async () => {
await expect(popupWindow).toClick('span', {text: new RegExp("Verknüpfungen.*")});
await popupWindow.waitFor(3000);
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/23_allgemein_hr_mitarbeiter_verknuepfungen.png'});
let test = await popupWindow.waitForSelector('.x-panel.x-wdgt-pickergrid.x-grid-panel');

let arrowtrigger = await test.$$('.x-form-arrow-trigger');
await arrowtrigger[0].click(); // test!
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/13_adressbuch_kontakt_bearbeiten_verknuepfung_links.png'});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/24_allgemein_hr_mitarbeiter_verknuepfungen_hinzu.png'});
await arrowtrigger[1].click(); // test!
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/14_adressbuch_kontakt_bearbeiten_verknuepfung_rechts.png'});
});

test('history', async () => {
await expect(popupWindow).toClick('span', {text: new RegExp("Historie.*")});
await popupWindow.screenshot({path: 'screenshots/2_allgemeines/21_allgemein_hr_mitarbeiter_historie.png'});
await popupWindow.close();
});
});

describe('ContextMenu', () => {
Expand Down Expand Up @@ -211,11 +205,11 @@ describe('Contacts', () => {
await expect(popupWindow).toFill('input[name=n_family]', 'Gaurad');
await expect(popupWindow).toFill('input[name=org_name]', 'DWE');
await expect(popupWindow).toFill('input[name=org_unit]', 'Personalwesen');
await expect(popupWindow).toFill('input[name=title]', 'CEO');
//await expect(popupWindow).toFill('input[name=title]', 'CEO');
await expect(popupWindow).toFill('input[name=bday]', '12.03.1956');
await expect(popupWindow).toFill('input[name=tel_work]', '040734662533');
await expect(popupWindow).toFill('input[name=tel_cell]', '0179461021');
await expect(popupWindow).toFill('input[name=adr_one_region]', 'Hamburg');
//await expect(popupWindow).toFill('input[name=adr_one_region]', 'Hamburg');
await expect(popupWindow).toFill('input[name=adr_one_postalcode]', '20475');
await expect(popupWindow).toFill('input[name=adr_one_street]', 'Pickhuben');
await expect(popupWindow).toFill('input[name=adr_one_locality]', 'Hamburg');
Expand All @@ -235,8 +229,9 @@ describe('Contacts', () => {

test('add Tag', async () => {
//await newPage.waitFor(1000);
let arrowtrigger = await popupWindow.$$('.x-form-arrow-trigger');
await arrowtrigger[8].click();
let arrowtrigger = await popupWindow.$x('//div[contains(@class, "x-panel x-panel-noborder x-box-item") and contains(.,"Tags (0)")]' +
'//span[contains(@class,"x-form-twin-triggers")]');
await arrowtrigger[0].click();
await popupWindow.waitFor(2000);
await popupWindow.waitFor('.x-widget-tag-tagitem-text');
await popupWindow.screenshot({path: 'screenshots/1_adressverwaltung/15_adressbuch_tag_hinzu.png'});
Expand All @@ -252,6 +247,7 @@ describe('Contacts', () => {

test('save', async () => {
await expect(popupWindow).toClick('button', {text: 'Ok'});
await page.waitFor(1000);
});
});

Expand Down
7 changes: 3 additions & 4 deletions tests/e2etests/src/testScreenshots/Tinebase/tinebase.test.js
Expand Up @@ -21,10 +21,9 @@ describe('mainScreen', () => {
//console.log('Application ' + Apps[i] + ' don´t install');
}
}
await expect(page).toClick('span', {text: 'Tine 2.0'});
await page.waitFor(500);
await expect(page).toClick('span', {text: 'Adressbuch'});
await page.waitFor(5000);
await expect(page).toClick('span', {text: process.env.TEST_BRANDING_TITLE});
await expect(page).toClick('.x-menu-item-text', {text: 'Adressbuch'});
await page.waitFor(5000);// wait for screenshot
await page.screenshot({path: 'screenshots/2_allgemeines/1_allgemein_alle_reiter.png'});
})
});
Expand Down

0 comments on commit 3400f38

Please sign in to comment.