mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-04 18:08:54 +00:00
test(e2e): stabilize Detox and Maestro suites and harden CI - Re-enable stabilized cases and document remaining iOS skips. - Improve selectors, navigation recovery, state assertions, and retry limits. - Harden API retries, fixture setup, and server configuration cleanup. - Increase Detox shards to 24 and improve reporting, artifact uploads, and timeout handling. - Add testIDs and unit-test fixes; revert unproven app behavior changes.
50 lines
2.0 KiB
JavaScript
50 lines
2.0 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
const assert = require('node:assert/strict');
|
|
const {describe, it} = require('node:test');
|
|
|
|
const {generateShortSummary, getAllTestsFromJestResults} = require('./report');
|
|
|
|
describe('getAllTestsFromJestResults', () => {
|
|
it('deduplicates retries, gives failures precedence, and preserves matching names in different files', () => {
|
|
const report = {
|
|
testResults: [
|
|
{
|
|
testFilePath: 'first.e2e.ts',
|
|
perfStats: {start: 1000},
|
|
testResults: [
|
|
{fullName: 'passes once', status: 'passed', duration: 100},
|
|
{fullName: 'duplicate result', status: 'passed', duration: 200},
|
|
{fullName: 'skipped test', status: 'pending', duration: 0},
|
|
],
|
|
},
|
|
{
|
|
testFilePath: 'first.e2e.ts',
|
|
perfStats: {start: 2000},
|
|
testResults: [
|
|
{fullName: 'duplicate result', status: 'failed', duration: 300, failureMessages: ['failed later']},
|
|
],
|
|
},
|
|
{
|
|
testFilePath: 'second.e2e.ts',
|
|
testResults: [
|
|
{fullName: 'duplicate result', status: 'passed', duration: 500},
|
|
{fullName: 'another pass', status: 'passed', duration: 400},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
|
|
const allTests = getAllTestsFromJestResults(report);
|
|
const summary = generateShortSummary(allTests);
|
|
|
|
assert.equal(summary.stats.tests, 5);
|
|
assert.equal(summary.stats.passes, 3);
|
|
assert.equal(summary.stats.failures, 1);
|
|
assert.equal(summary.stats.skipped, 1);
|
|
assert.equal(summary.stats.passPercent, '60.00');
|
|
assert.equal(summary.stats.suites, 2);
|
|
});
|
|
});
|