Skip to content

Commit 033d9ce

Browse files
committed
Exploring Cypress selectors for failing table test
1 parent 6ef81f0 commit 033d9ce

File tree

1 file changed

+38
-36
lines changed
  • frontend/cypress/e2e/block-production/won-slots

1 file changed

+38
-36
lines changed

frontend/cypress/e2e/block-production/won-slots/table.cy.ts

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,47 +52,49 @@ describe('BLOCK PRODUCTION WON SLOTS TABLE', () => {
5252
.its('store')
5353
.then(getBPWonSlots)
5454
.then((state: BlockProductionWonSlotsState) => {
55-
if (state && state.slots) {
56-
cy.task('log', state.slots.length.toString());
57-
}
58-
cy.task('log', condition(state).toString());
59-
// This WILL show in CI logs
60-
cy.task('log', '🔍 Starting table structure debug...');
61-
62-
cy.get('mina-block-production-won-slots-table', { timeout: 15000 })
63-
.should('exist')
64-
.then(() => {
65-
cy.task('log', '✅ Main table element found');
66-
});
55+
if (condition(state)) {
56+
if (state && state.slots) {
57+
cy.task('log', state.slots.length.toString());
58+
}
59+
cy.task('log', condition(state).toString());
60+
// This WILL show in CI logs
61+
cy.task('log', '🔍 Starting table structure debug...');
62+
63+
cy.get('mina-block-production-won-slots-table', { timeout: 15000 })
64+
.should('exist')
65+
.then(() => {
66+
cy.task('log', '✅ Main table element found');
67+
});
6768

68-
cy.get('mina-block-production-won-slots-table .head', { timeout: 15000 })
69-
.should('exist')
70-
.then(($head) => {
71-
cy.task('log', `✅ Table head found, length: ${$head.length}`);
72-
cy.task('log', `Head HTML: ${$head.html()}`);
73-
});
69+
cy.get('mina-block-production-won-slots-table .head', { timeout: 15000 })
70+
.should('exist')
71+
.then(($head) => {
72+
cy.task('log', `✅ Table head found, length: ${$head.length}`);
73+
cy.task('log', `Head HTML: ${$head.html()}`);
74+
});
7475

75-
cy.get('mina-block-production-won-slots-table .head > span')
76-
.should('exist')
77-
.then(($spans) => {
78-
cy.task('log', `✅ Header spans found, count: ${$spans.length}`);
79-
$spans.each((index, span) => {
80-
cy.task('log', `Span ${index + 1}: "${span.textContent}" Visible: ${Cypress.$(span).is(':visible')}`);
76+
cy.get('mina-block-production-won-slots-table .head > span')
77+
.should('exist')
78+
.then(($spans) => {
79+
cy.task('log', `✅ Header spans found, count: ${$spans.length}`);
80+
$spans.each((index, span) => {
81+
cy.task('log', `Span ${index + 1}: "${span.textContent}" Visible: ${Cypress.$(span).is(':visible')}`);
82+
});
8183
});
82-
});
8384

84-
// Test the exact failing selector
85-
cy.get('body').then(() => {
86-
// Check if the element exists at all
87-
const element = Cypress.$('mina-block-production-won-slots-table .head > span:nth-child(1)');
88-
cy.task('log', `❓ nth-child(1) selector found: ${element.length} elements`);
85+
// Test the exact failing selector
86+
cy.get('body').then(() => {
87+
// Check if the element exists at all
88+
const element = Cypress.$('mina-block-production-won-slots-table .head > span:nth-child(1)');
89+
cy.task('log', `❓ nth-child(1) selector found: ${element.length} elements`);
8990

90-
if (element.length > 0) {
91-
cy.task('log', `Element text: "${element.text()}"`);
92-
cy.task('log', `Element visible: ${element.is(':visible')}`);
93-
cy.task('log', `Element position: ${JSON.stringify(element.offset())}`);
94-
}
95-
});
91+
if (element.length > 0) {
92+
cy.task('log', `Element text: "${element.text()}"`);
93+
cy.task('log', `Element visible: ${element.is(':visible')}`);
94+
cy.task('log', `Element position: ${JSON.stringify(element.offset())}`);
95+
}
96+
});
97+
}
9698
});
9799
}));
98100

0 commit comments

Comments
 (0)