Skip to content

Commit f37312e

Browse files
committed
fix: set test id for pending tests
1 parent 3d19fee commit f37312e

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
describe('No tests', function () {
2+
it.skip('A ', function () {
3+
cy.visit('/');
4+
cy.get('#simpleSearch').type('Africa');
5+
cy.get('.suggestions-result').first().click();
6+
cy.scrollTo(0, 1200);
7+
8+
cy.contains('adssaf');
9+
});
10+
it.skip('B ', function () {
11+
cy.visit('/');
12+
cy.get('#simpleSearch').type('Africa');
13+
cy.get('.suggestions-result').first().click();
14+
cy.scrollTo(0, 1200);
15+
cy.contains('giraffes');
16+
});
17+
});

packages/cypress-cloud/lib/results/combine.ts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,27 @@ function getSpecResults(specResults: SpecResult, attempts?: any[]) {
4242
return specResults;
4343
}
4444

45-
const enhancedTestList = (specResults.tests ?? []).map((test: any) => {
46-
const testFullTitle = test.title.join(" ");
47-
const standaloneAttempts = attempts.filter(
48-
(attempt) => attempt.fullTitle === testFullTitle
49-
);
50-
test.attempts = standaloneAttempts.map((attempt) => ({
51-
state: attempt.state,
52-
error: getAttemptError(attempt.err),
53-
timings: attempt.timings,
54-
wallClockStartedAt: attempt.wallClockStartedAt,
55-
wallClockDuration: attempt.duration,
56-
videoTimestamp: getAttemptVideoTimestamp(
57-
parseISO(attempt.wallClockStartedAt).getTime(),
58-
parseISO(specResults.stats.startedAt).getTime()
59-
),
60-
}));
61-
test.testId = standaloneAttempts[0].id;
62-
return test;
63-
});
45+
const enhancedTestList = (specResults.tests ?? []).map(
46+
(test: any, i: number) => {
47+
const testFullTitle = test.title.join(" ");
48+
const standaloneAttempts = attempts.filter(
49+
(attempt) => attempt.fullTitle === testFullTitle
50+
);
51+
test.attempts = standaloneAttempts.map((attempt) => ({
52+
state: attempt.state,
53+
error: getAttemptError(attempt.err),
54+
timings: attempt.timings,
55+
wallClockStartedAt: attempt.wallClockStartedAt,
56+
wallClockDuration: attempt.duration,
57+
videoTimestamp: getAttemptVideoTimestamp(
58+
parseISO(attempt.wallClockStartedAt).getTime(),
59+
parseISO(specResults.stats.startedAt).getTime()
60+
),
61+
}));
62+
test.testId = standaloneAttempts[0]?.id ?? `r${i}}`;
63+
return test;
64+
}
65+
);
6466

6567
return {
6668
..._.cloneDeep(specResults),

0 commit comments

Comments
 (0)