Skip to content

Commit

Permalink
Updated test results print format
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Jan 29, 2024
1 parent 28db31d commit 1f1e484
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</tr>
<tr>
<th></th>
<th>
<th colspan="2">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-filter"></i></span>
<input
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@
"csvtojson": "^2.0.8",
"debug": "^4.3.4",
"delay": "^5.0.0",
"dotenv": "^16.4.0",
"eslint-plugin-jsdoc": "^48.0.2",
"dotenv": "^16.4.1",
"eslint-plugin-jsdoc": "^48.0.4",
"excel4node": "^1.8.2",
"express": "^4.18.2",
"express-handlebars": "^7.1.2",
"express-session": "^1.17.3",
"express-session": "^1.18.0",
"font-awesome": "^4.7.0",
"handlebars": "^4.7.8",
"helmet": "^7.1.0",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = defineConfig({
forbidOnly : !!process.env.CI,

/* Retry on CI only */
retries : process.env.CI ? 1 : 0,
retries : process.env.CI ? 2 : 0,

/* Opt out of parallel tests on CI. */
// workers : process.env.CI ? 1 : undefined,
Expand Down
8 changes: 6 additions & 2 deletions sh/test-show-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ if test -f "./results/end-to-end-report-account"; then
echo " " `grep passed ./results/end-to-end-report-account`
pending=`egrep -e '([0-9]+ pending)' ./results/end-to-end-report-account`
if [ "$pending" ]; then echo " $pending"; fi
skipped=`egrep -e '([0-9]+ skipped|[0-9]+ flakey)' ./results/end-to-end-report-account`
skipped=`egrep -e '([0-9]+ skipped)' ./results/end-to-end-report-account`
if [ "$skipped" ]; then echo " $skipped"; fi
flaky=`egrep -e '([0-9]+ flakey|[0-9]+ flaky)' ./results/end-to-end-report-account`
if [ "$flaky" ]; then echo " $flaky"; fi
failed=`egrep -e '([0-9]+ failing|[0-9]+ failed)' ./results/end-to-end-report-account`
if [ "$failed" ]; then echo " $failed"; fi
echo
Expand All @@ -67,8 +69,10 @@ for i in {1..8}; do
echo " " `grep passed ./results/end-to-end-report-$i`
pending=`egrep -e '([0-9]+ pending)' ./results/end-to-end-report-$i`
if [ "$pending" ]; then echo " $pending"; fi
skipped=`egrep -e '([0-9]+ skipped|[0-9]+ flakey)' ./results/end-to-end-report-$i`
skipped=`egrep -e '([0-9]+ skipped)' ./results/end-to-end-report-$i`
if [ "$skipped" ]; then echo " $skipped"; fi
flaky=`egrep -e '([0-9]+ flakey|[0-9]+ flaky)' ./results/end-to-end-report-$i`
if [ "$flaky" ]; then echo " $flaky"; fi
failed=`egrep -e '([0-9]+ failing|[0-9]+ failed)' ./results/end-to-end-report-$i`
if [ "$failed" ]; then echo " $failed"; fi
echo
Expand Down
5 changes: 2 additions & 3 deletions test/end-to-end/cashboxes/cashboxes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ test.describe('Cashboxes', () => {
await TU.locator('[data-currency-id="1"]').click();

// confirm that the modal appears
// ??? await TU.exists('[uib-modal-window]', true);
await TU.locator('[uib-modal-window]');
await TU.exists(by.name('CashboxModalForm'));
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.name('CashboxModalForm'));

await accountSelect.set('Gain de change', 'account-id');
await accountSelect.set('Différences de change', 'transfer-account-id');
Expand Down
3 changes: 2 additions & 1 deletion test/end-to-end/creditorGroups/creditor_groups.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ test.describe('Creditor Groups Management', () => {
// click the "delete" button
await TU.buttons.delete();

await TU.modal.submit();
await TU.modal.submit(); // Confirm the deletion

await components.notification.hasSuccess();
});

Expand Down
39 changes: 34 additions & 5 deletions test/end-to-end/stock/stock.aggregate_consumption.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const moment = require('moment');

const { test } = require('@playwright/test');
const TU = require('../shared/TestUtils');
const { by } = require('../shared/TestUtils');

const components = require('../shared/components');

Expand Down Expand Up @@ -126,15 +127,14 @@ function StockAggregateConsumptionTests() {
quantity_lost : 0,
}];

console.debug('A');
await page.setDetailed(1, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');
console.debug('B');
TU.screenshot('results/setLots.png');

await page.setLots(lots);
console.debug('C');

await page.setQuantityConsumed(2, 7, 500);
await page.setQuantityLost(2, 8, 250);
Expand All @@ -152,6 +152,12 @@ function StockAggregateConsumptionTests() {
}];

await page.setDetailed(2, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');

await page.setLots(lots2);

await page.setHeaderValue(3, 9, 20);
Expand Down Expand Up @@ -194,6 +200,12 @@ function StockAggregateConsumptionTests() {
}];

await page.setDetailed(1, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');

await page.setLotsError(lots);
});

Expand Down Expand Up @@ -231,6 +243,12 @@ function StockAggregateConsumptionTests() {
}];

await page.setDetailed(1, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');

await page.setLotsError(lots);
});

Expand All @@ -250,7 +268,6 @@ function StockAggregateConsumptionTests() {

// Wait until the rows are loaded
await TU.waitForSelector('div.ui-grid-row');

await page.setHeaderValue(0, 9, 5);
await page.setQuantityConsumed(1, 7, 15);
await page.setQuantityLost(1, 8, 5);
Expand All @@ -268,6 +285,12 @@ function StockAggregateConsumptionTests() {
}];

await page.setDetailed(1, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');

await page.setLotsError(lots);
});

Expand Down Expand Up @@ -305,6 +328,12 @@ function StockAggregateConsumptionTests() {
}];

await page.setDetailed(1, 10);

// Wait until the modal is fully up
await TU.waitForSelector('.modal-dialog');
await TU.waitForSelector(by.repeater('(colRenderIndex, col) in colContainer.renderedColumns track by col.uid'));
await TU.waitForSelector('bh-date-picker[date="row.entity.end_date"] input');

await page.setLotsError(lots);
});

Expand Down
1 change: 1 addition & 0 deletions test/end-to-end/stock/stock.entry.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function StockEntryPage() {
page.openLotsModal = async (inventoryRowNumber) => {
const launchLots = await GU.getCell(gridId, inventoryRowNumber, 4);
await launchLots.locator('[data-lots]').click();
return TU.waitForSelector('.modal-dialog');
};

/**
Expand Down
11 changes: 4 additions & 7 deletions test/end-to-end/transactionType/transactionType.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,15 @@ test.describe('transaction types', () => {

test('successfully updates an existing transaction type', async () => {
const editButton = `[data-edit-type="${newType.text}"]`;
console.debug('1: ', editButton);
TU.screenshot('results/transaction.png');
await TU.waitForSelector(editButton);
console.debug('2');

await TU.locator(editButton).click();
console.debug('3');

await TU.input('$ctrl.transactionType.text', updateType.text);
console.debug('4');
await TU.select('$ctrl.transactionType.type', updateType.type);
console.debug('5');

await TU.buttons.submit();
console.debug('6');

await components.notification.hasSuccess();
});

Expand Down
11 changes: 3 additions & 8 deletions test/end-to-end/weekendConfig/weekend_config.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,17 @@ const { notification } = require('../shared/components');
class WeekendConfigPage {

async create(label) {
console.debug('X1');
TU.screenshot('results/weekend.png');

await TU.buttons.create();
console.debug('X2');

await TU.input('WeekendModalCtrl.weekend.label', label);
console.debug('X3');

await TU.locator('[data-label="FORM.LABELS.WEEK_DAYS.SUNDAY"]').click();
console.debug('X4');
await TU.locator('[data-label="FORM.LABELS.WEEK_DAYS.MONDAY"]').click();
console.debug('X5');
await TU.locator('[data-label="FORM.LABELS.WEEK_DAYS.SATURDAY"]').click();
console.debug('X6');

await TU.modal.submit();
console.debug('X7');

return notification.hasSuccess();
}

Expand Down
46 changes: 28 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2128,16 +2128,26 @@ cookie-signature@1.0.6:
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"
integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==

cookie@0.4.2, cookie@~0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==
cookie-signature@1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.7.tgz#ab5dd7ab757c54e60f37ef6550f481c426d10454"
integrity sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==

cookie@0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==

cookie@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==

cookie@~0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==

cookiejar@^2.1.4:
version "2.1.4"
resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b"
Expand Down Expand Up @@ -2743,10 +2753,10 @@ dot-prop@^6.0.1:
dependencies:
is-obj "^2.0.0"

dotenv@^16.4.0:
version "16.4.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.0.tgz#ac21c3fcaad2e7832a1cd0c0e4e8e52225ecda0e"
integrity sha512-WvImr5kpN5NGNn7KaDjJnLTh5rDVLZiDf/YLA8T1ZEZEBZNEDOE+mnkS0PVjPax8ZxBP5zC5SLMB3/9VV5de9g==
dotenv@^16.4.1:
version "16.4.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.1.tgz#1d9931f1d3e5d2959350d1250efab299561f7f11"
integrity sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==

dotgitignore@^2.1.0:
version "2.1.0"
Expand Down Expand Up @@ -3159,10 +3169,10 @@ eslint-plugin-import@^2.29.1:
semver "^6.3.1"
tsconfig-paths "^3.15.0"

eslint-plugin-jsdoc@^48.0.2:
version "48.0.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.2.tgz#b843107e8caec57b8b463f04797be3b30d6a52da"
integrity sha512-CBFl5Jc7+jlV36RwDm+PQ8Uw5r28pn2/uW/OaB+Gw5bFwn4Py/1eYMZ3hGf9S4meUFZ/sRvS+hVif2mRAp6WqQ==
eslint-plugin-jsdoc@^48.0.4:
version "48.0.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.4.tgz#ca54da8937b2f6fd242a16dbb1b9ff5050baf223"
integrity sha512-A0cH+5svWPXzGZszBjXA1t0aAqVGS+/x3i02KFmb73rU0iMLnadEcVWcD/dGBZHIfAMKr3YpWh58f6wn4N909w==
dependencies:
"@es-joy/jsdoccomment" "~0.41.0"
are-docs-informative "^0.0.2"
Expand Down Expand Up @@ -3432,13 +3442,13 @@ express-handlebars@^7.1.2:
graceful-fs "^4.2.11"
handlebars "^4.7.8"

express-session@^1.17.3:
version "1.17.3"
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.3.tgz#14b997a15ed43e5949cb1d073725675dd2777f36"
integrity sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==
express-session@^1.18.0:
version "1.18.0"
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.18.0.tgz#a6ae39d9091f2efba5f20fc5c65a3ce7c9ce16a3"
integrity sha512-m93QLWr0ju+rOwApSsyso838LQwgfs44QtOP/WBiwtAgPIo/SAh1a5c6nn2BR6mFNZehTpqKDESzP+fRHVbxwQ==
dependencies:
cookie "0.4.2"
cookie-signature "1.0.6"
cookie "0.6.0"
cookie-signature "1.0.7"
debug "2.6.9"
depd "~2.0.0"
on-headers "~1.0.2"
Expand Down

0 comments on commit 1f1e484

Please sign in to comment.